Debian Stretch 上的“gcc-6”和 Nvidia 驱动程序

Debian Stretch 上的“gcc-6”和 Nvidia 驱动程序

390.48-2~bpo9+3我正在尝试从 Stretch Backports安装非免费 Nvidia 驱动程序 ( ):https://packages.debian.org/stretch-backports/nvidia-driver

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

出现错误:

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.

/var/lib/dkms/nvidia-current/390.48/build/make.log我发现:

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.

这应该与用于编译内核的 gcc 版本相同:

cat /proc/version 
Linux version 4.16.0-0.bpo.1-amd64 ([email protected]) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 SMP Debian 4.16.5-1~bpo9+1 (2018-05-06)

我删除了 Nvidia 软件包:# apt-get remove --purge .*nvidia.*

然后再试一次:# IGNORE_CC_MISMATCH=1 apt-get install -t stretch-backports nvidia-driver

另一个错误是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! ***

配置update-alternatives为 pointgccccatgcc-4.9没有效果。

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

没有用。

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

仍然产生错误The C compiler ' gcc-6' does not appear to be able to create object files.

通过其他尝试,我产生了一个提到的错误no-pie。这些标志产生了影响,但产生了其他错误:https://www.linuxquestions.org/questions/debian-26/%5Bsolved%5D-cannot-compile-nvidia-driver-kernel-does-not-support-pic-mode-4175593548/

相关内容