cuda The driver installation is unable to locate the kernel source

本文介绍了解决在Ubuntu16.04上安装CUDA时遇到的内核源代码未找到的问题。通过降低内核版本的方法可以成功安装。具体步骤包括卸载高版本内核映像及头文件,更新初始RAM磁盘并重启。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在Ubuntu16.04上安装cuda时,报如下错误;

Installing the NVIDIA display driver…
The driver installation is unable to locate the kernel source. Please make sure that the kernel source packages are installed and set up correctly.
If you know that the kernel source packages are installed and set up correctly, you may pass the location of the kernel source with the ‘–kernel-source-path’ flag.

主要是由于内核版本版本过高(由下图可知,ubuntu 16.04目前内核版本需要是4.4,如果是4.4以上应该就需要降版本),可以通过降低内核版本的方式解决,

这里写图片描述
首先,通过uname -r查看内核版本,例如输出为4.13.0-26-generic
则执行,

sudo apt-get purge linux-image-4.13.0-26-generic
sudo apt-get purge linux-headers-4.13.0-26-generic

sudo update-initramfs -u

重启后,重新安装cuda,即可正常安装。

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值