You are not logged in.

#1 2023-10-09 11:07:16

MeanTeacher
Member
Registered: 2023-09-24
Posts: 13

How to preserve the session after suspend

Hi huys,I am using nvidia RTX3060Ti and hyprland with nvidia-dkms driver.I will type

systemctl suspend

in terminal emulator(kitty) in hyprland session to suspend.However,when I boot it after I came back to my pc,it will take me back to tty and I have to restart hyprland and all the software that were running won't be reserve.I hope that I can suspend it and when I turn back I can keep using my apps(such as browser and discord,telegram) without restart it.Thanks for your help!

Offline

#2 2023-10-09 12:28:48

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Offline

#3 2023-10-09 12:38:58

MeanTeacher
Member
Registered: 2023-09-24
Posts: 13

Re: How to preserve the session after suspend

Thanks for your reply! However,I didn't find the folder "/usr/share/doc/NVIDIA_GLX-1.0/" for the command

sudo install /usr/share/doc/NVIDIA_GLX-1.0/samples/systemd/nvidia-suspend.service /etc/systemd/system

in the document.There are only two folders "nvidia" and "nvidia-utils" under the folder "/usr/share/doc".Or am I understand the document in a wrong way?

Offline

#4 2023-10-09 16:00:03

loqs
Member
Registered: 2014-03-06
Posts: 18,859

Re: How to preserve the session after suspend

nvidia-utils supplies:

nvidia-utils usr/lib/systemd/system-sleep/nvidia
nvidia-utils usr/lib/systemd/system/nvidia-hibernate.service
nvidia-utils usr/lib/systemd/system/nvidia-powerd.service
nvidia-utils usr/lib/systemd/system/nvidia-resume.service
nvidia-utils usr/lib/systemd/system/nvidia-suspend.service

Offline

#5 2023-10-10 01:56:37

MeanTeacher
Member
Registered: 2023-09-24
Posts: 13

Re: How to preserve the session after suspend

loqs wrote:

nvidia-utils supplies:

nvidia-utils usr/lib/systemd/system-sleep/nvidia
nvidia-utils usr/lib/systemd/system/nvidia-hibernate.service
nvidia-utils usr/lib/systemd/system/nvidia-powerd.service
nvidia-utils usr/lib/systemd/system/nvidia-resume.service
nvidia-utils usr/lib/systemd/system/nvidia-suspend.service

Thanks for your reply! Which command should I run ? I have run

sudo install /usr/lib/systemd/system/nvidia-suspend.service /etc/systemd/system

and nothing changes

Offline

#6 2023-10-10 05:33:54

Ferdinand
Member
From: Norway
Registered: 2020-01-02
Posts: 338

Re: How to preserve the session after suspend

You don't need to install the unit files to /etc/systemd/system - the unit files installed by packages are meant to be in /usr/lib/systemd/system, and will be overwritten when the packages updates. /etc/systemd/system is for local unit files or customizations to the unit files provided by packages. See the wiki for more info.

I don't have anything from Nvidia myself, but from the information Seth linked to, I'd say you just need to enable the service files:

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

Except that may already have been done by the package when you installed. You can check that using "status" instead of "enable" with systemctl.

I don't know what's with the nvidia-powerd.service, and it seems to be a bit short on info, but according to https://forums.developer.nvidia.com/t/4 … erd/164099 and https://forums.developer.nvidia.com/t/n … art/235498, I don't think you need it.

Offline

#7 2023-10-10 06:30:33

MeanTeacher
Member
Registered: 2023-09-24
Posts: 13

Re: How to preserve the session after suspend

Ferdinand wrote:

You don't need to install the unit files to /etc/systemd/system - the unit files installed by packages are meant to be in /usr/lib/systemd/system, and will be overwritten when the packages updates. /etc/systemd/system is for local unit files or customizations to the unit files provided by packages. See the wiki for more info.

I don't have anything from Nvidia myself, but from the information Seth linked to, I'd say you just need to enable the service files:

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

Except that may already have been done by the package when you installed. You can check that using "status" instead of "enable" with systemctl.

I don't know what's with the nvidia-powerd.service, and it seems to be a bit short on info, but according to https://forums.developer.nvidia.com/t/4 … erd/164099 and https://forums.developer.nvidia.com/t/n … art/235498, I don't think you need it.

Thanks for your reply! However,I have run

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

and it still won't reserve my session. Am I missing something?

Offline

#8 2023-10-10 06:39:11

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Re: How to preserve the session after suspend

nvidia wrote:

Additionally, to unlock the full functionality of the interface, the NVIDIA Linux kernel module needs to be loaded with the NVreg_PreserveVideoMemoryAllocations=1 module parameter. This changes the default video memory save/restore strategy to save and restore all video memory allocations.

Make sure you applied it w/ "systool -vm nvidia".

Also just enabling the services w/o "--now" doesn't do anything until the next reboot.

Offline

#9 2023-10-10 07:56:43

MeanTeacher
Member
Registered: 2023-09-24
Posts: 13

Re: How to preserve the session after suspend

seth wrote:
nvidia wrote:

Additionally, to unlock the full functionality of the interface, the NVIDIA Linux kernel module needs to be loaded with the NVreg_PreserveVideoMemoryAllocations=1 module parameter. This changes the default video memory save/restore strategy to save and restore all video memory allocations.

Make sure you applied it w/ "systool -vm nvidia".

Also just enabling the services w/o "--now" doesn't do anything until the next reboot.

Where should I add "NVreg_PreserveVideoMemoryAllocations=1" and what is kernel module parameter?

Offline

#10 2023-10-10 12:26:59

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,307

Offline

Board footer

Powered by FluxBB