conda env config vars set LD_LIBRARY_PATH="/home/cyl/miniconda3/envs/dinov2/lib/" conda env config vars set CPATH="/home/cyl/miniconda3/envs/dinov2/include/" conda env config vars set CUDA_HOME="/home/cyl/miniconda3/envs/dinov2/"
conda env config vars set LD_LIBRARY_PATH="/home/cyl/miniconda3/envs/gsam/lib/python3.10/site-packages/nvidia/cuda_runtime/lib/:$LD_LIBRARY_PATH" conda env config vars set CPATH="/home/cyl/miniconda3/envs/gsam/lib/python3.10/site-packages/nvidia/cuda_runtime/include/:$CPATH" conda env config vars set CUDA_HOME="/home/cyl/miniconda3/envs/gsam/"
Note: 注意改变了库路径之后nvim中的lsp会报错,建议之后改回去
1 2 3
conda env config vars set LD_LIBRARY_PATH="" conda env config vars set CPATH="" conda env config vars set CUDA_HOME=""
Note: To find the correct path for CUDA_HOME use which nvcc. In my case, output of the command was:
1 2
>>> which nvcc /home/user/miniconda3/envs/py12/bin/nvcc
Therefore, I set the CUDA_HOME as /home/user/miniconda3/envs/py12/.
Note: To find the correct path for LD_LIBRARY_PATH use find ~ -name cuda_runtime_api.h. In my case, output of the command was:
So I set the LD_LIBRARY_PATH as /home/user/miniconda3/envs/py12/targets/x86_64-linux/lib/ and CPATH as /home/user/miniconda3/envs/py12/targets/x86_64-linux/include/. If you have multiple CUDA installations, the output of find ~ -name cuda_runtime_api.h will display multiple paths. Make sure to choose the path that corresponds to the environment you have created.