【debug】【联合编译】No CUDA runtime is found, using CUDA_HOME=‘/usr/local/cuda-10.0‘

Error:

No CUDA runtime is found, using CUDA_HOME=’/usr/local/cuda-10.0′

错误原因:

建议分步骤测试完成后再进行下一步。
没安装成功或者没有配置路径。
需要重新配置

nvcc -V
nvidia-smi

如果是多版本cuda,需要手动切换cuda的home位置到对应版本。

Torch和TorchVision需要与CUDA版本对应。如果你安装时候后没注意这个问题,就需要仔细检查一下

conda list
pip list
pip3 list

根据查询结果,使用install覆盖安装指定版本torch

如果是编译,需要由CPP环境,比如VS的c++、gcc等。
此问题一般出现在初始化、配置网络的setup中。

https://github.com/pytorch/pytorch/issues/22844

Multiple versions of CUDA are installed in a shared server. CUDA9 in /usr/local/cuda-9.0 linked to /usr/local/cuda; CUDA10 in /usr/local/cuda-10.0; and a newer CUDA10 in ~/.local/cuda-10.0.

The environment variables including PATH, CPATH, LD_LIBRARY_PATH are all assigned to the newer CUDA10 i.e. ~/.local/cuda-10.0. CUDA_HOME is not set.

While installing pytorch, it automatically learns to use the newer CUDA10 by calling tools.setup_helpers.cuda.CUDA_HOME, which calls which(nvcc).

The bug showed up while installing torch_scatter. That project utilizes the torch.utils.cpp_extension.CUDA_HOME to identify the cuda path in setup.py, which then results in a different cuda path from the one utilized for installing pytorch.

Typically, in the above server, here are the sample output:

$ python -c "from torch.utils.cpp_extension import CUDA_HOME; print(CUDA_HOME)"
/usr/local/cuda
$ cd pytorch && python -c "from tools.setup_helpers.cuda import CUDA_HOME; print(CUDA_HOME)"
/home/haotang/.local/cuda-10.0

Original: https://blog.csdn.net/prinTao/article/details/122403679
Author: prinTao
Title: 【debug】【联合编译】No CUDA runtime is found, using CUDA_HOME=‘/usr/local/cuda-10.0‘

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/706441/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球