Ubuntu20.04 安装英伟达驱动

服务器 0

解决 NVIDIA 显卡驱动问题
你的系统检测到了 NVIDIA 显卡,但它目前没有被声明,也就是说可能没有正确安装驱动程序。你需要安装 NVIDIA 驱动程序来激活这块显卡。以下是安装步骤:

步骤 1:添加 NVIDIA 驱动 PPA
首先,确保你的系统软件包是最新的:

sudo apt updatesudo apt upgrade

然后,添加 NVIDIA 驱动程序的 PPA:

sudo add-apt-repository ppa:graphics-drivers/ppasudo apt update

步骤 2:安装 NVIDIA 驱动程序
查找并安装推荐的驱动程序:

ubuntu-drivers devices

输出示例:

== /sys/devices/pci0000:c9/0000:c9:02.0/0000:ca:00.0 ==modalias : pci:v000010DEd000020F5sv000010DEsd00001799bc03sc02i00vendor   : NVIDIA Corporationdriver   : nvidia-driver-545 - distro non-freedriver   : nvidia-driver-535 - distro non-free recommendeddriver   : nvidia-driver-535-open - distro non-freedriver   : nvidia-driver-535-server-open - distro non-freedriver   : nvidia-driver-545-open - distro non-freedriver   : nvidia-driver-535-server - distro non-freedriver   : xserver-xorg-video-nouveau - distro free builtin

根据推荐的驱动安装,例如上面的推荐是

driver   : nvidia-driver-535 - distro non-free recommended

安装

sudo apt install nvidia-driver-535

步骤 3:重启系统
安装完成后,重启系统以使驱动生效

sudo reboot

步骤 4:验证驱动安装
重启后,使用 nvidia-smi 命令检查 NVIDIA 驱动是否正确安装并生效:

(base) jiahong@GPUsvr01:~$ nvidia-smiFri Jul 26 14:02:18 2024+---------------------------------------------------------------------------------------+| NVIDIA-SMI 535.183.01             Driver Version: 535.183.01   CUDA Version: 12.2     ||-----------------------------------------+----------------------+----------------------+| 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 A800 80GB PCIe          Off | 00000000:CA:00.0 Off |                    0 || N/A   57C    P0              81W / 300W |  34730MiB / 81920MiB |      2%      Default ||                                         |                      |             Disabled |+-----------------------------------------+----------------------+----------------------++---------------------------------------------------------------------------------------+| Processes:                                                                            ||  GPU   GI   CI        PID   Type   Process name                            GPU Memory ||        ID   ID                                                             Usage      ||=======================================================================================||    0   N/A  N/A     86880      C   python                                    34718MiB |+---------------------------------------------------------------------------------------+

也许您对下面的内容还感兴趣: