1.开机按esc进入ubuntu高级选项,选择内核版本,之后回车



注意:记住此版本号

2.接下来按照如下操作

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration' # GRUB_DEFAULT=0
GRUB_DEFAULT="1> 2" # 修改后的配置
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="" # Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" # Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console # The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true" # Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"



3.重启之后采用uname -r 查看当前的内核版本

参考链接:https://www.toutiao.com/i7023555532728353294/

执行darknet下面的文件后出现新的问题

(yolov4) waq@waq-MS-7885:~/Downloads/ai/Vitis-AI-1.3.2/yolo_dploy/darknet-master$ ./darknet detector train  cfg/voc.data cfg/yolov4.cfg  yolov4.weights -map
CUDA status Error: file: ./src/dark_cuda.c : () : line: 38 : build time: Nov 22 2021 - 20:42:38 CUDA Error: unknown error
Darknet error location: ./src/dark_cuda.c, check_error, line #69
CUDA Error: unknown error: Bad file descriptor
(yolov4) waq@waq-MS-7885:~/Downloads/ai/Vitis-AI-1.3.2/yolo_dploy/darknet-master$

搜集资料发现是cuda的问题,哎,再重新装一次cuda!!!

1.官网下载安装文件,我这里下载的是run文件,安装之前卸载掉之前安装的旧版本cuda10.1(具体版本查看nvcc --version)

一般默认安装路径是/usr/local/ 下面,卸载旧版本 进入到 /usr/local/cuda-10.1/bin下面,执行 sudo ./cuda-uninstaller文件,最后成功卸载,可以紧接着删除文件夹即可

2.安装新下载的run文件



注意选择安装的时候不要勾选驱动,去掉x即可,其他的勾选,安装完之后会有一个summary:

  ===========
= Summary =
=========== Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-10.1/
Samples: Installed in /home/waq/, but missing recommended libraries Please make sure that
- PATH includes /usr/local/cuda-10.1/bin
- LD_LIBRARY_PATH includes /usr/local/cuda-10.1/lib64, or, add /usr/local/cuda-10.1/lib64 to /etc/ld.so.conf and run ldconfig as root To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-10.1/bin Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-10.1/doc/pdf for detailed information on setting up CUDA.
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 418.00 is required for CUDA 10.1 functionality to work.
To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file:
sudo <CudaInstaller>.run --silent --driver Logfile is /var/log/cuda-installer.log

3.安装完成之后添加环境变量,在home目录下,ctrl+H打开隐藏的文件,找到.bashrc,打开添加路径(vi ~/vim .bashrc)

4.完成之后测试官方的例子,一直失败


./deviceQuery Starting... CUDA Device Query (Runtime API) version (CUDART static linking) cudaGetDeviceCount returned 999
-> unknown error
Result = FAIL

5.只好重新装一遍驱动了。。。。。。。。。。

https://www.jianshu.com/p/8594771c7d5e

Loading new nvidia-495.44 DKMS files...

Building for 4.15.0-162-generic 4.15.0-163-generic

Building for architecture x86_64

Building initial module for 4.15.0-162-generic

Error! Bad return status for module build on kernel: 4.15.0-162-generic (x86_64)

Consult /var/lib/dkms/nvidia/495.44/build/make.log for more information.

Setting up nvidia-compute-utils-495 (495.44-0ubuntu0.18.04.1) ...

Warning: The home dir /nonexistent you specified can't be accessed: No such file or directory

Adding system user nvidia-persistenced' (UID 121) ... Adding new group nvidia-persistenced' (GID 127) ...

Adding new user nvidia-persistenced' (UID 121) with group nvidia-persistenced' ...

pam_tally2: /var/log/tallylog is either world writable or not a normal file

pam_tally2: Authentication error

useradd: failed to reset the tallylog entry of user "nvidia-persistenced"

