numba.cuda.cudadrv.error.CudaSupportError:驱动程序初始化时出错:,Quadro M2000,运行 Ubuntu 20.04

numba.cuda.cudadrv.error.CudaSupportError:驱动程序初始化时出错:,Quadro M2000,运行 Ubuntu 20.04

我正在运行 Ubuntu 20.04,并有一张 Quadro M2000 卡,运行$ nvidia-smi -L后,

GPU 0: Quadro M2000 (UUID: GPU-df3aa58b-eac2-2d70-3e96-8915f899997e)

我想将它用于 python,因此我numba使用进行了安装$ pip install numba,检查nvcc -v哪个要求我安装它。

安装时,我收到以下错误:

$ sudo apt install nvidia-cuda-toolkit
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 nvidia-cuda-toolkit : Depends: nvidia-profiler (= 10.1.243-3) but it is not going to be installed
                       Depends: nvidia-cuda-dev (= 10.1.243-3) but it is not going to be installed
                       Recommends: nvidia-visual-profiler (= 10.1.243-3) but it is not going to be installed
                       Recommends: nsight-compute (= 10.1.243-3)
                       Recommends: nsight-systems (= 10.1.243-3)
E: Unable to correct problems, you have held broken packages

我安装的驱动程序是 390 号(从 nvidia 网站上查找 M2000 驱动程序)我尝试手动安装其中几个包,但没有成功。

因此,我重新按照步骤操作NVIDIA CUDA 下载安装cuda。

之后我决定检查一下numba

>>> import numba
>>> numba.__version__
'0.56.2'

好的,numba安装正确,

>>> from numba import cuda
>>> print(cuda.gpus)
```Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/luce/.local/lib/python3.8/site-packages/numba/cuda/cudadrv/devices.py", line 43, in __str__
    return ', '.join([str(d) for d in self.lst])
  File "/home/luce/.local/lib/python3.8/site-packages/numba/cuda/cudadrv/devices.py", line 26, in __getattr__
    numdev = driver.get_device_count()
  File "/home/luce/.local/lib/python3.8/site-packages/numba/cuda/cudadrv/driver.py", line 417, in get_device_count
    self.cuDeviceGetCount(byref(count))
  File "/home/luce/.local/lib/python3.8/site-packages/numba/cuda/cudadrv/driver.py", line 288, in __getattr__
    raise CudaSupportError("Error at driver init: \n%s:" %
numba.cuda.cudadrv.error.CudaSupportError: Error at driver init: 
Call to cuInit results in UNKNOWN_CUDA_ERROR (803):

我怎样才能解决这个问题?

相关内容