cuda
initialization_error
ai_generated
true
CUDA error: initialization error (cudaErrorInitializationError)
ID: cuda/not-initialized
85%Fix Rate
88%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 12 | active | — | — | — |
Root Cause
CUDA runtime failed to initialize. Typically caused by driver not loaded, no GPU present, driver/toolkit version mismatch, or insufficient permissions to access /dev/nvidia* devices. Also occurs in containers without GPU passthrough.
genericWorkarounds
-
90% success Verify GPU driver is loaded: nvidia-smi
Run nvidia-smi. If it fails, reload driver: modprobe nvidia. Check dmesg for driver errors.
-
85% success Fix device permissions: add user to 'video' group or run with appropriate privileges
sudo usermod -aG video $USER && newgrp video. Or check: ls -la /dev/nvidia*
-
92% success In Docker, use --gpus all or nvidia-container-toolkit
docker run --gpus all <image>. Ensure nvidia-container-toolkit is installed on host.
Dead Ends
Common approaches that don't work:
-
Reinstall PyTorch or TensorFlow to fix CUDA initialization
80% fail
The issue is at the driver/hardware level, not in the ML framework. Reinstalling frameworks does not fix driver or permission issues.
-
Set CUDA_HOME environment variable
85% fail
CUDA_HOME is for compile-time toolkit location; it does not affect runtime initialization or driver loading
Error Chain
Preceded by:
Frequently confused with: