当我尝试在内核为 4.18.0 的 CentOS 8 上安装 NVIDIA 驱动程序时,我在日志文件中收到以下错误:
error: implicit declaration of function 'drm_pci_init';
答案1
我将从头开始。首先,您必须安装开发人员包和其他一些包:
dnf groupinstall "Development Tools"
dnf install libglvnd-devel elfutils-libelf-devel
然后禁用 nuveau-driver(如果已安装)
grub2-editenv - set "$(grub2-editenv - list | grep kernelopts) nouveau.modeset=0"
您还可以完全删除驱动程序包:
dnf remove xorg-x11-drv-nouveau
现在重新启动到命令行。 X11 和所有使用 OpenGL 的东西都不能运行。
您必须下载有补丁的旧驱动程序。就我而言,最新版本是 v108,但您需要 v107。通过 NVIDIA 主页或使用 wget 获取:
# Download the driver
wget https://de.download.nvidia.com/XFree86/Linux-x86_64/340.107/NVIDIA-Linux-x86_64-340.107.run
# Unpack the driver, do not install
bash NVIDIA-Linux-x86_64-340.107.run --extract-only
cd NVIDIA-Linux-x86_64-340.107/
# Get the patch from pastebin, or the NVIDIA developer forum (link below)
wget https://pastebin.com/raw/qsqxsBmZ -O patch_340.107.diff
# Apply the patch to the
patch -l -p0 < patch_340.107.diff
# If you have another kernel version of course you have to change the path accordingly
./nvidia-installer -a --kernel-source-path /usr/src/kernels/4.18.0-240.10.1.el8_3.x86_64/