排查解决 nvidia-suspend 导致的 linux 系统无响应/死机问题

文章目录

发现问题

ubuntu 系统一天内死机了 5 次, 物理表现为电源与风扇仍在运行, 但屏幕黑屏, 键鼠无响应, ssh 无法连上, 只能强制关机后重启

系统信息如下

sh 复制代码
Linux 5.8.0-59-generic #66~20.04.1-Ubuntu SMP Thu Jun 17 11:14:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
NVIDIA-SMI 570.172.08

排查问题

使用 last reboot 命令确定各次死机后重启的时间, 间接获取大概的死机时间

sh 复制代码
reboot   system boot  5.8.0-59-generic Fri Aug  1 17:19   still running
reboot   system boot  5.8.0-59-generic Fri Aug  1 15:55   still running
reboot   system boot  5.8.0-59-generic Fri Aug  1 14:23   still running
reboot   system boot  5.8.0-59-generic Fri Aug  1 13:44   still running
reboot   system boot  5.8.0-59-generic Fri Aug  1 11:43   still running

查看系统日志文件 /var/log/syslog /var/log/syslog.1 中死机时间前后的日志, 观察到规律, 每次死机前最后一段日志都是 nvidia-suspend.service 相关如下:

已知 systemd-suspend.service (可用 sudo systemctl suspend 命令手动触发) 会导致系统挂起, 表现为电源与风扇均在运转, 但键鼠无反应, 可通过按一下电源按钮唤醒

现在相信 "死机" 现象为 nvidia-suspend.service 触发的系统挂起现象, 搜索 linux nvidia suspend, 发现多个网页反馈 nvidia-suspend.service 引起的系统无响应问题, 至此问题基本确定

解决问题

sh 复制代码
# 禁用 nvidia suspend 相关服务
# 注意每次装新的 nvidia driver 后需重新禁用
sudo systemctl disable nvidia-suspend
sudo systemctl disable nvidia-hibernate
sudo systemctl disable nvidia-suspend-then-hibernate
reboot

查看相关服务是否已被禁用: systemctl list-unit-files | grep nvidia, 输出结果如下, 可见已成功禁用

sh 复制代码
nvidia-hibernate.service                                                  disabled        enabled
nvidia-powerd.service                                                     disabled        enabled
nvidia-resume.service                                                     enabled         enabled
nvidia-suspend-then-hibernate.service                                     disabled        enabled
nvidia-suspend.service                                                    disabled        enabled

后续持续观察是否还会出现系统无响应现象

参考链接

Tip for anyone having trouble with suspend/resume with NVIDIA: disable the NVIDIA systemd power management services, then reboot.
https://www.reddit.com/r/pop_os/comments/1hp90yy/tip_for_anyone_having_trouble_with_suspendresume/

相关推荐
bantinghy5 小时前
Linux系统TCP/IP网络参数优化
linux·网络·tcp/ip
星期天要睡觉5 小时前
Linux 综合练习
linux·运维·服务器
saynaihe5 小时前
proxmox8升级到proxmox9
linux·运维·服务器
Delphi菜鸟5 小时前
docker 部署RustDesk服务
运维·docker·容器
Orchestrator_me6 小时前
CentOS交换区处理
linux·运维·centos
zru_96026 小时前
centos 系统如何安装open jdk 8
java·linux·centos
FLS1686 小时前
VMwaer虚拟机安装完Centos后无法联网问题
linux·运维·centos
OctopusMonster6 小时前
centos下gdb调试python的core文件
linux·运维·centos
wanhengidc6 小时前
云手机可以息屏挂手游吗?
运维·网络·安全·游戏·智能手机
一只小白菜~6 小时前
实战记录:H3C路由器IS-IS Level-1邻居建立与路由发布
运维·网络·计算机网络·智能路由器