OMV5 安装 nvidia 显卡

本来想把亮机卡给 Jellyfin 用做硬件加速的,结果发现 GT1030 不支持 NVENC,而 Jellyfin 又不支持 CUDA 加速,所以就只是单纯的记录一下在 OMV 5(Debian 10)上安装 nvidia 显卡驱动的过程。

检测显卡型号

$ lspci -nn | egrep -i "3d|display|vga"
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP108 [10de:1d01] (rev a1)

也可以安装 nvidia-detect,检测显卡型号:

$ nvidia-detect
Detected NVIDIA GPUs:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP108 [10de:1d01] (rev a1)

Checking card:  NVIDIA Corporation GP108 (rev a1)
Your card is supported by the default drivers and legacy driver series 390.
It is recommended to install the
    nvidia-driver
package.

安装驱动

由于 Jellyfin 对 NVIDIA NVENC 的驱动要求为 The minimum required driver version is: Linux: 455.28, Windows: 456.71 since Jellyfin 10.8 release.,相匹配的驱动型号为 460.73.01

编辑 /etc/apt/sources.list,添加:

# buster-backports
deb http://deb.debian.org/debian buster-backports main contrib non-free

刷新源:

$ sudo apt update

从 backports 安装驱动

$ sudo apt install -t buster-backports nvidia-driver nvidia-smi firmware-misc-nonfree

解决 nvidia-smi 无法与驱动通信的问题

NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver

该问题是内核版本不匹配导致的

$ sudo dkms install -m nvidia -v nvidia-current-460.73.01

-v 参数指定驱动版本,检查方法如下:

$ ls /usr/src | grep nvidia
nvidia-current-460.73.01

安装匹配的头文件:

$ sudo apt install linux-headers-5.10.0-0.bpo.9-amd64

重启一下,再执行 nvidia-smi 就正常了。

Reference