安装NVIDIA驱动时碰到 “The CC version check failed”以及延伸的兼容性思考

 

安装NVIDIA驱动时碰到 “The CC version check failed”的问题的解决思路与过程:

一、问题贴图:

The CC version check failed:

  The kernel was built with gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2) , but the current compiler version is cc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609.

  This may lead to subtle problems; if you are not certain whether the mismatched compiler will be compatible with your kernel, you may wish to abort installation, set the CC environment variable to the name of the compiler used to
  compile your kernel, and restart installation.

                                                                    Ignore CC version check                                                         Abort installation

输出的log日志:

 ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

此问题是说:您的linux内核是gcc5.3.1编译构建的,但是目前系统的gcc编译器是5.4.0的版本,5.4.0的gcc版本编译安装的程序可能会导致与5.3.1版本的内核出现兼容性的问题,建议设置gcc的编译器为编译内核的版本。

类似的问题:https://askubuntu.com/questions/873278/linux-kernel-version-and-gcc-version-match

参见bug(https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/1608753)描述:

Ubuntu发行版本以及内核版本:

sinc-lab@sinclab-desktop:~$ cat /proc/version
Linux version 4.4.0-21-generic (buildd@lgw01-21) (gcc version 5.3.1 20160413 (Ub                                                                                                                                                             untu 5.3.1-14ubuntu2) ) #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016
sinc-lab@sinclab-desktop:~$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
Copyright (C) 2015 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.

sinc-lab@sinclab-desktop:~$ lsb_release -rd
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
sinc-lab@sinclab-desktop:~$ uname -r
4.4.0-21-generic
sinc-lab@sinclab-desktop:~$ ldd --version
ldd (Ubuntu GLIBC 2.23-0ubuntu10) 2.23
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.
Written by Roland McGrath and Ulrich Drepper.

 

二 、CUDA、cuDNN、TensorRT兼容性思考

考虑到后面配置cuda和cudnn等deep learningSDK对gcc也有版本的限制要求时,这里先来充分调研一下5.3.1的gcc对cuda、cudnn等工具的兼容性问题:

cuda9.0

cuda9.0的官方doc(https://docs.nvidia.com/cuda/archive/9.0/cuda-installation-guide-linux/index.html

sinc-lab@sinclab-desktop:~$ uname -r
4.4.0-21-generic
sinc-lab@sinclab-desktop:~$ ldd --version
ldd (Ubuntu GLIBC 2.23-0ubuntu10) 2.23
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.
Written by Roland McGrath and Ulrich Drepper.

由上可知:解决好gcc编译器的版本就可以在配置完NVIDIA显卡驱动的基础上直接配置CUDA了。

cuDNN

接着翻阅https://developer.nvidia.com/deep-learning-software的产品信息,

这里要纠正一下:cuDNN的配置基于CUDA,CUDA的配置基于NVIDIA Driver,列出NVIDIA的官方文档cuDNN Installation Guide作为例证,

TensorRT

查阅TensorRTTensorRT Installation Guide文档,

这里TensorRT是使用gcc5.4.0编译的,而kernel的编译环境在gcc5.3.1,这里也存在一个与kernel兼容性的问题。

综上,CUDA9.0所允许的gcc最高版本为5.3.1,TensorRT是使用gcc5.4.0编译的,而Ubuntu的环境为:内核4.4.0-21-generic(built with gcc version 5.3.1),gcc version为5.4.0,GLIBC version为2.23。往上升级内核4.4.0-21-generic(built with gcc version 5.3.1)到gcc 5.4.0编译的内核会导致CUDA9.0不兼容,往下降级gcc5.4.0到5.3.0可能会导致TensorRT的不兼容。

摸索了再三,并没有找到很好的解决思路,考虑到因为这是新装的Ubuntu系统,里面的内核、gcc版本均是系统原装的,决定内核和gcc的版本都不动配置,按照默认尝试进行配置。

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值