Not creating home directory `/nonexistent'.

(哎,可能是上次跑一个程序的时候由于修改了gcc版本,导致安装失败),接下里重新修改gcc版本。。。。

参考:

https://blog.csdn.net/JerryZhang__/article/details/108865176

https://forum.xanmod.org/thread-3635.html

sudo apt-get update
sudo apt-get install gcc-8
sudo apt-get install g++-8
cd /usr/bin
sudo rm gcc g++
sudo ln -s gcc-8 gcc
sudo ln -s g++-8 g++
https://blog.csdn.net/weixin_44128857/article/details/108554751

3.修改完gcc版本之后,安装cuda,然后再添加环境变量,最后测试



注意cuda版本需要对应,我截图中版本不同,所以需要将环境变量里面的版本修改为具体安装的版本



4.安装cudnn

安装cudnn

进入https://developer.nvidia.com/cudnn 下载对应的文件夹,解压,

注意:一定要和cuda的版本对应!!!

下载完成后解压并进入文件夹:

sudo cp cuda/include/cudnn.h /usr/local/cuda/include/
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/include/cudnn.h
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*

在终端查看CUDNN版本:

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

输出结果:

  #define CUDNN_MAJOR 7
#define CUDNN_MINOR 5
#define CUDNN_PATCHLEVEL 0
--
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL) #include "driver_types.h"

ubuntu18.04开机后NVIDIA显卡驱动加载失败的更多相关文章

  1. Ubuntu18.04安装/卸载NVIDIA显卡驱动

    1 显卡驱动下载 官网:NVIDIA 搜索适合本机的驱动 获取最新版本驱动 立即下载 文件 以上,显卡驱动下载完成. 2 显卡驱动安装 2.1 添加可执行权限 进入驱动文件目录sudo chmod a ...

  2. 关于Eclipse在servlet中连接数据库时出现驱动加载失败的解决

    问题:在队友发来的项目中想将他获取到的数据通过数据库储存,出现驱动加载失败问题 解决:首先百度了下相关情况,大多数都是说下载mysql-connector-java-5.1.39-bin.jar包,然 ...

  3. Ubuntu 14.04 LTS 安装 NVIDIA 显卡驱动后的屏幕亮度调节问题

    安装 Ubuntu,对于 NVIDIA 显卡,默认情况下会使用第三方开源驱动,并且一般情况下,第三方开源驱动和系统兼容性更好.由于 NVIDIA 显卡驱动不是开放的,所以对 Linux 系统的原生支持 ...

  4. ubuntu14.04安装、NVIDIA显卡驱动安装及CUDA8.0、Cudnn5.1的环境搭建

    安装环境:hp-Z440工作站.64位Ubuntu14.04(64位Ubuntu16.04).Cuda8.0.Cudnn5.1.Nvidia GeForce GT 705.Tesla K40c 本文可 ...

  5. ubuntu 14.04 如何安装nvidia显卡驱动 [转载]

    我的机子装的是64位ubuntu 14.04 LTS系统,显卡是GeForce 405 ,想使用cuda所以需要装NVidia官方驱动,但是总是碰到 nouveau 驱动正在使用的问题.找了好久,网上 ...

  6. ubuntu14.04安装使用NviDIA显卡驱动

    想给自己的ubuntu换N卡驱动的原因: 一方面,由于自己电脑在编译源代码8线程全开(make -j8)时,CPU温度呼呼涨到八九十度,从而常常导致系统保护自动关机,让人有点不爽.网上有说ubuntu ...

  7. Ubuntu13.04手动安装nvidia显卡驱动

    1. 下载最新版的nVidia驱动,命名为NVIDIA.run. http://www.nvidia.com/page/drivers.html 2.编辑blacklist.conf. sudo ge ...

  8. Ubuntu18.04.2下安装 RTX2080 Nvidia显卡驱动

    转载请注明出处:BooTurbo  https://www.cnblogs.com/booturbo/p/11261903.html 不久前入手了蓝天P870TM1G准系统,配置如下: 1. Z370 ...

  9. Ubuntu 18.04安装NVIDIA显卡驱动教程

            最近遇到了在Ubuntu 18.04上安装NVIDIA显卡驱动的情况,看到一篇教程讲解的很好,拿来收藏. 安装NVIDIA显卡驱动风险极大,新手注意. 在Ubuntu 18.04上安装 ...

  10. vs2008包加载失败

    由于安装vs2008sp1后,新建项目报错,解决未遂,于是重装vs2008,装完后又出现包加载失败问题: Microsoft.Data.Entity.Design.Package.MicrosoftD ...

随机推荐

  1. YonBuilder移动开发平台功能大盘点

    YonBuilder是面向企业组织和个人开发者的低代码开发平台,实现无代码.低代码.专业代码开发三种模式.提供元数据驱动和画布构建两种开发方式,通过点击拖拽+自动化代码生成和移动多端编译的技术,与开放 ...

  2. java Jdbc 简单方法

    1.注册驱动(第一种方法) Class.forName(com.mysql.jdbc.Driver"); 2.获得连接DriverManager.getConnection(url,user ...

  3. 一文掌握MyBatis的动态SQL使用与原理

    摘要:使用动态 SQL 并非一件易事,但借助可用于任何 SQL 映射语句中的强大的动态 SQL 语言,MyBatis 显著地提升了这一特性的易用性. 本文分享自华为云社区<MyBatis详解 - ...

  4. 6、发送验证码功能(Redis)

    一.业务需求: 1.后端随机生成短信验证码,并在服务器端保存一定时间(redis): 2.将短信验证码发给用户: 3.用户输入短信验证码提交后,在后端与之前生成的短信验证码作比较,如果相同说明验证成功 ...

  5. [OpenCV实战]20 使用OpenCV实现基于增强相关系数最大化的图像对齐

    目录 1 背景 1.1 彩色摄影的一个简短而不完整的历史 1.2 OpenCV中的运动模型 2 使用增强相关系数最大化(ECC)的图像对齐 2.1 findTransformECC在OpenCV中的示 ...

  6. Profiler导致的严重性能问题

    背景 客户反馈系统突然运行非常缓慢,持续了近20分钟的时间,通过SQL专家云定位到有人开启了Profiler导致,但是不能定位是谁开启的,请我们协助分析. 现象  登录SQL专家云,进入实时可视化页面 ...

  7. python之路22 hashlib、subprocess、logging模块

    hashlib加密模块 hashlib模块为不同的安全哈希/安全散列(Secure Hash Algorithm)和 信息摘要算法(Message Digest Algorithm)实现了一个公共的. ...

  8. 数位排序【第十三届蓝桥杯省赛C++C组】

    数位排序 小蓝对一个数的数位之和很感兴趣,今天他要按照数位之和给数排序. 当两个数各个数位之和不同时,将数位和较小的排在前面,当数位之和相等时,将数值小的排在前面. 例如,\(2022\) 排在 \( ...

  9. MySQL union 和 order by 同时使用

    目录 一.出现错误的情况 二.解决上述问题的两种方法 三.案例分析: 求解: 常见的错误解法 (1)使用 union 和 多个order by 不加括号 [报错] (2)order by 在 unio ...

  10. react系列-从0开始搭建一个react项目

    从0开始搭建一个react项目 1.安装脚手架 npm install -g create-react-app 2.创建项目 D: //进入D盘 mkdir ReactDemo //创建ReactDe ...