- NVIDIA RTX 4090M GPU
- Windows 11
- Python 3.8+
-
Install NVIDIA GPU drivers (Latest Game Ready Driver)
- Download from: https://www.nvidia.com/download/index.aspx
- Select: RTX 4090M
- Verify installation:
nvidia-smi
-
Install CUDA Toolkit 12.1
- Download from: https://developer.nvidia.com/cuda-12-1-0-download-archive
- Choose: Windows → x86_64 → 11 → exe(network)
- Verify installation:
nvcc --version
-
Install PyTorch with CUDA 12.1 support
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
Install all required packages:
pip install -r requirements.txt
- fastapi
- uvicorn
- python-multipart
- transformers
- torch (with CUDA support)
- Pillow
- accelerate
- typing-extensions
- Test CUDA Setup:
python test_pytorch-cuda.py
- Start the FastAPI server:
uvicorn app:app --host 0.0.0.0 --port 8000 --reload
- Check API Health:
curl http://localhost:8000/health
-
If CUDA is not detected:
- Verify NVIDIA drivers:
nvidia-smi
- Check CUDA:
nvcc --version
- Verify PyTorch CUDA:
python test_pytorch-cuda.py
- Verify NVIDIA drivers:
-
If model fails to load:
- Check available GPU memory
- Ensure all dependencies are installed
- Verify Python version compatibility