Published on

apt upgrade - NVIDIA driver update - Jellyfin hardware transcoding broken

Authors

Problem

After running:

sudo apt upgrade

a new kernel and/or NVIDIA driver was installed. After reboot:

  • Jellyfin container doesn't start
  • Jellyfin hardware acceleration (NVENC/NVDEC) stopped working
  • Transcoding fell back to CPU or failed
  • Container logs showed GPU-related errors
  • On the host:
nvidia-smi

returned:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver.
Make sure that the latest NVIDIA driver is installed and running.

If nvidia-smi fails on the host, the Docker container cannot access the GPU.


Root Cause

Ubuntu installed a new kernel. The NVIDIA kernel module (nvidia.ko) was not built for that kernel.

Without a matching kernel module:

  • The driver does not load
  • /dev/nvidia* devices do not exist
  • Docker GPU passthrough fails
  • Jellyfin hardware acceleration breaks

This happens when DKMS (Dynamic Kernel Module Support) is missing or misconfigured.


Investigation Steps

1. Check running kernel

uname -r

2. Check if NVIDIA module is loaded

lsmod | grep nvidia

No output = module not loaded.

3. Test host driver

nvidia-smi

If this fails, stop debugging Jellyfin. Fix the host first.

4. Check DKMS

dkms status

If dkms is not installed or shows no NVIDIA entry for your kernel, the module was never built.

5. Ensure kernel headers exist

sudo apt install linux-headers-$(uname -r)

No headers -> no module build.

6. Confirm GPU device nodes

ls -l /dev/nvidia*

If they do not exist, the driver is not active.


Fix

1. Install DKMS and headers

sudo apt update
sudo apt install -y dkms linux-headers-$(uname -r)

2. Reinstall the NVIDIA driver (example: 580)

sudo apt install --reinstall nvidia-driver-580

This triggers DKMS to rebuild the module for the current kernel.

3. Reboot

sudo reboot

4. Validate

nvidia-smi
lsmod | grep nvidia
dkms status | grep nvidia

Expected:

  • nvidia-smi shows GPU
  • nvidia modules loaded
  • DKMS shows installed for current kernel

5. Restart Jellyfin

docker restart jellyfin

Hardware acceleration should work again.


Secure Boot Check

If the module builds but does not load:

mokutil --sb-state

If SecureBoot enabled, disable it in BIOS or sign the module.


Make It Permanent

Install meta-packages so headers follow kernel updates:

sudo apt install -y linux-generic linux-headers-generic dkms

With DKMS properly configured, future kernel upgrades automatically rebuild the NVIDIA module.


Conclusion

If Jellyfin GPU acceleration breaks after apt upgrade, the issue is almost always:

Kernel updated -> NVIDIA module missing -> nvidia-smi fails -> container loses GPU.

Fix the host driver first. The container is rarely the root cause.