debian&ubuntu的nvidia驱动升级

背景

给出的机器的驱动版本不符合要求,使用自定义的驱动版本。

前置

如果使用nvidia官方的.run安装的驱动包,可以使用系统自带的nvidia-uninstall命令卸载比较方便,不建议使用apt pruge nvidia-*命令删除。会带来其他的问题。

卸载完成之后重启一下机器,验证两个问题

  1. 没有软件使用nvida-driver
  2. 内核模块没有被加载

否则后面安装会有一些报错

验证

bash 复制代码
lsof /dev/nvidia*

把正在使用nvidia的软件停止或者卸载。

bash 复制代码
lsmod |grep nvidia

预期结果:输出为空。

如果不是空,比如下面这种输出,确认没有软件使用nvidia之后,重启一下系统。手动使用rmmod module_name删除内核模块不推荐。

bash 复制代码
nvidia_uvm           1511424  0
nvidia_drm             90112  0
nvidia_modeset       1331200  1 nvidia_drm
drm_kms_helper        217088  4 cirrus,nvidia_drm
nvidia              56201216  2 nvidia_uvm,nvidia_modeset
drm                   548864  5 drm_kms_helper,nvidia,cirrus,nvidia_drm

安装

从官网下载.run的驱动包,赋予执行权限,安装。

遇到的报错

ERROR: An NVIDIA kernel module 'nvidia-uvm' appears to already be loaded in your kernel. This may be because it is in use (for example, by an X server, a CUDA program, or the NVIDIA Persistence Daemon), but this may also happen if your kernel was configured without support for module unloading. Please be sure to exit any programs that may be using the GPU(s) before attempting to upgrade your driver. If no GPU-based programs are running, you know that your kernel supports module unloading, and you still receive this message, then an error may have occurred that has corrupted an NVIDIA kernel module's usage count, for which the simplest remedy is to reboot your computer.

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.

The nvidia-installer program was found on this system. This is probably left over from an earlier installation of the non-free NVIDIA graphics driver, installed using the NVIDIA *.run file directly. This installation is incompatible with the Debian packages. To install the Debian packages safely, it is therefore necessary to undo the changes performed by nvidia-installer

apt安装时报错FCAE110B1118213C没有这个key

bash 复制代码
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FCAE110B1118213C

refer

nvidia驱动下载地址

https://www.nvidia.com/Download/index.aspx?lang=en-us

驱动文档

https://docs.nvidia.com/datacenter/tesla/index.html

相关推荐
代码游侠7 分钟前
学习笔记——ESP8266 WiFi模块
服务器·c语言·开发语言·数据结构·算法
Hello.Reader10 分钟前
PyFlink Configuration 一次讲透怎么配、配哪些、怎么“调得快且稳”
运维·服务器·python·flink
__雨夜星辰__11 分钟前
VMware 17 下 Ubuntu 虚拟机与宿主机间复制粘贴失效问题
linux·运维·ubuntu
云和数据.ChenGuang12 分钟前
Uvicorn 是 **Python 生态中用于运行异步 Web 应用的 ASGI 服务器**
服务器·前端·人工智能·python·机器学习
prettyxian14 分钟前
【linux】进程调度:优先级、时间片与O(1)算法
linux·运维·服务器
__雨夜星辰__15 分钟前
VS Code 的Remote-SSH/Remote Development插件无法连接到 Ubuntu 系统下 的远程虚拟主机(VMware)
运维·vscode·ubuntu·ssh
2401_8658548821 分钟前
16核32g的服务器能运用于哪些场景
运维·服务器
浅安的邂逅23 分钟前
ubuntu 18.04及以上版本配置静态IP方法
linux·运维·网络·ubuntu·ip设置
不会c嘎嘎25 分钟前
QT中的常用控件(五)
服务器·开发语言·qt
阿巴~阿巴~25 分钟前
从钓鱼到高性能服务器:深入解析操作系统五大 I/O 模型
运维·服务器·网络·系统调用·五种i/o模型