-
-
Notifications
You must be signed in to change notification settings - Fork 782
Add Lenovo ThinkPad P14s Intel Gen 2 #1509
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
Open
borja-rojo-ilvento
wants to merge
10
commits into
NixOS:master
Choose a base branch
from
borja-rojo-ilvento:lenovo-thinkpad-p14s-intel-gen2
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c7cf8e8
Add Lenovo ThinkPad P14s Intel Gen 2 profile
borja-rojo-ilvento 6be71ec
Veifying the need for modesetting.
borja-rojo-ilvento fd02b38
Remove the mkDefault which is overriding the defaults of the xserver …
borja-rojo-ilvento 67c7543
Revert "Remove the mkDefault which is overriding the defaults of the …
borja-rojo-ilvento c50ce85
Added README.
borja-rojo-ilvento c1905c1
Merge branch 'master' into lenovo-thinkpad-p14s-intel-gen2
borja-rojo-ilvento a3db716
Merge branch 'master' into lenovo-thinkpad-p14s-intel-gen2
borja-rojo-ilvento df2b210
Add back lenovo thinkpad p14s intel gen 2 to the module list
borja-rojo-ilvento 08b1a02
Merge remote-tracking branch 'upstream/master' into lenovo-thinkpad-p…
borja-rojo-ilvento 273a9ea
Merge remote-tracking branch 'upstream/master' into lenovo-thinkpad-p…
borja-rojo-ilvento 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,7 @@ | ||
# Lenovo ThinkPad P14s Intel Gen 2 | ||
|
||
Much of the extraneous settings are filled out using the [wiki](https://wiki.nixos.org/wiki/NVIDIA#Hybrid_graphics_with_PRIME), which gives guidance on how to determine the correct PCI bus IDs to assign, aswell as the note to include the `modesetting` driver in `services.xserver.videoDrivers`. | ||
|
||
## BIOS Settings to adjust | ||
|
||
For suspending to RAM to work, set Config -> Power -> Sleep State to "Linux S3" in EFI. |
This file contains hidden or 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,18 @@ | ||
{ | ||
imports = [ | ||
../../../../../common/gpu/nvidia/prime.nix | ||
../../../../../common/gpu/nvidia/turing | ||
../../../../../common/cpu/intel/tiger-lake | ||
../../../../../common/pc/laptop | ||
../../../../../common/pc/ssd | ||
../../../../../common/pc | ||
../. | ||
]; | ||
|
||
hardware.nvidia.prime = { | ||
intelBusId = "PCI:0:2:0"; | ||
nvidiaBusId = "PCI:1:0:0"; | ||
}; | ||
|
||
services.xserver.videoDrivers = [ "modesetting" ]; | ||
} |
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.
the cpu profile also includes gpu modules. I had it in my memories that the "modesettings" driver was included by default in xserver? That's why I dropped it for now. However please correct me on that in which case I would add this rather to the intel gpu profile than here.
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.
Ok, so I have done testing on this previous, and just double checked the effect of including or excluding
services.xserver.videoDrivers = [ "modesetting" ];
with your other changes. We can indeed exclude the redundant tiger-lake gpu module.Originally, I found that excluding it caused the computer to hang when changing into suspend mode. After lots of research, I understand that this has to do with the hand-off failing on systems with a discrete GPU, such as thing one. This is also noted in the wiki, here.
A quick
rg \"modesetting\'
call in the repo yeilds:So, it turns out that this isn't actually set. Ostensibly, this 'should be set at needed, implicitly', but reading the wiki, it seems that the 'modesetting' functionality requires different drivers depending on what CPU you have, either AMD or Intel. This means that the
common/gpu/nvidia/prime.nix
module which defines PRIME Offload needs to detect which CPU type you have, and include the correct driver accordingly. Or, a different solution that is CPU aware which I am not well-versed enough to design and implement...I believe, that although
services.xserver.videoDrivers
does include "modesetting", as per this options search, thecommon/gpu/nvidia/default.nix
module overrides this withservices.xserver.videoDrivers = lib.mkDefault [ "nvidia" ];
, so that the default now excludes "modesetting" and "fbdev".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.
As a follow-up, I'm going to see what happens if I change
services.xserver.videoDriver = mkDefault [ "nvidia" ];
toservices.xserver.videoDriver = [ "nvidia" ];
and see if Nix will just add the "nvidia" drivers, so I don't need to 'add back' the "modesetting" drivers.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.
That didn't seem to work. Suspend still breaks.
I am adding back in the
"modesetting"
driver. I'll add the link to the Wiki in the upcoming README for clarification.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 see. Probably a lot of our hybrid configurations are wrong than. I never had a device dual intel/nvidia so far.