CUDA cuInit: Unknown error on Linux
With recent Linux Kernels and flatpak, podman and docker CUDA does not get correctly initialized from within a sandbox or a container. Affected workloads are:
- Games using compute shaders and running via flatpak or a podman container (eg. Distrobox)
- Hunt Showdown 1896
- The Talos Principle 2
- Satisfactory (running in DIrectX 12 mode)
- Hellblade II: Senua's Saga
- DaVinci resolve via podman container with shared nvidia driver
- Blender and using CUDA to render with Cycles running via flatpak
- OBS Studio via flatpak if using NVENC
- Upscayl via flatpak
- InvokeAI via distrobox eg. pytorch
- Ollama via prodman or flatpak for example if using Alpaca
Common error codes are:
- CUDA cuInit: Unknown error
- cuda_init_999
- DirectX 12 not supported on your system. Try running without -dx12 or -d3d12 command line argument
Kick-start CUDA
To work around this error we found that "kick-starting" CUDA from outside a sandbox and not using any containerization technology does solve the issue. Without a reboot and by simply re-starting affected applications CUDA gets initialized correctly.
- Download Blender from blender.org
- Extract and run Blender
- Navigate to Edit → Preferences → System
- Enable CUDA
- If your GPU is shown CUDA is working
- Re-start affected applications
If you are affected by this error please help to report this issue to nVidia.
Known affected systems configurations
- Linux Kernel: 6.14.6 or newer
- Flatpak: 1.16.0 or newer
- Podman: 5.4.2 or newer
- nVidia driver 570.144 or newer
- CUDA 12.8 or newer
Also, this seems to be independent of the desktop environment as this error occurred on KDE Plasma as well as Gnome. This error has been observed on different Linux distributions like Aeon, Kalpa, EndevourOS.