第一步,打开终端,先用nvidia-smi
查看一下,发现如下报错:
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver.
Make sure that the latest NVIDIA driver is installed and running.
第二步,查看已安装驱动的版本信息
ls /usr/src | grep nvidia
[root@cheng ~]# ls /usr/src | grep nvidia
nvidia-565.57.01
第三步,依次输入以下命令
sudo yum install dkms
sudo dkms install -m nvidia -v 565.57.01
等待安装完成后,再次输入nvidia-smi
,查看GPU使用状态:
[root@cheng ~]# nvidia-smi
Sun Dec 22 15:28:45 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 565.57.01 Driver Version: 565.57.01 CUDA Version: 12.7 |
|-----------------------------------------+------------------------+----------------------+
| 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 RTX 3060 Off | 00000000:06:00.0 Off | N/A |
| 31% 23C P8 5W / 170W | 18MiB / 12288MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| No running processes found |
+-----------------------------------------------------------------------------------------+