排查解决 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/

相关推荐
Chen放放4 小时前
【华三】VXLAN-三层集中式网关配置
运维·网络
碎梦归途4 小时前
思科网络设备配置命令大全,涵盖从交换机到路由器的核心配置命令
linux·运维·服务器·网络·网络协议·路由器·交换机
七维大脑虚拟机4 小时前
飞牛NAS公网IPv6+DDNS远程访问零延迟教程
运维·服务器·网络
小天源4 小时前
nginx在centos7上热升级步骤
linux·服务器·nginx
AZ996ZA5 小时前
自学linux第十八天:【Linux运维实战】系统性能优化与安全加固精要
linux·运维·安全·性能优化
大虾别跑5 小时前
OpenClaw已上线:我的电脑开始自己打工了
linux·ai·openclaw
weixin_437044646 小时前
Netbox批量添加设备——堆叠设备
linux·网络·python
hhy_smile6 小时前
Ubuntu24.04 环境配置自动脚本
linux·ubuntu·自动化·bash
一体化运维管理平台6 小时前
DevOps落地利器:美信监控易如何打通开发与运维?
运维
宴之敖者、6 小时前
Linux——\r,\n和缓冲区
linux·运维·服务器