Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cuda: library nvvm not found

Tags:

I am trying to run the code below but an error is reported:

NvvmSupportError: libNVVM cannot be found. Do conda install cudatoolkit: library nvvm not found

My development environment is: Ubuntu 17.04, Spyder/Python3.5 and I have installed via conda (numba and cudatoolkit). Nvidia GPUs (GTX 1070 and GTX 1060).

import numpy as np from timeit import default_timer as timer from numba import vectorize  @vectorize(["float32(float32, float32)"], target='cuda')      def VecADD(a,b):     return a+b          n = 32000000 a = np.ones (n, dtype=np.float32)  b = np.ones (n, dtype=np.float32)      c = np.zeros(n, dtype=np.float32)   start = timer() C = VecADD(a,b) print (timer() - start) 

Does anyone know how to solve this problem?

like image 897
Helton Maia Avatar asked Jan 22 '18 16:01

Helton Maia


Video Answer


1 Answers

What worked for me under exactly the same scenario was to include the following in the .bashrc (I'm currently using cuda-9.0). Don't be thrown off by the NUMBAPRO in the variable name - it works for numba (at least for me):

export NUMBAPRO_NVVM=/usr/local/cuda-9.0/nvvm/lib64/libnvvm.so export NUMBAPRO_LIBDEVICE=/usr/local/cuda-9.0/nvvm/libdevice/ 

Update: It worked for me too. As I'm using Cuda 10.1, I have included the following lines instead of yours:

export NUMBAPRO_NVVM=/usr/local/cuda-10.1/nvvm/lib64/libnvvm.so export NUMBAPRO_LIBDEVICE=/usr/local/cuda-10.1/nvvm/libdevice/ 
like image 151
Py_Dream Avatar answered Sep 27 '22 19:09

Py_Dream