python - How to use Numba Cuda without Conda? - Stack Overflow

I don't use Conda. I have downloaded and installed cuda_12.8.1_572.61_windows.exe from the officia

I don't use Conda. I have downloaded and installed cuda_12.8.1_572.61_windows.exe from the official link. I have installed numba 0.61.0, numba-cuda 0.8.0, llvmlite 0.44.0, numpy 2.1.3, cuda-python 12.8.0, cuda-bindings 12.8.0 and pwin32 308.

I am trying to generate images programmatically, one bottleneck I have identified is that arctan2 and other trigonometric functions are extremely slow. Fortunately I have a GPU, so I am trying to use the GPU to generate the images by using Numba CUDA. The GPU in question is NVIDIA Geforce GTX 1050 Ti with 4GiB RAM (I am planning to upgrade it).

I am following this guide, but I can't make the code run, I get this error:

NvvmSupportError: libNVVM cannot be found. Do `conda install cudatoolkit`:
Could not find module 'nvvm.dll' (or one of its dependencies). Try using the full path with constructor syntax.

I don't use Anaconda or Miniconda. How can I fix this?


I have found the .dll file here:

PS C:\Users\xenig> get-childitem -path "C:\Program Files\NVIDIA GPU Computing Toolkit" -recurse -filter 'nvvm*.dll'

    Directory: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\nvvm\bin

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          2025-02-22    13:18       52873216 nvvm64_40_0.dll

Now what?


I have tried this:

import os

os.environ['NUMBAPRO_NVVM'] = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.8/nvvm/bin/nvvm64_40_0.dll"
os.environ['NUMBAPRO_LIBDEVICE'] = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.8/nvvm/libdevice"

It doesn't work.

I don't use Conda. I have downloaded and installed cuda_12.8.1_572.61_windows.exe from the official link. I have installed numba 0.61.0, numba-cuda 0.8.0, llvmlite 0.44.0, numpy 2.1.3, cuda-python 12.8.0, cuda-bindings 12.8.0 and pwin32 308.

I am trying to generate images programmatically, one bottleneck I have identified is that arctan2 and other trigonometric functions are extremely slow. Fortunately I have a GPU, so I am trying to use the GPU to generate the images by using Numba CUDA. The GPU in question is NVIDIA Geforce GTX 1050 Ti with 4GiB RAM (I am planning to upgrade it).

I am following this guide, but I can't make the code run, I get this error:

NvvmSupportError: libNVVM cannot be found. Do `conda install cudatoolkit`:
Could not find module 'nvvm.dll' (or one of its dependencies). Try using the full path with constructor syntax.

I don't use Anaconda or Miniconda. How can I fix this?


I have found the .dll file here:

PS C:\Users\xenig> get-childitem -path "C:\Program Files\NVIDIA GPU Computing Toolkit" -recurse -filter 'nvvm*.dll'

    Directory: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\nvvm\bin

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          2025-02-22    13:18       52873216 nvvm64_40_0.dll

Now what?


I have tried this:

import os

os.environ['NUMBAPRO_NVVM'] = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.8/nvvm/bin/nvvm64_40_0.dll"
os.environ['NUMBAPRO_LIBDEVICE'] = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.8/nvvm/libdevice"

It doesn't work.

Share Improve this question edited Mar 24 at 14:34 Ξένη Γήινος asked Mar 24 at 14:22 Ξένη ΓήινοςΞένη Γήινος 3,4961 gold badge18 silver badges60 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

I have solved the problem.

I just have to set the correct environmental variable. 'NUMBAPRO_NVVM' and 'NUMBAPRO_LIBDEVICE' are obsolete variables, they no longer work.

Setting the 'CUDA_HOME' variable to the root path of CUDA installation fixed the problem.

import os

os.environ['CUDA_HOME'] = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.8"

Of course I can just use RegEdit to set the variable permanently.


I have used RegEdit, and I have found out the installation sets CUDA_PATH and CUDA_PATH_V12_8 variables with the same value that CUDA_HOME should be, but not CUDA_HOME variable. And the following is already in PATH:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\libnvvp;

The advice was unhelpful and the error message was unclear, and it looks for a different environment variable than what was set during installation.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744247034a4564982.html

相关推荐

  • python - How to use Numba Cuda without Conda? - Stack Overflow

    I don't use Conda. I have downloaded and installed cuda_12.8.1_572.61_windows.exe from the officia

    8天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信