nvidia-smi --query-gpu=name,memory.total,driver_version --format=csv,noheader
# Example Output: NVIDIA GeForce RTX 4050 Laptop GPU, 6141 MiB, 580.65.06
Watch nvidia gpu status
watch nvidia-smi
# or
watch -n 2 'nvidia-smi'
Install CUDA on WSL2
sudo apt-key del 7fa2af80
curl -L https://gist.githubusercontent.com/moracabanas/63070d9012ad4b95e86a4004caac5a9d/raw/install_cuda12.2_wsl2.sh | bash
Cuda Toolkit 12.3.2
Install tensorflow with: uv add tensorflow[and-cuda]
Install torch with:
import os
import sys
# Silence TensorFlow logging
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
import torch
torch.cuda.init()
print(f'Using python in {sys.executable}\n')
print(f'CHECKING TORCH CUDA:')
print(torch.cuda.get_device_name(0))
print(f'Cuda Available Check: {torch.cuda.is_available()}')
print(f'Torch cuda version: {torch.version.cuda}\n')
import tensorflow as tf
print(f'CHECKING TENSORFLOW CUDA:')
print(tf.config.list_physical_devices('GPU'))
https://developer.nvidia.com/rdp/cudnn-archive
https://docs.nvidia.com/deeplearning/cudnn/installation/linux.html
https://portal.databasemart.com/kb/a2128/6-steps-to-install-gpu-accelerated-tensorflow.aspx
https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/