文章目录
前言
ubuntu22.04操作系统安装NVIDIA驱动,使用nvidia-smi查看加速卡使用情况。
一、环境
操作系统版本:Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-119-generic x86_64)
nvidia-driver版本:nvidia-driver-535
二、安装步骤
2.1 获取驱动版本
shell
ubuntu-drivers devices
输出
shell
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00002684sv00001458sd000040C0bc03sc00i00
vendor : NVIDIA Corporation
driver : nvidia-driver-545-open - distro non-free
driver : nvidia-driver-535-server-open - distro non-free
driver : nvidia-driver-535-server - distro non-free
driver : nvidia-driver-545 - distro non-free
driver : nvidia-driver-535 - distro non-free
driver : nvidia-driver-550 - distro non-free recommended
driver : nvidia-driver-535-open - distro non-free
driver : nvidia-driver-550-open - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin
2.2 安装驱动
shell
apt install nvidia-driver-535 -y
apt update
#更新号之后重启机器
reboot
3.查看安装结果
shell
nvidia-smi
输出
shell
Mon Sep 9 08:32:21 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 GeForce RTX 4090 Off | 00000000:01:00.0 Off | Off |
| 0% 43C P8 29W / 450W | 1MiB / 24564MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+
总结
记录一下ubuntu2204安装NVIDIA驱动