My home server has been running almost continuously for more than five years. Under normal circumstances, a hardware upgrade would be worth considering. Unfortunately, prices have risen significantly due to the high demand from AI data centers, affecting almost all other hardware components as well.
I recently started running a Jellyfin instance on my server. To handle transcoding, I need a graphics card.
Since the motherboard is already quite old and the case is very small, there aren’t many cards to choose from. Ideally, I would have gone with the NVIDIA Quadro T600 with 4 GB of VRAM, but even its price has nearly doubled.
In the end, I went with the NVIDIA Quadro P400. It should be sufficient for Full HD transcoding, but unfortunately, 4K transcoding is out of the question.
Installing the card was a little fiddly due to the limited space inside the case. All in all, however, the installation was quick and straightforward.
First, we need to disable the open-source Nouveau driver, as it does not support hardware transcoding via NVENC.
Check whether Nouveau is currently in use:
lsmod | grep nouveauIf it is, the driver needs to be blacklisted:
echo -e "blacklist nouveau\noptions nouveau modeset=0" > /etc/modprobe.d/blacklist-nouveau.conf
update-initramfs -u
rebootNext, install the required tools:
apt update && apt full-upgrade -y
apt install -y pve-headers-$(uname -r) build-essential dkmsFind the appropriate driver:
You can enter your graphics card details here. In my case, the search returned this driver.
wget https://de.download.nvidia.com/XFree86/Linux-x86_64/580.196.07/NVIDIA-Linux-x86_64-580.196.07.run
chmod +x NVIDIA-Linux-x86_64-580.196.07.run
./NVIDIA-Linux-x86_64-580.196.07.runVerify that the installation was successful:
nvidia-smiThe graphics card needs to be passed through to the LXC container. The exact same driver must be installed inside the container, but without the kernel module, since the container shares its kernel with the Proxmox host.
vim /etc/pve/lxc/380.confAdd the following entries:
lxc.cgroup2.devices.allow: c 195:* rwm
lxc.cgroup2.devices.allow: c 226:* rwm
lxc.mount.entry: /dev/nvidia0 dev/nvidia0 none bind,optional,create=file
lxc.mount.entry: /dev/nvidiactl dev/nvidiactl none bind,optional,create=file
lxc.mount.entry: /dev/nvidia-uvm dev/nvidia-uvm none bind,optional,create=file
lxc.mount.entry: /dev/nvidia-modeset dev/nvidia-modeset none bind,optional,create=fileThen install the driver inside the container:
wget https://de.download.nvidia.com/XFree86/Linux-x86_64/580.196.07/NVIDIA-Linux-x86_64-580.196.07.run
chmod +x NVIDIA-Linux-x86_64-580.196.07.run
./NVIDIA-Linux-x86_64-580.196.07.run --no-kernel-moduleNote 1: nvidia-smi does not show processes running inside the container. However, they are visible when running it on the Proxmox host. This appears to be a permissions issue.
Note 2: Since LXC containers are not full virtual machines but share the kernel (and therefore the hardware drivers) with the Proxmox host, the graphics card can be passed through to multiple LXC containers simultaneously.
However, sharing the same graphics card between multiple virtual machines is not possible with this method. When passing a graphics card through to a full virtual machine, Proxmox uses PCIe passthrough (VFIO). This method detaches the graphics card physically from the host system and assigns it exclusively to the virtual machine.