Train all AI models on your MSI RTX 5080 16G • $0 cost • ~2 hours total
| GPU | VRAM | U-Net | YOLO | RL (2M steps) | Total Time |
|---|---|---|---|---|---|
| RTX 5080 (yours) | 16 GB GDDR7 | ~8 min | ~25 min | ~1.2 hr | ~2 hr |
| RTX 5090 | 32 GB GDDR7 | ~6 min | ~18 min | ~50 min | ~1.3 hr |
| RTX 4090 | 24 GB | ~12 min | ~35 min | ~1.5 hr | ~2.5 hr |
| RTX 4080 | 16 GB | ~18 min | ~50 min | ~2.5 hr | ~3.5 hr |
| RTX 4070 Ti | 12 GB | ~22 min | ~1 hr | ~3 hr | ~4 hr |
| RTX 3080 | 10 GB | ~30 min | ~1.5 hr | ~4 hr | ~6 hr |
| RTX 3060 | 12 GB | ~40 min | ~2 hr | ~5 hr | ~7.5 hr |
Check if CUDA is already working:
nvidia-smi
If you see your GPU listed, skip to Step 2. If not:
# RTX 5080 requires driver 570+ and CUDA 12.8+
# Download latest Game Ready driver from nvidia.com/drivers
# (search: RTX 5080, Windows 11)
# Install, restart, then verify:
nvidia-smi
# Should show: NVIDIA GeForce RTX 5080, Driver 570.xx+, CUDA 12.8
sudo apt update
sudo apt install -y nvidia-driver-570
sudo reboot
# After reboot:
nvidia-smi
# Should show: RTX 5080, Driver 570+, CUDA 12.8
# Install Python 3.11+ from python.org if needed
# Create venv
python -m venv aigp
aigp\Scripts\activate
# PyTorch with CUDA 12.8 (required for RTX 5080 Blackwell)
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128
# Everything else
pip install opencv-python numpy scipy pyyaml ultralytics stable-baselines3 gymnasium onnxruntime mavsdk
# Create venv
python3 -m venv aigp
source aigp/bin/activate
# PyTorch with CUDA 12.8 (required for RTX 5080 Blackwell)
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128
# Everything else
pip install opencv-python numpy scipy pyyaml ultralytics stable-baselines3 gymnasium onnxruntime mavsdk
Verify GPU is visible to PyTorch:
python -c "import torch; print(torch.cuda.get_device_name(0))"
# Should print: NVIDIA GeForce RTX 5080
git clone https://github.com/blakefarabi/grandprix.git
cd grandprix
# Git Bash or WSL recommended:
bash train_all.sh
# Or run each model manually in CMD:
python gate_segmentation.py train --data dataset_gates_seg
python -c "from ultralytics import YOLO; m=YOLO('yolov8n.pt'); m.train(data='dataset_gates_yolo/data.yaml', epochs=50, imgsz=640, device=0)"
python rl_train.py train --steps 2000000
bash train_all.sh
That's it. The script handles everything: creates synthetic data, trains U-Net, YOLO, and RL policy, exports to ONNX.
train_all.sh script is a bash script. Install Git for Windows (includes Git Bash) or use WSL. Alternatively, run the three Python commands individually in CMD/PowerShell.The script prints progress for each model. You can also monitor GPU usage:
# In a separate terminal, watch GPU utilization:
nvidia-smi -l 5
# Expected during training:
# GPU Util: 80-100%
# Memory: 6-12 GB (varies by model)
# Power: 200-320W (4080)
# Temp: 60-80°C (normal)
After training completes, you'll have these files:
| File | Model | Size | Purpose |
|---|---|---|---|
gate_seg.onnx | U-Net | ~15 MB | Gate segmentation (primary detector) |
dataset_gates_seg/weights/best.pt | U-Net | ~15 MB | PyTorch weights (for further training) |
yolo_runs/gates/weights/best.onnx | YOLO | ~6 MB | Gate detection (backup detector) |
yolo_runs/gates/weights/best.pt | YOLO | ~6 MB | PyTorch weights |
policy.onnx | RL (PPO) | ~0.4 MB | Learned racing policy |
Copy these to your Mac for deployment:
# From your Mac (replace PC_IP with your Windows machine's IP):
scp user@PC_IP:~/grandprix/gate_seg.onnx .
scp user@PC_IP:~/grandprix/yolo_runs/gates/weights/best.onnx .
# Or simpler — just push to GitHub from the PC:
cd grandprix
git add gate_seg.onnx yolo_runs/gates/weights/best.onnx
git commit -m "Add trained model weights (4080)"
git push
# Then pull on Mac:
git pull
If you want to train just one model instead of all three:
python gate_segmentation.py train \
--data dataset_gates_seg
# Export to ONNX
python gate_segmentation.py export \
--weights dataset_gates_seg/weights/best.pt
Trains pixel-level gate segmentation. Produces the most accurate corners for PnP depth via RANSAC.
# Auto-label from VQ1 footage (if available)
python yolo-auto-label.py
# Or train on synthetic data
python yolo-train.py train
# Export to ONNX / TensorRT
python yolo-train.py export
Trains YOLOv8n bounding box detector. Faster inference but less accurate corners.
# Train PPO (2M steps)
python rl_train.py train --steps 2000000
# Export to ONNX
python rl_train.py export
Trains a neural racing controller that replaces the classical proportional pursuit. Potentially faster laps but needs more tuning.
# Fewer steps (faster, less converged)
python rl_train.py train --steps 500000
# More steps (slower, better policy)
python rl_train.py train --steps 10000000
# Resume from checkpoint
python rl_train.py train --resume \
--checkpoint rl_checkpoints/best_model
| Problem | Cause | Fix |
|---|---|---|
torch.cuda.is_available() returns False | CUDA not installed or wrong PyTorch build | Reinstall PyTorch with CUDA: pip install torch --index-url https://download.pytorch.org/whl/cu121 |
| CUDA out of memory | Batch size too large for VRAM | Reduce batch size: edit gate_segmentation.py batch_size=4 (default 8) |
bash: train_all.sh: not found | Not in repo directory | cd grandprix first |
Windows: bash not recognized | No Git Bash / WSL | Install Git for Windows or run Python commands individually |
| Training is very slow | Running on CPU instead of GPU | Verify: python -c "import torch; print(torch.cuda.get_device_name(0))" |
| GPU temp >85°C | Sustained compute load | Improve case airflow, or add --batch 4 to reduce load |
ModuleNotFoundError | Missing dependency | pip install <module-name> |
If you want to kick off training from your Mac without touching the PC:
# Windows: Enable OpenSSH Server
# Settings → Apps → Optional Features
# → Add: OpenSSH Server → Install
# Then in PowerShell (admin):
Start-Service sshd
Set-Service -Name sshd -StartupType Automatic
# Find your PC's IP:
ipconfig
# Look for IPv4 Address (e.g., 192.168.1.42)
# SSH into the PC
ssh your-username@192.168.1.42
# Clone and train
git clone https://github.com/blakefarabi/grandprix.git
cd grandprix
bash train_all.sh
# Or run in background (disconnect-safe):
nohup bash train_all.sh > training.log 2>&1 &
# Check progress later:
tail -f training.log
nohup so training continues even if you close the SSH session. Check back with tail -f training.log anytime.| RTX 5080 (Yours) | RunPod A4000 | RunPod A100 | |
|---|---|---|---|
| Cost per session | $0 (free) | $1.15 | $4.18 |
| U-Net time | ~8 min | ~30 min | ~15 min |
| YOLO time | ~25 min | ~1.5 hr | ~45 min |
| RL time | ~1.2 hr | ~4 hr | ~2 hr |
| Total | ~2 hr | ~6 hr | ~3 hr |
| Setup time | 10 min (first time) | 5 min | 5 min |
| Data transfer | Instant (local) | Download weights | Download weights |
| Best for | Everything (fastest + free) | No local GPU | Multi-GPU only |