Ubuntu服务器的NVIDIA驱动自动更新所引起的问题及解决方法m

问题描述:

    服务器为Ubuntu14.04,NVIDIA驱动由352.39自动升级到352.63,导致显卡不能使用,错误为:运行nvidia-smi指令,得到的信息为“Failed to initialize NVML: GPU access blocked by the operating sestem”。

    系统:Ubuntu14.04

    cuda:7.5

 解决方案:

1. 首先关闭系统包括的所有更新

sudo vim /etc/apt/apt.conf.d/50unattended-upgrades

(注释掉其中的更新部分)

参考链接:http://www.linuxdiyf.com/linux/15997.html


2. 卸载cuda驱动并重新安装

(1)彻底卸载

sudo apt-get remove --purge nvidia*

sudo apt-get autoremove

sudo apt-get clean

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P 

参考链接:

https://devtalk.nvidia.com/default/topic/900899/cuda-setup-and-installation/unable-to-detect-cuda-capable-device-after-automatic-forced-nvidia-updated/

http://zhidao.baidu.com/link?url=smwXar3NPdAi1WxnZJ2_sARCEPoNcxLwB0RwmEnDPiqyrbdz64aVCoabN9azod-AQrJP0OjeiL8-y8mFRHZDma


(2)重装cuda

    由于之前系统Ubuntu14.04在配置好caffe环境后,编译matlab接口时将gcc由4.8降级为4.7。若直接安装cuda,会提示错误,“Unable to find the kernel source tree for the currently running kernel. Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM installed.If you know the correct kernel source files are installed, you may specify the kernel source path with the '--kernel-source-path' command line option.”.如果按照此条路径思索,在尝试添加了“--kernel-source-path”之后,仍存在问题。继续往下走,会提示给系统内核降级。

    考虑到之前曾对系统的gcc降级,这导致了上述错误,对gcc升级。

sudo apt-get install gcc-4.7

cd /usr/bin

sudo mv gcc gcc.bak

sudo ln -s gcc-4.7 gcc
sudo mv g++ g++.bak
sudo ln -s g++-4.7 g++

参考链接:http://www.mamicode.com/info-detail-876185.html


    然后按照常规方法重装cuda驱动即可解决问题。



  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值