Variable error in cryosparcw when recent version of torch is installed

In cryosparcw:
[…]
activate_gpu_env() {
if [[ “$CRYOSPARC_USE_GPU” = “true” ]] ; then
if ! is_pytorch_available; then
pathprepend “$CRYOSPARC_CUDA_PATH/bin”
pathprepend “$root_dir/deps/external/cudnn/lib” LD_LIBRARY_PATH
pathprepend “$CRYOSPARC_CUDA_PATH/lib64” LD_LIBRARY_PATH
else
# use cudnn provided via ‘pip install torch’
pathprepend “$CRYOSPARC_ROOT_DIR/deps/anaconda/envs/$CRYOSPARC_CONDA_ENV/lib/python3.7/site-packages/nvidia/cudnn/lib” LD_LIBRARY_PATH
fi
fi
[…]

New version of torch (e.g. 1.13.1) will install packages for python3.8
So shouldn’t it be:
pathprepend “$CRYOSPARC_ROOT_DIR/deps/anaconda/envs/$CRYOSPARC_CONDA_ENV/lib/python3.8/site-packages/nvidia/cudnn/lib” LD_LIBRARY_PATH

Thanks
JC

@jcducom Please can you provide additional background for this issue:

  • What were you aiming to achieve?
  • What command(s) did you run?
  • What were unexpected outputs or error messages?

Thanks.

The issue appeared when I install topaz within cryosparc. Topaz installs torch/cuda toolkit as dependencies. Due to the test in activate_gpu_env function, it will set LD_LIBRARY_PATH to /lib/python3.7 instead of /lib/python3.8… Topaz will not work as it cannot find the cuda libraries.
Am I doing something wrong?
Thank you
JC

I recommend

  • not directly manipulating LD_LIBRARY_PATH, as this may interfere with CryoSPARC maintenance and operation
  • not modifying the CryoSPARC conda environments
  • installing Topaz in a dedicated conda environment
  • creating a script like this that can be used with the Path to Topaz executable parameter of Topaz jobs inside CryoSPARC.

Will do. Thank you!
JC