CUDA initialization problem with Numba

0 views
Skip to first unread message

Farhana Sharmin Snigdha

unread,
Feb 27, 2018, 8:45:32 AM2/27/18
to Numba Public Discussion - Public

Hi All,


I have simulated the following script.


I got the following errors:

Traceback (most recent call last):

  File "VectorAdd.py", line 26, in <module>

    main()

  File "VectorAdd.py", line 17, in main

    C = VectorAdd(A, B)

  File "/usr/local/lib/python2.7/dist-packages/numba/cuda/dispatcher.py", line 88, in __call__

    return CUDAUFuncMechanism.call(self.functions, args, kws)

  File "/usr/local/lib/python2.7/dist-packages/numba/npyufunc/deviceufunc.py", line 281, in call

    dev_a = cr.to_device(a, stream=stream)

  File "/usr/local/lib/python2.7/dist-packages/numba/cuda/dispatcher.py", line 203, in to_device

    return cuda.to_device(hostary, stream=stream)

  File "/usr/local/lib/python2.7/dist-packages/numba/cuda/cudadrv/devices.py", line 211, in _require_cuda_context

    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 334, in get_device_count

    self.cuDeviceGetCount(byref(count))

  File "/usr/local/lib/python2.7/dist-packages/numba/cuda/cudadrv/driver.py", line 268, in __getattr__

    self.initialize()

  File "/usr/local/lib/python2.7/dist-packages/numba/cuda/cudadrv/driver.py", line 228, in initialize

    raise CudaSupportError("Error at driver init: \n%s:" % e)

numba.cuda.cudadrv.error.CudaSupportError: Error at driver init: 

[-1] Call to cuInit results in UNKNOWN_CUDA_ERROR:


I have added the following lines in .bashrc

export NUMBAPRO_CUDA_DRIVER=/usr/local/cuda-9.1/lib64/stubs/libcuda.so
export NUMBAPRO_NVVM=/usr/local/cuda-9.1/nvvm/lib64/libnvvm.so
export NUMBAPRO_LIBDEVICE=/usr/local/cuda-9.1/nvvm/libdevice/

Also, __CUDA Information__ obtained from numba -s shows the same error

__CUDA Information__

Error: CUDA device intialisation problem. Error at driver init: 

[-1] Call to cuInit results in UNKNOWN_CUDA_ERROR:

Error class: <class 'numba.cuda.cudadrv.error.CudaSupportError'>


The outputs of nvidia-smi are given below:


Can anyone please suggest any solution?

Thanks
Farhana

Farhana Sharmin Snigdha

unread,
Mar 5, 2018, 10:36:15 AM3/5/18
to Numba Public Discussion - Public
Solved. I have changed the NUMBAPRO_CUDA_DRIVER path as following:

export NUMBAPRO_CUDA_DRIVER=/usr/lib/x86_64-linux-gnu/libcuda.so

Haewon Lee

unread,
Jul 22, 2019, 9:25:45 AM7/22/19
to Numba Public Discussion - Public
it is not solution on Windwos..
anyone has answer?

2018년 3월 6일 화요일 오전 12시 36분 15초 UTC+9, Farhana Sharmin Snigdha 님의 말:

Siu Kwan Lam

unread,
Jul 22, 2019, 1:54:29 PM7/22/19
to Numba Public Discussion - Public
The error is usually due to an out-of-date CUDA driver.  For Windows users, go to the nvidia website, and download and install the latest CUDA toolkit.  Numba will look at the default location for the CUDA driver such that you don't need to set any environment variable to configure it.

--
You received this message because you are subscribed to the Google Groups "Numba Public Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numba-users...@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/numba-users/36aea24c-a55a-42a5-8af0-d290c0046386%40continuum.io.
Reply all
Reply to author
Forward
0 new messages