3
1

Ubuntu 20.04 + lightdm + NVIDIA driver で一定時間ログインしないと suspend する(解決策あり)

Last updated at Posted at 2020-11-30

環境

  • 一旦 Ubuntu Desktop(gdm3) をインストールしたのち, lightdm に切り替え
  • 2020/11/30 時点で apt update で最新になっている Ubuntu 20.04(20.04.1 LTS, 5.4.0-54-generic)
    • 2020/11/26 あたりから再現するっぽい?
  • lightdm
  • NVIDIA 455.45.01
    • RTX 3080 and GTX 1070

lightdm で一定時間ログインしないと, たとえ ssh ログインして GPGPU で GPU 使っていても一定時間(10 ~ 15 分くらい)で PC 全体が suspend(PC 全体が sleep) します.
(=> 電源ボタンやキーボード入力で復帰することもあるが, ハングしてしまうときもある)
CPU だけ使っていても生じます(apt 中に suspend したり).

Intel, AMD CPU 環境で同じように再現しました.
GPU は RTX 3080, GTX 1070 で再現しましたので, GPU 固有の問題ではありませんでした.

gdm3 では不明(x11vnc が gdm3 では使えないので, gdm3 に切り替えという選択肢が基本無い)

解決

@hiratch さまから解決方法をいただきました! ありがとうございます.

/etc/polkit-1/localauthority あたりに suspend と sleep を disable する設定すればいけました. 詳細はコメント欄参照ください.

追記: サイトが消えたようなので disable するには...

# /etc/polkit-1/localauthority/90-mandatory.d/disable-hibernate.pkla
[Disable hibernate (upower)]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=no
ResultInactive=no
ResultAny=no

[Disable hibernate (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=no

[Disable hibernate for all sessions (logind)]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate-multiple-sessions
ResultActive=no

こちらでもいいかも.

以下はとりあえず記録として残しておきます.

workaround

とりあえず一旦グラフィカルログインして gnome? desktop 表示すれば回避されます.

lightdm or NVIDIA driver のアップデートで解決すると思われますが...

gdm3 自動 suspend との関連?

gdm3 をインストールすると自動 suspend してしまうようなので, これとの関連が高そうです.

UbuntuServerにgdm3の環境を構築したら自動サスペンドするようになってしまった
https://qiita.com/_takeuchi_/items/7bbe6f79f5e524347b2b

Ubuntu,Debianの自動サスペンドの解除
https://qiita.com/ikesama200/items/f595293de82ddc9fa3f1

ただ,

sleep-inactive-ac-timeout=0
sleep-inactive-battery-timeout=0

を,

sudo -u lightdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0

などと設定しても解決には至りませんでした(また, もともと sleep-inactive-ac-timeout は 0 のまま)

lightdm 用にはなにか別の設定があるのかもしれません.

メモ

参考までに /etc/X11/xorg.conf の情報です.

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 455.45.01

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce RTX 3080"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "UseDisplayDevice" "DFP-0"
    Option         "Coolbits" "28"
    Option         "ConnectedMonitor" "DFP-0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
3
1
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1