No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7'

I am attempting to build the wheel for installing torchdynamo from PyPI. However, the installation process fails due to a Visual Studio linker error. Initially, I tried building it with the latest version of the CUDA toolkit. Later, I installed an older version to test for potential compatibility issues between the CUDA toolkit and PyTorch Dynamo. Both attempts resulted in a similar error: “No CUDA runtime is found, using CUDA_HOME=‘C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7’”. I set the CUDA_HOME environment variable by manually browsing for the folder, so I know it exists. However, I am unsure if there is anything else required for Visual Studio to locate the installation.

As I am using Windows, the following post, which addresses a similar issue, is not helpful:

Another post I found was also not helpful, as it does not provide any information on resolving the problem. Moreover, it pertains to finding the runtime while using PyTorch, rather than linking to it during the installation of a dependent program:

‘No CUDA runtime is found, using CUDA_HOME=‘C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2’ - Deep Learning (Training & Inference) / Frameworks - NVIDIA Developer Forums’

Currently, I have both versions 12.1 and 11.7 of the CUDA Toolkits installed. However, my CUDA_HOME is set to the older version due to this post:

‘What’s the relationship between cuda_toolkit and pytorch - CUDA / CUDA Setup and Installation - NVIDIA Developer Forums’

I previously read on the PyTorch GitHub repository that the latest version was compatible with the CUDA toolkit 11.7. However, I am uncertain if this information is still accurate.

Note: new users can only post one link so the other two are the titles of the posts.

1 Like

I am having a similar problem trying to compile xformers with CUDA v11.8 which to my knowledge is compatible with everything in my environment.

Have you figured this out? I’m having this issue too but I cannot find a resolution.