-
Notifications
You must be signed in to change notification settings - Fork 0
๐ CUDA Toolkit Installation Guide
Amir M. Parvizi edited this page Nov 19, 2024
·
2 revisions
Hardware Requirements
Component | Minimum | Recommended |
---|---|---|
GPU | NVIDIA Kepler+ | NVIDIA Ampere/Hopper |
RAM | 4GB | 16GB+ |
Disk Space | 2.5GB | 10GB |
CPU | x86_64 | Multi-core x86_64 |
Software Requirements
graph LR
A[Operating System] --> B[Linux/Windows]
B --> C[Compatible Driver]
C --> D[Development Tools]
- ๐ฅ๏ธ Operating System
- Linux: Kernel 3.10+
- Windows: 10/11
- ๐ง Development Tools
- GCC 7+ (Linux)
- MSVC 2019+ (Windows)
- ๐ฎ NVIDIA Driver: 525.0.0+
Quick Install (Recommended)
# Download CUDA Toolkit
wget https://developer.download.nvidia.com/compute/cuda/12.6.0/local_installers/cuda_12.6.0_535.54.03_linux.run
# Install
sudo sh cuda_12.6.0_535.54.03_linux.run
Package Manager Install
# For Ubuntu/Debian
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /"
sudo apt update
sudo apt install cuda-toolkit-12-6
Network Installer
- Download the CUDA Network Installer
- Run the installer
- Follow the wizard ๐งโโ๏ธ
Add these to your shell configuration file (~/.bashrc
, ~/.zshrc
, etc.):
# CUDA Toolkit Path
export CUDA_HOME=/usr/local/cuda-12.6
export PATH="$CUDA_HOME/bin:$PATH"
export LD_LIBRARY_PATH="$CUDA_HOME/lib64:$LD_LIBRARY_PATH"
๐ Optional Environment Variables
# Optional: CUDA device order
export CUDA_DEVICE_ORDER=PCI_BUS_ID
# Optional: Default device
export CUDA_VISIBLE_DEVICES=0
# Optional: CUDA cache path
export CUDA_CACHE_PATH="$HOME/.cuda-cache"
# Check CUDA compiler
nvcc --version
# Check NVIDIA driver
nvidia-smi
# Run sample test
cd $CUDA_HOME/samples/1_Utilities/deviceQuery
make
./deviceQuery
Expected Output:
๐ CUDA Device Query Results: CUDA Version: 12.6
Driver Version: 535.54.03 CUDA Capability: x.y ...
Common Issues
Issue | Solution |
---|---|
nvcc: command not found |
Check PATH variable |
Driver version mismatch | Update NVIDIA driver |
Installation fails | Check system requirements |
CUDA not found | Verify environment variables |
Diagnostic Commands
# Check CUDA installation
ls -l /usr/local/cuda
# Check driver status
systemctl status nvidia-driver
# Check GPU detection
lspci | grep -i nvidia
Multi-GPU Setup
# List all GPUs
nvidia-smi -L
# Set specific GPUs
export CUDA_VISIBLE_DEVICES=0,1
# Check GPU utilization
nvidia-smi -l 1
Performance Optimization
- Enable persistence mode
sudo nvidia-smi -pm 1
- Set GPU clock speeds
sudo nvidia-smi -ac 5001,1590