以Linux包管理方式安装Nvidia显卡驱动

以Linux包管理方式安装Nvidia显卡驱动

Background

Host: Dell PowerEdge T640

Host OS: ubuntu-server 20.04

Verification

Verify You Have a CUDA-Capable GPU:

lspci | grep -i nvidia

excepted output

3b:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti] (rev a1)

To make sure the system has gcc and etc:

apt install build-essential

Verify the System has the Correct Kernel Headers and Development Packages Installed. For Ubuntu, The kernel headers and development packages for the currently running kernel can be installed with:

apt install linux-headers-$(uname -r)

Installation

To search avaliable drivers:

apt search nvidia-driver

To install nvidia driver:

sudo aptitude install nvidia-driver-510 nvidia-settings

Last but not least, reboot your host:

sudo shutdown -r now

After rebooting, verify driver installation:

nvidia-smi

Finally, the familiar view has been displayed:

Fri May  6 08:42:28 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.60.02    Driver Version: 510.60.02    CUDA Version: 11.6     |
|-------------------------------+----------------------+----------------------+
| 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 ...  Off  | 00000000:3B:00.0 Off |                  N/A |
| 30%   30C    P8    22W / 250W |      5MiB / 11264MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA GeForce ...  Off  | 00000000:5E:00.0 Off |                  N/A |
| 30%   29C    P8    22W / 250W |      5MiB / 11264MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   2  NVIDIA GeForce ...  Off  | 00000000:B1:00.0 Off |                  N/A |
| 30%   29C    P8     7W / 250W |      5MiB / 11264MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   3  NVIDIA GeForce ...  Off  | 00000000:D9:00.0 Off |                  N/A |
| 30%   29C    P8     8W / 250W |      5MiB / 11264MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      2151      G   /usr/lib/xorg/Xorg                  4MiB |
|    1   N/A  N/A      2151      G   /usr/lib/xorg/Xorg                  4MiB |
|    2   N/A  N/A      2151      G   /usr/lib/xorg/Xorg                  4MiB |
|    3   N/A  N/A      2151      G   /usr/lib/xorg/Xorg                  4MiB |
+-----------------------------------------------------------------------------+
posted @ 2022-05-06 16:47  健康平安快乐  阅读(208)  评论(0编辑  收藏  举报