-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed suspend in nvidia and hybrid mode #127
Conversation
I had suspend not working on nvidia and hybrid mods after I added to envycontrol settings for nvidia from https://github.com/CachyOS/CachyOS-Settings everything worked.
I wonder if removing
prevents Gnome Wayland from showing up |
As far as I know it defaults to 1, but I'll check that tomorrow and report back |
Oh, a little off-topic pr but I'll write here anyway, I talked to someone who tweaks Nvidia for CachyOS about the fact that they include rtd3 by default on all cards including those that are not supported, referring to you I wrote that this is not a good practice, to which I replied that in Fedora also in the default drivers is rtd3 and no one has complained about the problem of power saving, so you have faq error rtd3 can be enabled on older cards before Turing nothing will happen. |
It also seems to me that you can remove the disabling of usb devices because since the kernel version 5.5 they work normally, and now even on lts kernel like 5.15 so it is not to the point |
@bayasdev I take it because my pr hides Wayland session in GDM you will not add it ? It's just that you haven't contacted me for a whole day, then I guess pr can be closed ? |
If you're still going to take the pr I'll tweak it a bit, because even though Nvidia's website says that since kernel 5.5 all disable devices work fine with dynamic power management I've had my computer freeze during tests without disabling these devices, I guess I was too hasty in removing their disablement. |
Is this on AMD + Nvidia? Cause I'm having issues on hybrid mode when waking up from sleep. I'm getting errors |
I've only tested with intel + Nvidia, whether this fix will help you I don't know, but you can always grab envycontrol from my repository and try it out |
@Boria138 sadly I don't own any Nvidia hardware newer than Pascal so I'm unable to test your changes. Those Udev rules come from the official Nvidia docs through. |
I've already returned the rules back as without them there were freezes, which is strange because on the Nvidia website it is written that the drivers work normally with kernel 5.5, but no matter I returned it and also removed nvidia-uvm as specifically to manage hybrid graphics it is not needed, it only fixes the error in plymouth. |
PR is ready and tested, I'd also like to ask @pingarelho to do a test as I only have intel and haven't checked if this will fix the sleep when using amd |
@Boria138 also add a try catch block around the calls to subprocess.run where you toggle the systemd unit as it may fail on systems that use other init system |
@bayasdev review my code please |
@Boria138 thanks, will test later after I get access to my gaming laptop. So far it looks good. |
@Boria138 will gladly test that for you when I have time! today or tomorrow I'll post an update here. |
Can confirm that this PR fixes waking up from sleep on my Ryzen 5 4600H + GTX 1650 laptop in hybrid mode with rtd3. Awesome. |
@bayasdev I already wrote it above but I will repeat in the faq you wrote that using rtd3 on unsupported hardware increases battery consumption which is probably not true because first of all at the moment rtd3 is completely broken and therefore you could not make correct measurements secondly this feature is enabled by default at least in Fedora and Manjaro I have not noticed any complaints from owners of unsupported hardware so could you do the test again with my corrections so as not to mislead people if you are really wrong ? |
@@ -207,6 +217,15 @@ def graphics_mode_switcher(graphics_mode, user_display_manager, enable_force_com | |||
f"Enable PCI-Express Runtime D3 (RTD3) Power Management: {rtd3_value or False}") | |||
cleanup() | |||
|
|||
if logging.getLogger().level == logging.DEBUG: | |||
service = subprocess.run(["systemctl", "enable", "nvidia-persistenced.service"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of using nvidia-persistenced? It doesn't bring any improvements for PRIME setups. Nvidia-persistenced only makes sense for headless computational graphics setups, i.e. without a running X session. This does not affect the operation of RTD3 in any way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before adding the inclusion of nvidia-persistent I ran some tests and without this service enabled the total system consumption was higher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw no change on my system with AMD iGPU + 3050 Mobile when enabling nvidia-persistenced. Can you provide steps to reproduce the powerdown along with nvidia-persistenced? Just FYI that nvidia-persistenced, according to the source code, does nothing related to GPU power managment other than disabling NUMA memory blocks used by CUDA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe in your case nothing has changed since you have amd I have done tests on Nvidia + Intel bundle and with the service enabled the total system consumption which I looked through upower was lower by several watts to make sure that it is not a trivial error I have done these tests several times and the consumption was always lower with this service than without it.
I had suspend not working on nvidia and hybrid mods after I added to envycontrol settings for nvidia from https://github.com/CachyOS/CachyOS-Settings everything worked.