如何在Debian 10上安装Nvidia Cuda

确认CUDA安装:

$/usr/local/cuda-*/bin/nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Wed_Jun__2_19:15:15_PDT_2021
Cuda compilation tools, release 11.4, V11.4.48
Build cuda_11.4.r11.4/compiler.30033411_0

或者,执行以下nvidia-smi命令以获得更详细的输出:

$nvidia-smi
Wed Jun 30 14:57:30 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.42.01    Driver Version: 470.42.01    CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0 Off |                  N/A |
|  0%   50C    P8    31W/370W |    293MiB/10014MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A       659      G   /usr/lib/xorg/Xorg                129MiB |
|    0   N/A  N/A       850      G   /usr/bin/kwin_x11                  35MiB |
|    0   N/A  N/A       854      G   /usr/bin/krunner                    3MiB |
|    0   N/A  N/A       856      G   /usr/bin/plasmashell               48MiB |
|    0   N/A  N/A      1015      G   nvidia-settings                     0MiB |
|    0   N/A  N/A      1370      G   ...bexec/kscreenlocker_greet       70MiB |
+-----------------------------------------------------------------------------+

安装CUDA:

# apt-get install cuda

添加CUDA Debian 10存储库并启用Contrach存储库:

# add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/debian10/x86_64//"
# add-apt-repository contrib
# apt update

安装CUDA 开发者密钥

# apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/debian10/x86_64/7fa2af80.pub

重新启动Debian 10系统:

# reboot
日期:2020-07-07 20:56:22 来源:oir作者:oir