Ask Your Question

Kernel 4.14.16-300 gcc 7.3.1 dkms failure [SOLVED] [closed]

asked 2018-02-02 19:50:12 -0600

SteveEbey73701 gravatar image

updated 2018-02-04 08:49:54 -0600

after updating to the captioned kernel, dkms failed, because the compiler that built the kernel is 7.3.1 and the most recent I can find to install is 7.2.1, so dkms failed to make driver update for the new kernel. The workaround suggested was to set a variable to ignore version mismatch, but it also cautioned that doing so might cause subtle problems to manifest in drivers and code. My question, does anyone know when gcc 7.3.1 will roll out for us to use, so I can grab the newer kernel and have dkms work properly?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by SteveEbey73701
close date 2018-02-04 09:38:44.453808


in my case, the updates was installed (kernel 4.14.16-300, python 3.6.4-7,etc) seemingly without problems, but after reboot the pc stooped after the grub step , (the screen shown lines similar [ok] network.. , [ok] enable virtual ..., etc) like the picture there .

christianbueno gravatar imagechristianbueno ( 2018-02-03 13:54:44 -0600 )edit

how did you know that information about gcc compiler version ? I have gcc 7.2.1 installed in my fedora 27 too.

christianbueno gravatar imagechristianbueno ( 2018-02-03 14:02:56 -0600 )edit

That's a common point of failure (right around when the GNOME Display Manager is being called up) when your graphics driver is borked. Just boot into (to avoid using the borked graphics driver) and run nvidia-uninstall. Reboot and you can proceed with the solution in the answers below to properly install the driver.

bitwiseoperator gravatar imagebitwiseoperator ( 2018-02-03 14:03:37 -0600 )edit

If you attempt to install the driver after specifying that you wish not to use DKMS, The Nvidia installer will inform you that the compiler on your system is gcc-7.2.1 whereas your kernel was built with gcc-7.3.1. It will warn you not to proceed at that point (for sanity, the Linux kernel and DKMS will, by default, reject kernel modules which were compiled with compilers not used for the kernel itself).

bitwiseoperator gravatar imagebitwiseoperator ( 2018-02-03 14:05:20 -0600 )edit

I had to select the previous kernel 4.14.14-300 ,it work well. But how can we check the problem? or it is the same like you.

christianbueno gravatar imagechristianbueno ( 2018-02-03 14:08:44 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-02-03 13:59:10 -0600

updated 2018-02-03 14:01:18 -0600

Nice job; but you don't need to downgrade your kernel to fix this problem. The issue is that the current kernel is built with gcc-7.3.1, whereas only gcc-7.2.1 is available to Fedora systems in the current repo. You were right to therefore update the gcc-c++ package from the testing repo, as that will allow you to compile the driver (Nvidia, I presume - I hit the error as well) for the current kernel. An alternative approach would be to downgrade to the previous kernel (but who wants to do that?) and install with gcc-7.2.1, but doing both is unnecessary.

TL;DR - The answer is either:

  1. Upgrade to gcc-7.3.1 using the testing repository as @steveebey73742 shows in his answer, then install (what I presume to be) the Nvidia driver without any further steps.
  2. Otherwise, if you downgrade your kernel, you can install the driver without upgrading gcc (since the previous kernel was compiled with gcc-7.2.1, and that's what you have).
edit flag offensive delete link more

answered 2018-02-03 10:08:27 -0600

SteveEbey73701 gravatar image

updated 2018-02-04 08:47:03 -0600

Steps shown here corrected the issue, after picking a previous kernel to boot from:

sudo dnf remove kernel-core-4.14.16-300.fc27
sudo dnf --enablerepo=updates-testing upgrade gcc-c++
sudo dnf update

dkms rebuilt the driver, using the new 7.3.1 gcc and everything is right again with my computer.

after seeing the other answer, and comments, let me clarify the reasoning in my 3 step solution. By removing the offending kernel, then upgrading to 7.3.1 and re running the update, dkms rebuilds, as it would during a normal kernl upgrade, and is not quite as involved as some of the other answers or comments here. I prefer the simplest solution, to allow for the least opportunity of mistakes.

edit flag offensive delete link more


To expand on this answer (for newbies like me):

  1. Upon reboot, choose an earlier kernel in GRUB than 4.14.16-300
  2. When logged in, run:
    sudo dnf install gcc-c++
  1. Upon the success of this command, run:
    sudo dnf --enablerepo=updates-testing upgrade gcc-c++
  1. Finally, run:
    sudo dnf update
gbrown gravatar imagegbrown ( 2018-02-05 19:15:05 -0600 )edit

if you have dkms installed, you would also have had gcc installed, so that step is not needed, that is why it is not included in my answer.

SteveEbey73701 gravatar imageSteveEbey73701 ( 2018-02-05 23:09:43 -0600 )edit

Question Tools

1 follower


Asked: 2018-02-02 19:50:12 -0600

Seen: 1,720 times

Last updated: Feb 04 '18