question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CUDA_HOME environment variable is not set

See original GitHub issue

Hi,

When I try running this from the readme usage section: python main.py --text "a hamburger" --workspace trial -O

I get this error: OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

What should I do about this?

Here is the full error:

C:\Users\Matthew\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\amp\autocast_mode.py:198: UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling
  warnings.warn('User provided device_type of \'cuda\', but CUDA is not available. Disabling')
Traceback (most recent call last):
  File "D:\CodeProjects\VisualStudioCode\Other\DreamFusion\stable-dreamfusion\raymarching\raymarching.py", line 10, in <module>
    import _raymarching as _backend
ModuleNotFoundError: No module named '_raymarching'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 84, in <module>
    from nerf.network_grid import NeRFNetwork
  File "D:\CodeProjects\VisualStudioCode\Other\DreamFusion\stable-dreamfusion\nerf\network_grid.py", line 6, in <module>
    from .renderer import NeRFRenderer
  File "D:\CodeProjects\VisualStudioCode\Other\DreamFusion\stable-dreamfusion\nerf\renderer.py", line 12, in <module>
    import raymarching
  File "D:\CodeProjects\VisualStudioCode\Other\DreamFusion\stable-dreamfusion\raymarching\__init__.py", line 1, in <module>
    from .raymarching import *
  File "D:\CodeProjects\VisualStudioCode\Other\DreamFusion\stable-dreamfusion\raymarching\raymarching.py", line 12, in <module>
    from .backend import _backend
  File "D:\CodeProjects\VisualStudioCode\Other\DreamFusion\stable-dreamfusion\raymarching\backend.py", line 31, in <module>
    _backend = load(name='_raymarching',
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\cpp_extension.py", line 1202, in load
    return _jit_compile(
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\cpp_extension.py", line 1425, in _jit_compile
    _write_ninja_file_and_build_library(
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\cpp_extension.py", line 1514, in _write_ninja_file_and_build_library        
    extra_ldflags = _prepare_ldflags(
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\cpp_extension.py", line 1617, in _prepare_ldflags
    extra_ldflags.append(f'/LIBPATH:{_join_cuda_home("lib/x64")}')
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\utils\cpp_extension.py", line 2125, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
SpicyMelonYTcommented, Oct 12, 2022

So no that didn’t fix it. I think I will just wait till someone makes a more accessible version or someone makes a website to run it in, even a google colabs project would work!

0reactions
asitanccommented, Oct 11, 2022

it is available on NVIDIA website, CUDA Toolkit https://developer.nvidia.com/cuda-downloads you may want to look for CUDA 11.6

Read more comments on GitHub >

github_iconTop Results From Across the Web

CUDA_HOME environment variable is not set. Please set it to ...
Current Behavior from .functions import (ACT_ELU, ACT_RELU, ACT_LEAKY_RELU, inplace_abn, inplace_abn_sync) #calling this causes error ...
Read more >
python - Get CUDA_HOME environment path PYTORCH
726 return os.path.join(CUDA_HOME, *paths) OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
Read more >
cuda_home environment variable is not set ... - Code Grepper
1. Solution to above issue! ; 2. ​ ; 3. As cuda installed through anaconda is not the entire package. Please install cuda...
Read more >
Installation - IceVision
OSError : CUDA_HOME environment variable is not set. Please set it to your CUDA install root. Try installing it with: sudo apt install...
Read more >
CUDA_HOME environment variable is not set & No CUDA ...
Hello,. I installed the UBUNTU 16.04 and Anaconda with python 3.7, pytorch 1.5, and CUDA 10.1 on my own computer. However, when I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found