### basic python and git ###
sudo apt update
sudo apt install -y python3-pip python3-venv git git-lfs build-essential
### create venv
python3 -m venv ~/genai_env
source ~/genai_env/bin/activate
### install pytorch
#verify the version
nvidia-smi
## as of 2026-03-11, it is cuda 13.1 but no wheel file for 13.1 yet, just use the 13.0 version which is supposed to be compatible
## can check https://download.pytorch.org/whl/ to see where it is up to
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130
### verify pytorch installation ###
python3 - << 'EOF'
import torch
print("PyTorch:", torch.__version__)
print("CUDA available:", torch.cuda.is_available())
print("Device count:", torch.cuda.device_count())
if torch.cuda.is_available():
print("GPU name:", torch.cuda.get_device_name(0))
EOF
expects something like "
PyTorch: 2.10.0+cu130
CUDA available: True
Device count: 1
GPU name: NVIDIA RTX PRO 4000 Blackwell Generation Laptop GPU
"
### test run in torch
python3 - << 'EOF'
import torch, time
x = torch.randn((8000,8000), device='cuda')
torch.cuda.synchronize()
t0 = time.time()
for _ in range(10):
y = x @ x
torch.cuda.synchronize()
print("Time:", time.time() - t0)
EOF