cuda
config_error
ai_generated
true
RuntimeError: CUDA lazy loading is not enabled
ID: cuda/cuda-lazy-loading
90%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 12 | active | — | — | — |
Root Cause
CUDA lazy loading environment variable not set. Improves startup time and memory usage.
genericWorkarounds
-
95% success Set CUDA_MODULE_LOADING=LAZY in your environment
export CUDA_MODULE_LOADING=LAZY
-
90% success Add to .bashrc or .env file for persistence
# Add to ~/.bashrc or ~/.zshrc: echo 'export CUDA_MODULE_LOADING=LAZY' >> ~/.bashrc source ~/.bashrc # Or in a .env file for your project: CUDA_MODULE_LOADING=LAZY # For Docker containers, add to Dockerfile: ENV CUDA_MODULE_LOADING=LAZY
Sources: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html
Dead Ends
Common approaches that don't work:
-
Set CUDA_MODULE_LOADING=EAGER
70% fail
EAGER is the default — you want LAZY for better performance
-
Ignore the warning
55% fail
Missing lazy loading wastes GPU memory at startup
Error Chain
Frequently confused with: