Skip to content
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

Adding support for ga403 #1255

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

Adding support for ga403 #1255

wants to merge 17 commits into from

Conversation

Mydien27
Copy link

@Mydien27 Mydien27 commented Nov 18, 2024

Description of changes
  • Added zephyrus G14 2024 support (ga403)
  • NOTE: my model is specifically the ga403UV
  • heavily based on the 402x due to hardware similarity
  • Forced the use of nvidia and amd video drivers (the one set in the common nvidia module prevent the display manager from starting see Asus ga401 broken #689)
  • Modified nvidia sleep/hibernate/resume services to trigger on systemctl suspend-then-hibernate and hybrid-sleep (otherwise the gpu does not suspend and prevents sleep/hibernation)
Things done
  • Tested the changes in your own NixOS Configuration
  • Tested the changes end-to-end by using your fork of nixos-hardware and
    importing it via <nixos-hardware> or Flake input

flake.nix Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@@ -7,4 +7,22 @@ in

# enable the open source drivers if the package supports it
hardware.nvidia.open = lib.mkOverride 990 (nvidiaPackage ? open && nvidiaPackage ? firmware);

# nvidia's hibernate, suspend, and resume services are not normally triggered on suspend-then-hibernate and hybrid-hibernate
Copy link
Member

@Mic92 Mic92 Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something the service should do in general or just for this gpu generation?

Copy link
Author

@Mydien27 Mydien27 Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that has to do with nvidia's services to suspend and resume the graphics card. If you read the service file from the driver, you will notice it triggers on the normal suspend/hibernate/resume systemd services, but not the "special" ones such as suspend-then-hibernate or hybrid-sleep. The normal options will work, but this causes the card to fail in the special modes with:
PM: pci_pm_suspend(): nv_pmops_suspend+0x0/0x30 [nvidia] returns -5
PM: dpm_run_callback(): pci_pm_suspend+0x0/0x170 returns -5
nvidia 0000:07:00.0: PM: failed to suspend: error -5
PM: Some devices failed to suspend, or early wake event detected

See here for issue discussion: https://forums.developer.nvidia.com/t/nvidia-laptop-unable-to-suspend/221788/10
See here for solution: https://forums.developer.nvidia.com/t/systemds-suspend-then-hibernate-not-working-in-nvidia-optimus-laptop/213690

I was hesitant to add it to the common/gpu/nvidia/default.nix since I did not want to break something I was unaware of. I believe I have read it is not an issue on older nvidia GPUs. However, I know this is an issue with the nvidia services, not just the Zephyrus and have had similar problems on my Surface Book 3 (1660 Ti Max-Q). Perhaps it should live in common/gpu/nvidia/default.nix and check the driver version or as an option with a default of false?

@Mydien27
Copy link
Author

Mydien27 commented Dec 3, 2024

I apologize for the silly mistakes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants