Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Already setted the CUDA_HOME but still:CUDA_HOME environment variable is not set. Please set it to your CUDA install root. #426

Open
xgh127 opened this issue Apr 4, 2024 · 1 comment

Comments

@xgh127
Copy link

xgh127 commented Apr 4, 2024

The error info is as below:I've already set the CUDA_HOME and checked it on my command line,but when I run setup.py,it still tells my that"CUDA_HOME environment variable is not set. Please set it to your CUDA install root."I wonder why?????????
(dmodel) C:\Users\xgh\tiny-cuda-nn\bindings\torch>python setup.py install
C:\Users\xgh\tiny-cuda-nn\bindings\torch\setup.py:5: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import parse_version
Building PyTorch extension for tiny-cuda-nn version 1.7
Obtained compute capabilities [86] from environment variable TCNN_CUDA_ARCHITECTURES
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Fri_Dec_17_18:28:54_Pacific_Standard_Time_2021
Cuda compilation tools, release 11.6, V11.6.55
Build cuda_11.6.r11.6/compiler.30794723_0
Detected CUDA version 11.6
Targeting C++ standard 17
Traceback (most recent call last):
File "C:\Users\xgh\tiny-cuda-nn\bindings\torch\setup.py", line 187, in
ext_modules = [make_extension(comp) for comp in compute_capabilities]
File "C:\Users\xgh\tiny-cuda-nn\bindings\torch\setup.py", line 187, in
ext_modules = [make_extension(comp) for comp in compute_capabilities]
File "C:\Users\xgh\tiny-cuda-nn\bindings\torch\setup.py", line 172, in make_extension
ext = CUDAExtension(
File "C:\Users\xgh\anaconda3\envs\dmodel\lib\site-packages\torch\utils\cpp_extension.py", line 1074, in CUDAExtension
library_dirs += library_paths(cuda=True)
File "C:\Users\xgh\anaconda3\envs\dmodel\lib\site-packages\torch\utils\cpp_extension.py", line 1208, in library_paths
paths.append(_join_cuda_home(lib_dir))
File "C:\Users\xgh\anaconda3\envs\dmodel\lib\site-packages\torch\utils\cpp_extension.py", line 2407, in _join_cuda_home
raise OSError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

(dmodel) C:\Users\xgh\tiny-cuda-nn\bindings\torch>echo %CUDA_HOME%
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6

@chill781
Copy link

chill781 commented May 6, 2024

This is likely because your PyTorch has not been compiled with CUDA support, and it's not an issue with CUDA_HOME. I would suggest reinstalling PyTorch with CUDA support. The PyTorch codebase can be quite messy at times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants