technology
NVIDIA drivers don't load after a reboot (LXC)
31 Mar 2025
Enabling Nvidia persistence mode keeps the NVIDIA character device files open.
NVIDIA persistanced
Source: https://gist.github.com/ngoc-minh-do/fcf0a01564ece8be3990d774386b5d0c#enable-persistence-mode
Enable persistence mode Nvidia device nodes (/dev/nvidia*) are not loaded at boot. Additionally, when they are no longer in use, the NVIDIA kernel driver deactivates the device state.
Enabling Nvidia persistence mode keeps the NVIDIA character device files open, preventing the kernel driver from deactivating the device state when no other process is using the device.
Create /etc/systemd/system/nvidia-persistenced.service
sudo nano /etc/systemd/system/nvidia-persistenced.service
[Unit]
Description=NVIDIA Persistence Daemon
[Service]
Type=forking
ExecStart=/usr/bin/nvidia-persistenced --verbose
ExecStartPost=/usr/bin/nvidia-smi
ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced
[Install]
WantedBy=multi-user.target
Activate
systemctl enable --now nvidia-persistenced
Confirm
systemctl status nvidia-persistenced
ls -lah /dev/nvidia*