文章目录
前言一、环境二、安装步骤2.1 获取驱动版本2.2 安装驱动3.查看安装结果 总结
前言
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 获取驱动版本
ubuntu-drivers devices
输出
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==modalias : pci:v000010DEd00002684sv00001458sd000040C0bc03sc00i00vendor : NVIDIA Corporationdriver : nvidia-driver-545-open - distro non-freedriver : nvidia-driver-535-server-open - distro non-freedriver : nvidia-driver-535-server - distro non-freedriver : nvidia-driver-545 - distro non-freedriver : nvidia-driver-535 - distro non-freedriver : nvidia-driver-550 - distro non-free recommendeddriver : nvidia-driver-535-open - distro non-freedriver : nvidia-driver-550-open - distro non-freedriver : xserver-xorg-video-nouveau - distro free builtin
2.2 安装驱动
apt install nvidia-driver-535 -yapt update #更新好之后重启机器reboot
3.查看安装结果
nvidia-smi
输出
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驱动