NVIDIA 驱动程序更新后,Ubuntu 立即从睡眠状态唤醒

NVIDIA 驱动程序更新后,Ubuntu 立即从睡眠状态唤醒

我之前使用的是 Nouveau X.org 显卡驱动程序,但今天我从 Ubuntu 中的“附加驱动程序”程序将驱动程序更改为 nvidia-driver-470(专有且经过测试)。一切都很好,只是每当我挂起笔记本电脑时,它都会立即自动唤醒。

以下是以下命令的输出:

journalctl -b | grep suspend

输出是

Sep 24 22:26:38 minaHP ModemManager[1527]: <info>  [sleep-monitor] system is about to suspend
Sep 24 22:26:39 minaHP systemd[1]: Starting NVIDIA system suspend actions...
Sep 24 22:26:39 minaHP suspend[518255]: nvidia-suspend.service
Sep 24 22:26:39 minaHP logger[518255]: <13>Sep 24 22:26:39 suspend: nvidia-suspend.service
Sep 24 22:26:39 minaHP systemd[518256]: nvidia-suspend.service: Failed to execute command: No such file or directory
Sep 24 22:26:39 minaHP systemd[518256]: nvidia-suspend.service: Failed at step EXEC spawning /usr/bin/nvidia-sleep.sh: No such file or directory
Sep 24 22:26:39 minaHP systemd[1]: nvidia-suspend.service: Main process exited, code=exited, status=203/EXEC
Sep 24 22:26:39 minaHP systemd[1]: nvidia-suspend.service: Failed with result 'exit-code'.
Sep 24 22:26:39 minaHP systemd[1]: Failed to start NVIDIA system suspend actions.
Sep 24 22:26:39 minaHP systemd[1]: suspend.target: Job suspend.target/start failed with result 'dependency'.
Sep 24 22:26:39 minaHP systemd[1]: systemd-suspend.service: Job systemd-suspend.service/start failed with result 'dependency'.
Sep 24 22:26:39 minaHP suspend[518257]: nvidia-resume.service
Sep 24 22:26:39 minaHP logger[518257]: <13>Sep 24 22:26:39 suspend: nvidia-resume.service

如果有人能告诉我如何在不将驱动程序改回 Nouveau 的情况下解决这个问题,那就太好了。

如果有帮助的话,这是另一个命令及其输出

mina@minaHP:~$ systemctl status nvidia-suspend nvidia-hibernate nvidia-resume
● nvidia-suspend.service - NVIDIA system suspend actions
     Loaded: loaded (/lib/systemd/system/nvidia-suspend.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2021-09-24 22:26:39 EET; 12min ago
    Process: 518255 ExecStart=/usr/bin/logger -t suspend -s nvidia-suspend.service (code=exited, status=0/SUCCESS)
    Process: 518256 ExecStart=/usr/bin/nvidia-sleep.sh suspend (code=exited, status=203/EXEC)
   Main PID: 518256 (code=exited, status=203/EXEC)

Sep 24 22:26:39 minaHP systemd[1]: Starting NVIDIA system suspend actions...
Sep 24 22:26:39 minaHP suspend[518255]: nvidia-suspend.service
Sep 24 22:26:39 minaHP logger[518255]: <13>Sep 24 22:26:39 suspend: nvidia-suspend.service
Sep 24 22:26:39 minaHP systemd[518256]: nvidia-suspend.service: Failed to execute command: No such file or directory
Sep 24 22:26:39 minaHP systemd[518256]: nvidia-suspend.service: Failed at step EXEC spawning /usr/bin/nvidia-sleep.sh: No such file or directory
Sep 24 22:26:39 minaHP systemd[1]: nvidia-suspend.service: Main process exited, code=exited, status=203/EXEC
Sep 24 22:26:39 minaHP systemd[1]: nvidia-suspend.service: Failed with result 'exit-code'.
Sep 24 22:26:39 minaHP systemd[1]: Failed to start NVIDIA system suspend actions.

● nvidia-hibernate.service - NVIDIA system hibernate actions
     Loaded: loaded (/lib/systemd/system/nvidia-hibernate.service; enabled; vendor preset: enabled)
     Active: inactive (dead)

● nvidia-resume.service - NVIDIA system resume actions
     Loaded: loaded (/lib/systemd/system/nvidia-resume.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2021-09-24 22:26:39 EET; 12min ago
    Process: 518257 ExecStart=/usr/bin/logger -t suspend -s nvidia-resume.service (code=exited, status=0/SUCCESS)
    Process: 518258 ExecStart=/usr/bin/nvidia-sleep.sh resume (code=exited, status=203/EXEC)
   Main PID: 518258 (code=exited, status=203/EXEC)

Sep 24 22:26:39 minaHP systemd[1]: Starting NVIDIA system resume actions...
Sep 24 22:26:39 minaHP suspend[518257]: nvidia-resume.service
Sep 24 22:26:39 minaHP logger[518257]: <13>Sep 24 22:26:39 suspend: nvidia-resume.service
Sep 24 22:26:39 minaHP systemd[518258]: nvidia-resume.service: Failed to execute command: No such file or directory
Sep 24 22:26:39 minaHP systemd[518258]: nvidia-resume.service: Failed at step EXEC spawning /usr/bin/nvidia-sleep.sh: No such file or directory
Sep 24 22:26:39 minaHP systemd[1]: nvidia-resume.service: Main process exited, code=exited, status=203/EXEC
Sep 24 22:26:39 minaHP systemd[1]: nvidia-resume.service: Failed with result 'exit-code'.
Sep 24 22:26:39 minaHP systemd[1]: Failed to start NVIDIA system resume actions.

答案1

出现这些错误是因为你必须安装NVIDIA-{暂停/休眠/恢复} 服务

像这样:

sudo install /usr/share/doc/NVIDIA_GLX-1.0/samples/systemd/nvidia-suspend.service /etc/systemd/system
sudo install /usr/share/doc/NVIDIA_GLX-1.0/samples/systemd/nvidia-hibernate.service /etc/systemd/system
sudo install /usr/share/doc/NVIDIA_GLX-1.0/samples/systemd/nvidia-resume.service /etc/systemd/system
sudo install /usr/share/doc/NVIDIA_GLX-1.0/samples/systemd/nvidia /lib/systemd/system-sleep
sudo install /usr/share/doc/NVIDIA_GLX-1.0/samples/systemd/nvidia-sleep.sh /usr/bin

systemd然后需要启用NVIDIA服务:

sudo systemctl enable nvidia-suspend.service
sudo systemctl enable nvidia-hibernate.service
sudo systemctl enable nvidia-resume.service

重新安装 NVIDIA 驱动程序应该有帮助。

相关内容