-
-
Notifications
You must be signed in to change notification settings - Fork 653
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
Mydien27
wants to merge
17
commits into
NixOS:master
Choose a base branch
from
Mydien27:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Adding support for ga403 #1255
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f8b9bfe
modified nvidia services to allow for combination sleep/suspend
51de9fe
added zephyrus g14 (2024) - ga403
ce8601a
fixed layout
8ac932b
fixed paths and forced video drivers
f35e440
added ga403 import to flake.nix
206781a
Merge branch 'NixOS:master' into master
Mydien27 8b2e64c
added GA403 to readme
a0c7098
Merge branch 'master' of https://github.com/Mydien27/nixos-hardware
2aabc0a
Merge branch 'NixOS:master' into master
Mydien27 53e832b
modified nvidia services to allow for combination sleep/suspend
babed36
added zephyrus g14 (2024) - ga403
5198cf6
Fixed formatting error
162f8ac
Removed per Mic92's suggestion
73dcf6a
Merge branch 'master' of https://github.com/Mydien27/nixos-hardware
1a78f94
Merge branch 'NixOS:master' into master
Mydien27 328f218
removed acpi_call.nix
64bb927
added note about kernel version
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
config, | ||
pkgs, | ||
lib, | ||
... | ||
}: | ||
|
||
let | ||
inherit (lib) | ||
mkDefault | ||
mkForce | ||
; | ||
in | ||
{ | ||
|
||
imports = [ | ||
../../../common/cpu/amd | ||
../../../common/cpu/amd/pstate.nix | ||
../../../common/gpu/amd | ||
../../../common/pc/laptop | ||
../../../common/pc/ssd | ||
../../../common/gpu/nvidia/prime.nix | ||
../../../common/gpu/nvidia/ada-lovelace | ||
]; | ||
|
||
config = { | ||
# Configure basic system settings: | ||
boot = { | ||
# Note: it seems being on the latest kernel is important for CPPC to work, which is required for the amd_pstate | ||
# https://bugzilla.kernel.org/show_bug.cgi?id=218686 | ||
kernelPackages = mkDefault pkgs.linuxPackages_latest; | ||
kernelModules = [ "kvm-amd" ]; | ||
kernelParams = [ | ||
"mem_sleep_default=deep" | ||
"pcie_aspm.policy=powersupersave" | ||
]; | ||
}; | ||
|
||
services = { | ||
asusd = { | ||
enable = mkDefault true; | ||
enableUserService = mkDefault true; | ||
}; | ||
|
||
supergfxd.enable = mkDefault true; | ||
}; | ||
|
||
# Enable the Nvidia card, as well as Prime and Offload: NVIDIA GeForce RTX 4060 Mobile | ||
boot.blacklistedKernelModules = [ "nouveau" ]; | ||
|
||
services.xserver.videoDrivers = mkForce [ | ||
"amdgpu" | ||
"nvidia" | ||
]; | ||
|
||
hardware = { | ||
amdgpu.initrd.enable = mkDefault true; | ||
|
||
nvidia = { | ||
modesetting.enable = true; | ||
nvidiaSettings = mkDefault true; | ||
|
||
prime = { | ||
offload = { | ||
enable = mkDefault true; | ||
enableOffloadCmd = mkDefault true; | ||
}; | ||
amdgpuBusId = "PCI:101:0:0"; | ||
nvidiaBusId = "PCI:1:0:0"; | ||
}; | ||
|
||
powerManagement = { | ||
enable = true; | ||
finegrained = true; | ||
}; | ||
}; | ||
}; | ||
# Meditek doesn't seem to be quite sensitive enough on the default roaming settings: | ||
# https://wiki.archlinux.org/title/Wpa_supplicant#Roaming | ||
# https://wiki.archlinux.org/title/Iwd#iwd_keeps_roaming | ||
# | ||
# But NixOS doesn't have the tweaks for IWD, yet. | ||
networking.wireless.iwd.settings = | ||
lib.mkIf (config.networking.wireless.iwd.enable && config.networking.wireless.scanOnLowSignal) | ||
{ | ||
General = { | ||
RoamThreshold = -75; | ||
RoamThreshold5G = -80; | ||
RoamRetryInterval = 20; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this something the service should do in general or just for this gpu generation?
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.
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?