Cryosparc installation failing with pycuda

Hi,

I am trying to install Cryosparc v4.2 on my ububtu 22.04.2 LTS workstation. But it’s failing with the following error.

This is the error at the end.

      ***error: command '/usr/bin/gcc' failed with exit code 1***
***      [end of output]***
***  ***
***  note: This error originates from a subprocess, and is likely not a problem with pip.***
***error: legacy-install-failure***

***× Encountered error while trying to install package.***
***╰─> pycuda***

***note: This is an issue with the package mentioned above, not pip.***
***hint: See above for output from the failure.***
***check_install_deps.sh: 66: ERROR: installing python failed.***

What I understand is the installation is failing to build "pycuda" wheel. below is the error log 
 ***note: This error originates from a subprocess, and is likely not a problem with pip.***
***  ERROR: Failed building wheel for pycuda***
***  Running setup.py clean for pycuda***
***Failed to build pycuda***

Does anybody know how to solve this issue?
Thanks for any help.

Which cuda version are you using. CryoSPARC only supports up to Cuda 11.8, so if you’re using Cuda 12, you will run into this issue

Welcome to the forum @vijaypkumar90.
Please can you post

  • additional lines from the error message that precede
  • the full command that resulted in this output
  • the output of nvidia-smi on the computer where you ran the command

You may also want to check out related topics.

Thank you @wtempel

The command I used for installing is:

./install.sh --standalone
–license $LICENSE_ID
–worker_path /Software/cryosparc/cryosparc_worker/
–cudapath /usr/local/cuda
–ssdpath /scratch/cryosparc_cache
–initial_email “xxxxx@gmail.com
–initial_password “xxxxxx”
–initial_username “vijay”
–initial_firstname “Vijay”
–initial_lastname “kumar”
–port 61000

