Skip to content

Instantly share code, notes, and snippets.

@stephenlauck
Last active June 17, 2025 06:04
Show Gist options
  • Save stephenlauck/92e29628edeebf4ff3332a86b31802c2 to your computer and use it in GitHub Desktop.
Save stephenlauck/92e29628edeebf4ff3332a86b31802c2 to your computer and use it in GitHub Desktop.
https://github.com/oddmario/NVIDIA-Ubuntu-Driver-Guide?tab=readme-ov-file
# Ubuntu 22.04.5
Linux spellcaster-Oryx-Pro 6.8.0-60-generic #63~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 22 19:00:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
https://documentation.ubuntu.com/server/how-to/graphics/install-nvidia-drivers/index.html
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local
# validation
sudo journalctl -fu ollama
nvidia-smi -q -d utilization -l
@stephenlauck
Copy link
Author

Linux Oryx-Pro 6.8.0-60-generic #63~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 22 19:00:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

01:00.0 VGA compatible controller: NVIDIA Corporation GA103M [GeForce RTX 3080 Ti Mobile] (rev a1)

NVIDIA-SMI 570.133.07 Driver Version: 570.133.07 CUDA Version: 12.8

show driver version

nvidia-smi --query-gpu=driver_version --format=csv,noheader

@stephenlauck
Copy link
Author

stephenlauck commented Jun 17, 2025

deps:

gh code jq

@stephenlauck
Copy link
Author

get recommended driver

ubuntu-drivers list --gpgpu --recommended

check installed driver

cat /proc/driver/nvidia/version

@stephenlauck
Copy link
Author

install recommended driver

sudo apt install -y $(ubuntu-drivers list --gpgpu --recommended)

@stephenlauck
Copy link
Author

stephenlauck commented Jun 17, 2025

install recommended driver

sudo apt install -y $(ubuntu-drivers list --gpgpu --recommended)

see installed version is matching recommened

test "$(nvidia-smi --query-gpu=driver_version --format=csv,noheader)" = "$(apt-cache policy $(ubuntu-drivers list --gpgpu --recommended | awk '{print $1}') | grep 'Installed:' | awk '{print $2}' | cut -d '-' -f1)"; echo $?

clear all installed nvidia drivers

sudo apt remove -y --purge nvidia* && sudo apt autoremove -y

@stephenlauck
Copy link
Author

stephenlauck commented Jun 17, 2025

check for cuda using torch

python -c "import torch; print(torch.cuda.is_available())"

check for cuda

/usr/local/cuda/bin/nvcc --version

@stephenlauck
Copy link
Author

stephenlauck commented Jun 17, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment