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

相关推荐
姜太小白7 小时前
【Linux】df -h 卡住问题的通用排查与解决方案总结
linux·运维·php
土星云SaturnCloud8 小时前
抽水蓄能设备智慧运营:基于土星云边缘计算实现机组全生命周期预测性维护
服务器·人工智能·ai·边缘计算
fengyehongWorld8 小时前
Linux 终端快捷键
linux·运维
hyf3266339 小时前
泛程序:从零开始搭建稳定程序项目框架
运维·服务器·爬虫·百度·seo
哎呦喂我去去去9 小时前
C#实现屏幕墙:同时监控多个电脑桌面(支持Windows、信创Linux、银河麒麟、统信UOS)
linux·windows·c#
为自己_带盐9 小时前
安敢越雷池一步?浅尝雷池WAF社区版
运维·web安全
NiceCloud喜云9 小时前
海外云服务器怎么选?适用场景、价格和避坑经验总结
运维·服务器
easy_coder10 小时前
Linux LVM 知识文档
linux·运维
小小的木头人11 小时前
Ubuntu 使用 udev + systemd + UUID 实现 USB 硬盘自动挂载
linux·运维·ubuntu
布鲁飞丝12 小时前
彩笔运维勇闯机器学习--cpu与qps的线性关系
运维·人工智能·机器学习