0

I am attempting to install the non-free Nvidia drivers (390.48-2~bpo9+3) from Stretch Backports : https://packages.debian.org/stretch-backports/nvidia-driver

# apt-get install -t stretch-backports nvidia-driver.

An error occurs:

Building for 4.16.0-0.bpo.1-amd64
Building initial module for 4.16.0-0.bpo.1-amd64
Error! Bad return status for module build on kernel: 4.16.0-0.bpo.1-amd64 (x86_64)
Consult /var/lib/dkms/nvidia-current/390.48/build/make.log for more information.

In /var/lib/dkms/nvidia-current/390.48/build/make.log I find:

Compiler version check failed:

The major and minor number of the compiler used to
compile the kernel:

gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)

does not match the compiler used here:

gcc-6 (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


It is recommended to set the CC environment variable
to the compiler that was used to compile the kernel.

This should be the same version of gcc used to compile the kernel:

cat /proc/version 
Linux version 4.16.0-0.bpo.1-amd64 (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 SMP Debian 4.16.5-1~bpo9+1 (2018-05-06)

I remove the Nvidia packages: # apt-get remove --purge .*nvidia.*

And try again: # IGNORE_CC_MISMATCH=1 apt-get install -t stretch-backports nvidia-driver

A different error in make.log:

The C compiler ' gcc-6' does not appear to be able to
create object files.  Please make sure you have 
your Linux distribution's libc development package
installed and that ' gcc-6' is a valid C compiler
name.

*** Failed CC sanity check. Bailing out! ***

Configuring update-alternatives to point gcc and cc at gcc-4.9 has no effect.

# CC=/usr/bin/gcc-6 IGNORE_CC_MISMATCH=1 apt-get install -t stretch-backports nvidia-driver

is not useful.

# CC=/usr/bin/gcc-4.9 IGNORE_CC_MISMATCH=1 apt-get install -t stretch-backports nvidia-driver

still produces the error The C compiler ' gcc-6' does not appear to be able to create object files.

With other attempts I have produced an error that mentions no-pie. These flags had an effect but produced other errors: https://www.linuxquestions.org/questions/debian-26/%5Bsolved%5D-cannot-compile-nvidia-driver-kernel-does-not-support-pic-mode-4175593548/

4
  • 1
    Install a complete "gcc-6" : # apt install g++ → The missing gcc packages { libc6-dev, linux-libc-dev } will be installed as dependencies. Jun 3 '18 at 13:43
  • Thanks but this did not solve the problem. g++ was already installed. libc6-dev has been upgraded to the version from stretch-backports. Same error in log: "...' gcc-6' does not appear to be able to create object files." Jun 3 '18 at 23:14
  • 1
    I would submit a bug against package nvidia-driver.
    – malat
    Jun 4 '18 at 10:03
  • Reported here: bugs.debian.org/cgi-bin/bugreport.cgi?bug=901203 Jun 10 '18 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.