我不觉得会有什么通用的解决方案,但是看文档总是有用的。
另外,一般需要 DKMS 的都是涉及到内核模块的软件,比如 CDEmu(https://cdemu.sourceforge.io/ ),显卡的私有驱动,或者是还没有进入内核的软件(比如之前的 WireGuard),这也许可以作为一个参考方向。我想对于新手而言,可能遇到的基本都是显卡驱动,网卡驱动,指纹驱动一类。
(值得注意的是,内核模块和硬件的固件是两个东西,前者用于扩展 linux 内核的能力,后者是加载到硬件里面的给硬件用的二进制文件,我想可能会有新手把这两个混淆在一起。只有内核模块才需要 DKMS。)
至于这个话题中提到的NVIDIA 显卡驱动,Wiki 里明确提到了需要 DKMS:
https://wiki.debian.org/NvidiaGraphicsDrivers
DKMS will build the nvidia module for your system, via the nvidia-kernel-dkms package.
(需要注意这个 Wiki 的中文版本年久失修,已经不具有参考价值了。)
不过我没有 N 卡,所以具体英伟达的驱动包怎么个安装步骤,需要什么,我也就不了解了。
其实 nvidia-driver
软件包的信息中也有写:
$ apt info nvidia-driver
Package: nvidia-driver
Version: 525.125.06-1~deb12u1
Priority: optional
Section: non-free/x11
Source: nvidia-graphics-drivers
Maintainer: Debian NVIDIA Maintainers pkg-nvidia-devel@lists.alioth.debian.org
Installed-Size: 1,406 kB
Provides: nvidia-driver-any, nvidia-glx-any
Pre-Depends: nvidia-installer-cleanup, nvidia-legacy-check (>= 495)
Depends: nvidia-driver-libs (= 525.125.06-1~deb12u1), nvidia-driver-bin (= 525.125.06-1~deb12u1), xserver-xorg-video-nvidia (= 525.125.06-1~deb12u1), nvidia-vdpau-driver (= 525.125.06-1~deb12u1), nvidia-alternative (= 525.125.06-1~deb12u1), nvidia-kernel-dkms (= 525.125.06-1~deb12u1) | nvidia-kernel-525.125.06 | nvidia-open-kernel-525.125.06 | nvidia-open-kernel-525.125.06, nvidia-support
Recommends: nvidia-settings (>= 525), libnvidia-cfg1 (= 525.125.06-1~deb12u1), nvidia-persistenced
Suggests: nvidia-kernel-dkms (>= 525.125.06) | nvidia-kernel-source (>= 525.125.06) | nvidia-open-kernel-source (>= 525.125.06) | nvidia-open-kernel-source (>= 525.125.06)
Homepage: https://www.nvidia.com
Download-Size: 498 kB
Description: NVIDIA metapackage
This metapackage depends on the NVIDIA binary driver and libraries
that provide optimized hardware acceleration of
OpenGL/GLX/EGL/GLES/Vulkan applications via a direct-rendering X Server.
.
Please see the nvidia-kernel-dkms (nvidia-open-kernel-dkms)
or nvidia-kernel-source (nvidia-open-kernel-source) packages
for building the kernel module required by this package.
This will provide nvidia-kernel-525.125.06
(nvidia-open-kernel-525.125.06).
.
This version only supports GeForce, NVS, Quadro, RTX, Tesla, … GPUs based on
the Maxwell, Pascal, Volta, Turing, Ampere or newer architectures.
Look at the legacy driver or Tesla driver packages for older cards.
.
See /usr/share/doc/nvidia-driver/README.txt.gz
for a complete list of supported GPUs and PCI IDs.
.
Building the kernel module has been tested up to Linux 6.4.
nvidia-driver
的依赖中包含 nvidia-kernel-dkms
:
$ apt info nvidia-kernel-dkms
Package: nvidia-kernel-dkms
Version: 525.125.06-1~deb12u1
Priority: optional
Section: non-free/kernel
Source: nvidia-graphics-drivers
Maintainer: Debian NVIDIA Maintainers pkg-nvidia-devel@lists.alioth.debian.org
Installed-Size: 72.5 MB
Provides: nvidia-kernel-525.125.06, nvidia-kernel-dkms-any (= 525.125.06)
Pre-Depends: nvidia-installer-cleanup
Depends: firmware-nvidia-gsp (= 525.125.06) | firmware-nvidia-gsp-525.125.06, nvidia-kernel-support–v1, dkms (>= 3.0.3-4~)
Recommends: nvidia-driver (>= 525.125.06) | libcuda1 (>= 525.125.06)
Homepage: https://www.nvidia.com
Download-Size: 44.2 MB
Description: NVIDIA binary kernel module DKMS source
This package builds the NVIDIA binary kernel modules needed by
nvidia-driver, using DKMS.
Provided that you have the kernel header packages installed, the kernel
module will be built for your running kernel and automatically rebuilt for
any new kernel headers that are installed.
.
The NVIDIA binary driver provides optimized hardware acceleration of
OpenGL/GLX/EGL/GLES applications via a direct-rendering X Server
for graphics cards using NVIDIA chip sets.
.
This version only supports GeForce, NVS, Quadro, RTX, Tesla, … GPUs based on
the Maxwell, Pascal, Volta, Turing, Ampere or newer architectures.
Look at the legacy driver or Tesla driver packages for older cards.
.
See /usr/share/doc/nvidia-kernel-dkms/README.txt.gz
for a complete list of supported GPUs and PCI IDs.
.
Building the kernel modules has been tested up to Linux 6.4.
.
Note: The new ‘non-free-firmware’ archive area has to be enabled in apt’s
sources.list(.d/) in order to install firmware-nvidia-gsp.