The output of above command is really big and may be repetitive. So I am pasting last part of the output.

  src/cpp/cuda.hpp:143:27: note: in definition of macro ‘CUDAPP_CALL_GUARDED’
    143 |     cu_status_code = NAME ARGLIST; \
        |                           ^~~~~~~
  In file included from src/cpp/cuda.hpp:23,
                   from src/wrapper/wrap_cudadrv.cpp:3:
  /usr/local/cuda/include/cudaProfiler.h:143:36: note: declared here
    143 | __CUDA_DEPRECATED CUresult CUDAAPI cuProfilerInitialize(const char *configFile, const char *outputFile, CUoutput_mode outputMode);
        |                                    ^~~~~~~~~~~~~~~~~~~~
  src/wrapper/wrap_cudadrv.cpp: In function ‘pycudaboost::python::tuple {anonymous}::mem_alloc_pitch_wrap(size_t, size_t, unsigned int)’:
  src/wrapper/wrap_cudadrv.cpp:121:10: warning: ‘template<class> class std::auto_ptr’ is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
    121 |     std::auto_ptr<device_allocation> da;
        |          ^~~~~~~~
  In file included from /usr/include/c++/11/memory:76,
                   from bpl-subset/bpl_subset/boost/config/no_tr1/memory.hpp:21,
                   from bpl-subset/bpl_subset/boost/smart_ptr/shared_ptr.hpp:27,
                   from bpl-subset/bpl_subset/boost/shared_ptr.hpp:17,
                   from src/cpp/cuda.hpp:30,
                   from src/wrapper/wrap_cudadrv.cpp:3:
  /usr/include/c++/11/bits/unique_ptr.h:57:28: note: declared here
     57 |   template<typename> class auto_ptr;
        |                            ^~~~~~~~
  src/wrapper/wrap_cudadrv.cpp: In function ‘pycuda::module* {anonymous}::module_from_buffer(pycudaboost::python::api::object, pycudaboost::python::api::object, pycudaboost::python::api::object)’:
  src/wrapper/wrap_cudadrv.cpp:357:30: warning: ‘int PyObject_AsCharBuffer(PyObject*, const char**, Py_ssize_t*)’ is deprecated [-Wdeprecated-declarations]
    357 |     if (PyObject_AsCharBuffer(buffer.ptr(), &mod_buf, &len))
        |         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /Software/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/include/python3.8/Python.h:147,
                   from bpl-subset/bpl_subset/boost/python/detail/wrap_python.hpp:142,
                   from bpl-subset/bpl_subset/boost/python/detail/prefix.hpp:13,
                   from bpl-subset/bpl_subset/boost/python/args.hpp:8,
                   from bpl-subset/bpl_subset/boost/python.hpp:11,
                   from src/cpp/cuda.hpp:36,
                   from src/wrapper/wrap_cudadrv.cpp:3:
  /Software/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/include/python3.8/abstract.h:320:17: note: declared here
    320 | PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
        |                 ^~~~~~~~~~~~~~~~~~~~~
  src/wrapper/wrap_cudadrv.cpp: In member function ‘void {anonymous}::Linker::add_data(pycudaboost::python::api::object, CUjitInputType, pycudaboost::python::str)’:
  src/wrapper/wrap_cudadrv.cpp:502:34: warning: ‘int PyObject_AsCharBuffer(PyObject*, const char**, Py_ssize_t*)’ is deprecated [-Wdeprecated-declarations]
    502 |         if (PyObject_AsCharBuffer(py_data.ptr(), &data_buf, &data_buf_len) != 0) {
        |             ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from /Software/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/include/python3.8/Python.h:147,
                   from bpl-subset/bpl_subset/boost/python/detail/wrap_python.hpp:142,
                   from bpl-subset/bpl_subset/boost/python/detail/prefix.hpp:13,
                   from bpl-subset/bpl_subset/boost/python/args.hpp:8,
                   from bpl-subset/bpl_subset/boost/python.hpp:11,
                   from src/cpp/cuda.hpp:36,
                   from src/wrapper/wrap_cudadrv.cpp:3:
  /Software/cryosparc/cryosparc_worker/deps/anaconda/envs/cryosparc_worker_env/include/python3.8/abstract.h:320:17: note: declared here
    320 | PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
        |                 ^~~~~~~~~~~~~~~~~~~~~
  src/wrapper/wrap_cudadrv.cpp: In function ‘pycudaboost::python::handle<> {anonymous}::numpy_empty(pycudaboost::python::api::object, pycudaboost::python::api::object, pycudaboost::python::api::object, unsigned int)’:
  src/wrapper/wrap_cudadrv.cpp:574:10: warning: ‘template<class> class std::auto_ptr’ is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
    574 |     std::auto_ptr<Allocation> alloc(
        |          ^~~~~~~~
  In file included from /usr/include/c++/11/memory:76,
                   from bpl-subset/bpl_subset/boost/config/no_tr1/memory.hpp:21,
                   from bpl-subset/bpl_subset/boost/smart_ptr/shared_ptr.hpp:27,
                   from bpl-subset/bpl_subset/boost/shared_ptr.hpp:17,
                   from src/cpp/cuda.hpp:30,
                   from src/wrapper/wrap_cudadrv.cpp:3:
  /usr/include/c++/11/bits/unique_ptr.h:57:28: note: declared here
     57 |   template<typename> class auto_ptr;
        |                            ^~~~~~~~
  src/wrapper/wrap_cudadrv.cpp: In function ‘pycudaboost::python::handle<> {anonymous}::register_host_memory(pycudaboost::python::api::object, unsigned int)’:
  src/wrapper/wrap_cudadrv.cpp:615:10: warning: ‘template<class> class std::auto_ptr’ is deprecated: use 'std::unique_ptr' instead [-Wdeprecated-declarations]
    615 |     std::auto_ptr<registered_host_memory> regmem(
        |          ^~~~~~~~
  In file included from /usr/include/c++/11/memory:76,
                   from bpl-subset/bpl_subset/boost/config/no_tr1/memory.hpp:21,
                   from bpl-subset/bpl_subset/boost/smart_ptr/shared_ptr.hpp:27,
                   from bpl-subset/bpl_subset/boost/shared_ptr.hpp:17,
                   from src/cpp/cuda.hpp:30,
                   from src/wrapper/wrap_cudadrv.cpp:3:
  /usr/include/c++/11/bits/unique_ptr.h:57:28: note: declared here
     57 |   template<typename> class auto_ptr;
        |                            ^~~~~~~~
  src/wrapper/wrap_cudadrv.cpp: In function ‘void init_module__driver()’:
  src/wrapper/wrap_cudadrv.cpp:997:26: error: ‘CU_TARGET_COMPUTE_20’ was not declared in this scope; did you mean ‘CU_TARGET_COMPUTE_90’?
    997 |     .value("COMPUTE_20", CU_TARGET_COMPUTE_20)
        |                          ^~~~~~~~~~~~~~~~~~~~
        |                          CU_TARGET_COMPUTE_90
  src/wrapper/wrap_cudadrv.cpp:1000:26: error: ‘CU_TARGET_COMPUTE_21’ was not declared in this scope; did you mean ‘CU_TARGET_COMPUTE_61’?
   1000 |     .value("COMPUTE_21", CU_TARGET_COMPUTE_21)
        |                          ^~~~~~~~~~~~~~~~~~~~
        |                          CU_TARGET_COMPUTE_61
  error: command '/usr/bin/gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pycuda

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
check_install_deps.sh: 66: ERROR: installing python failed.

The output of nvidia-smi command

$ nvidia-smi
Fri Jul 14 10:58:21 2023
±--------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.54.03 Driver Version: 535.54.03 CUDA Version: 12.2 |
|-----------------------------------------±---------------------±---------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce RTX 2080 Ti Off | 00000000:18:00.0 Off | N/A |
| 30% 29C P8 10W / 250W | 6MiB / 11264MiB | 0% Default |
| | | N/A |
±----------------------------------------±---------------------±---------------------+
| 1 NVIDIA GeForce RTX 2080 Ti Off | 00000000:3B:00.0 Off | N/A |
| 30% 32C P8 12W / 250W | 6MiB / 11264MiB | 0% Default |
| | | N/A |
±----------------------------------------±---------------------±---------------------+
| 2 NVIDIA GeForce RTX 2080 Ti Off | 00000000:86:00.0 Off | N/A |
| 30% 31C P8 5W / 250W | 6MiB / 11264MiB | 0% Default |
| | | N/A |
±----------------------------------------±---------------------±---------------------+
| 3 NVIDIA GeForce RTX 2080 Ti Off | 00000000:AF:00.0 On | N/A |
| 30% 31C P8 28W / 250W | 321MiB / 11264MiB | 1% Default |
| | | N/A |
±----------------------------------------±---------------------±---------------------+

±--------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 3453 G /usr/lib/xorg/Xorg 4MiB |
| 1 N/A N/A 3453 G /usr/lib/xorg/Xorg 4MiB |
| 2 N/A N/A 3453 G /usr/lib/xorg/Xorg 4MiB |
| 3 N/A N/A 3453 G /usr/lib/xorg/Xorg 122MiB |
| 3 N/A N/A 3771 G /usr/bin/gnome-shell 29MiB |
| 3 N/A N/A 34650 G …irefox/2908/usr/lib/firefox/firefox 167MiB |
±--------------------------------------------------------------------------------------+

Thanks @vijaypkumar90 for this information.

What is the output of the command

/usr/local/cuda/bin/nvcc --version

?

@wtempel
Here is the output of /usr/local/cuda/bin/nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Mon_Apr__3_17:16:06_PDT_2023
Cuda compilation tools, release 12.1, V12.1.105
Build cuda_12.1.r12.1/compiler.32688072_0

and the output of nvcc --version

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Thu_Nov_18_09:45:30_PST_2021
Cuda compilation tools, release 11.5, V11.5.119
Build cuda_11.5.r11.5/compiler.30672275_0

The install.sh --cudapath parameter must point to a version of the toolkit that is supported by CryoSPARC, but version 11.8 is the newest version currently supported.
Suggestion:
Let /path/to/cryosparc be the directory that holds the cryosparc_master and cryosparc_worker. If there is enough space inside /path/to/cryosparc, you could run these commands under the non-root Linux account under which you will also install CryoSPARC (details):

cd /path/to/cryosparc/
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_520.61.05_linux.run
bash cuda_11.8.0_520.61.05_linux.run --silent --toolkit --toolkitpath=/path/to/cryosparc/cuda-11.8.0 --defaultroot=/path/to/cryosparc/cuda-11.8.0

and later use

--cudapath /path/to/cryosparc/cuda-11.8.0

during installation of CryoSPARC.

1 Like

@wtempel Thank you so much.

i was not able install the rpm. But I followed a different method to downgrade my cuda version.
After that the installation was successful.
thank you again.