Skip to content

Instantly share code, notes, and snippets.

@kurtis318
Last active March 23, 2020 21:05
Show Gist options
  • Save kurtis318/a3501a26a78146c6defd35ba28fb036b to your computer and use it in GitHub Desktop.
Save kurtis318/a3501a26a78146c6defd35ba28fb036b to your computer and use it in GitHub Desktop.
NVIDIA 340.107 driver patch for CentOS 7.7

Issue:

Upgraded my HP server to CentOS 7.5 and now the manual NVIDIA installer I had been using for what seems forever (NVIDIA-Linux-x86_64-340.107.run) failed right after the the compilation reached 100%.

Here is a portion of the log file /var/log/nvidia-installer.log

-> Building NVIDIA kernel module:
executing: 'cd ./kernel; /usr/bin/make module SYSSRC=/lib/modules/3.10.0-1062.1.1.el7.x86_64/source SYSOUT=/lib/modules/3.10.0-1062.1.1.el7.x86_64/build NV_BUILD_MODULE_INSTANCES='...
NVIDIA: calling KBUILD...
make[1]: Entering directory `/usr/src/kernels/3.10.0-1062.1.1.el7.x86_64'
/usr/bin/make -C /lib/modules/3.10.0-1062.1.1.el7.x86_64/build \
KBUILD_SRC=/usr/src/kernels/3.10.0-1062.1.1.el7.x86_64 \
KBUILD_EXTMOD="/tmp/selfgz2872/NVIDIA-Linux-x86_64-340.107/kernel" -f /usr/src/kernels/3.10.0-1062.1.1.el7.x86_64/Makefile \
modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo >&2; \
echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo >&2 ; \

Solution:

https://devtalk.nvidia.com/default/topic/1064008/centos-7-7-intall-nvidia-linux-x86_64-340-107-fails/ https://devtalk.nvidia.com/default/topic/1047179/linux/-solved-nvidia-340-107-linux-5-0-rc5-failed-to-build-kernel-module/

The first link above refers to a patch file found in the second.
The patch file below worked for the following kernels:

3.10.0-1062.7.1.el7.x86_64      # 2019.12.05

Here are the instructions from the first URL:

Download the patch and do the following. My notes:

Run nvidia install in one window

./NVIDIA-Linux-x86_64-340.107.run

Here is the screen to stop at.

image

Use the following command if installer says X server already running

/tmp/.X1-lock

Let it expand to produce a /tmp/self#### directory.  See screen shot below.

In another window

cd /tmp/selfgz####/NVIDIA-Linux-x86_64-340.107

patch -p0 -l < /home/kurtis/backup/nv_patch_340.107_linux_kernel_5.0

patching file kernel/Makefile
patching file kernel/conftest.sh
patching file kernel/nv-drm.c
patching file kernel/nv-time.h
patching file kernel/os-interface.c
patching file kernel/uvm/Makefile
patching file kernel/uvm/nvidia_uvm_linux.h
patching file kernel/uvm/nvidia_uvm_lite.c
Hunk #1 succeeded at 2008 (offset -11 lines).
Hunk #2 succeeded at 2040 (offset -11 lines).

cd /

Go back to first window and continue the install

reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment