I am tring to install nvidia driver
by the following command.
sudo ./NVIDIA-Linux-x86_64-418.43.run --dkms -s
Here I got an error as follows.
ERROR: Failed to run `/sbin/dkms build -m nvidia -v 418.43 -k 3.10.0-1062.el7.x86_64`: Error! echo
Your kernel headers for kernel 3.10.0-1062.el7.x86_64 cannot be found at
/lib/modules/3.10.0-1062.el7.x86_64/build or /lib/modules/3.10.0-1062.el7.x86_64/source.
You can use the --kernelsourcedir option to tell DKMS where it's located.
ERROR: Failed to install the kernel module through DKMS. No kernel module was installed; please try installing again without DKMS, or check the DKMS logs for more
information.
However, /lib/modules/3.10.0-1062.el7.x86_64/build
and /lib/modules/3.10.0-1062.el7.x86_64/source
are both in my /lib/modules
path.
# cd /lib/modules/3.10.0-1062.el7.x86_64
# ls -la
lrwxrwxrwx. 1 root root 39 7月 2 11:11 build -> /usr/src/kernels/3.10.0-1062.el7.x86_64
lrwxrwxrwx. 1 root root 5 7月 2 11:11 source -> build
I have tried sudo yum install "kernel-devel-uname-r == $(uname -r)"
in a similar question which doesn't work, it said
No package kernel-devel-uname-r == 3.10.0-1062.el7.x86_64 available
This is my output of uname -r
3.10.0-1062.el7.x86_64
And this is the kernel
related packages
kernel.x86_64 3.10.0-1062.el7
kernel.x86_64 3.10.0-1160.31.1.el7
kernel-devel.x86_64 3.10.0-1160.31.1.el7
kernel-headers.x86_64 3.10.0-1160.31.1.el7
How can I solve this?
lspci | grep 3D
? Forgot to ask: are you running this in a VM or is it bare metal?1b:00.0 3D controller: NVIDIA Corporation TU104GL [Tesla T4] (rev a1)
. I am runnning on a CentOS server.