Cannot recompile with new cuda after a previous "cryosparcw newcuda" run failed

When I tried to upgrade to cuda-10.1 for 3D variability job, I accidentally ran:
cryosparcw newcuda /path/to/cuda-10.1
when /usr/local/cuda is pointed to an incorrect directory
I got the following error:
In file included from src/cpp/cuda.cpp:1:0:
src/cpp/cuda.hpp:14:18: fatal error: cuda.h: No such file or directory
#include <cuda.h>
compilation terminated.
error: command ‘gcc’ failed with exit status 1


Command “/home/czhao/cryosparc/cryosparc2_worker/deps/anaconda/bin/python -u -c “import setuptools, tokenize;file=’/tmp/pip-B041OK-build/’;f=getattr(tokenize, ‘open’, open)(file);’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-AFIs_n-record/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-B041OK-build/

Then I corrected the /usr/local/cuda path, but every time I ran:
cryosparcw newcuda /path/to/cuda-10.1
I got the following error:
New CUDA Path was provided as /home/data0/data0/cuda-10.1
Checking CUDA installation…
Found nvcc at /home/data0/data0/cuda-10.1/bin/nvcc
The above cuda installation will be used but can be changed later.
Proceeding to uninstall pycuda…
Cannot uninstall requirement pycuda, not installed

Does anyone know how I can solve this problem?

Thanks a lot!

Hey @chenzhao,

You can get around this by installing pycuda manually, then editing the config file to have the new path.
cd cryosparc2_worker
eval $(bin/cryosparcw env)
pip install "deps_bundle/python/python_packages/pip_packages/pycuda-2018.1.1.tar.gz" --no-cache-dir

nano cryosparc2_worker/
//edit the line CRYOSPARC_CUDA_PATH to have the new path
//save and exit

Thank you so much for your reply! I am sorry that I got impatient and fixed cryosparc by first updating to an older version than updating to the newest version. But it is very good to know that I can install pycuda separately, and I will certainly do this (which is the correct way) in the future!