TT Lab

한국어 English 日本語

Get started
Blog

Blog

Install Nvidia driver on ubuntu22.04

RTX4070 MaxQ Ubuntu 22.04

lspci | grep -i nvidia
sudo apt-get purge nvidia*
sudo apt-get autoremove
sudo apt-get install linux-headers-$(uname -r)
sudo apt install --only-upgrade ubuntu-drivers-common
sudo ubuntu-drivers autoinstall
sudo apt install nvidia-cuda-toolkit

Reboot

$ nvidia-smi
Fri Nov 29 03:07:20 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.120                Driver Version: 550.120        CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| 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 4070 ...    Off |   00000000:01:00.0 Off |                  N/A |
| N/A   48C    P8              3W /  115W |       9MiB /   8188MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      1354      G   /usr/lib/xorg/Xorg                              4MiB |
+-----------------------------------------------------------------------------------------+

Install Docker


sudo apt install docker.io
sudo apt install docker-buildx
sudo chmod 666 /var/run/docker.sock

Install nvidia-docker2

## Add GPG key and repository!
sudo apt install curl
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
   && curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
   && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list


# Update once more!
sudo apt-get update


# Install nvidia-docker2
sudo apt-get install -y nvidia-docker2

Docker test command

## Test!

docker run --rm --gpus all ubuntu:18.04 nvidia-smi

Quiz

Q1: What is the main topic covered in "Install Nvidia driver on ubuntu22.04"? Install Nvidia driver on ubuntu22.04

Q2: What are the key takeaways from this article? Install Nvidia driver on ubuntu22.04

Q3: How can the concepts in this article be applied in practice? Consider the practical examples and patterns discussed throughout the post.

Sign in to like

Comments

No comments yet.

Sign in to leave a comment