
我正在運行 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):
我怎樣才能解決這個問題?