Reputation: 2961
I recently installed NVIDIA CUDA and test run a code :
from numba import cuda
from numba import *
import numpy as np
from pylab import imshow, show
from timeit import default_timer as timer
But I got this error in ubuntu 16.0.4. How can I resolve this error:
@cuda.jit(argtypes=[f8, f8, f8, f8, uint8[:,:], uint32])
File "/usr/local/lib/python2.7/dist-packages/numba/cuda/decorators.py", line 92, in kernel_jit
kernel.bind()
File "/usr/local/lib/python2.7/dist-packages/numba/cuda/compiler.py", line 489, in bind
self._func.get()
File "/usr/local/lib/python2.7/dist-packages/numba/cuda/compiler.py", line 366, in get
cuctx = get_context()
File "/usr/local/lib/python2.7/dist-packages/numba/cuda/cudadrv/devices.py", line 194, in get_context
return _runtime.get_or_create_context(devnum)
File "/usr/local/lib/python2.7/dist-packages/numba/cuda/cudadrv/devices.py", line 162, in get_or_create_context
return self.push_context(self.gpus[devnum])
File "/usr/local/lib/python2.7/dist-packages/numba/cuda/cudadrv/devices.py", line 40, in __getitem__
return self.lst[devnum]
File "/usr/local/lib/python2.7/dist-packages/numba/cuda/cudadrv/devices.py", line 26, in __getattr__
numdev = driver.get_device_count()
File "/usr/local/lib/python2.7/dist-packages/numba/cuda/cudadrv/driver.py", line 307, in get_device_count
self.cuDeviceGetCount(byref(count))
File "/usr/local/lib/python2.7/dist-packages/numba/cuda/cudadrv/driver.py", line 248, in __getattr__
self.initialization_error)
CudaSupportError: Error at driver init:
CUDA driver library cannot be found.
If you are sure that a CUDA driver is installed,
try setting environment variable NUMBA_CUDA_DRIVER
with the file path of the CUDA driver shared library.
Upvotes: 1
Views: 8807
Reputation: 688
Try to introduce following variables
export NUMBAPRO_NVVM=/home/cuda-7.5/nvvm/lib64/libnvvm.so
export NUMBAPRO_LIBDEVICE=/home/cuda-7.5/nvvm/libdevice/
in your .bashrc file which is usually located in home/username/ In your case the paths above should be corrected in accordance to your cuda installation paths. Note, that even if you use just umba, not numbapro the names of the variables should be as shown above.
Upvotes: 2