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

Nvidia powermanagement not working on sway #383

Open
tlater-famedly opened this issue Jan 20, 2025 · 1 comment
Open

Nvidia powermanagement not working on sway #383

tlater-famedly opened this issue Jan 20, 2025 · 1 comment

Comments

@tlater-famedly
Copy link
Collaborator

The relevant power setting isn't set to auto by the udev rules for some reason: https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/modules/hardware/video/nvidia.nix#L641

I suspect this is because the driver isn't actually bound, since wlroots doesn't actually use the nvidia driver at all if started with the correct WLR_DRM_DEVICES env var. If so, this is a lil' silly, since that would mean with these rules the GPU draws power only if it isn't in use. Buuut I need to brush up on my udev knowledge before telling nvidia they're wrong.

@tlater-famedly
Copy link
Collaborator Author

tlater-famedly commented Jan 20, 2025

Some extra hints for future self. To check if the GPU is currently suspended, check if this increments (not for all nvidia gpus, but certainly the one I have access to):

$ while sleep 1; do cat /sys/bus/pci/devices/0000:01:00.0/power/runtime_suspended_time; done

To enable powermanagement for the GPU (see also):

# echo 'auto' > /sys/bus/pci/devices/0000:01:00.0/power/control

To actually offload to the dGPU (even on wlroots), see the nvidia docs

tlater-famedly added a commit that referenced this issue Jan 20, 2025
Turns out that:

- The usual env variables make everything use nvidia even if it
  shouldn't (duh)
- To use a non-default GPU on wlroots, use `$WLR_DRM_DEVICES`
  - On my current testbed the default GPU happens to be nvidia, see
    sway docs on how to handle this elsewhere
- Using unstable nixpkgs in nixpkgs-wayland can cause issues with
  drivers

Still need to confirm if the addition of `"amdgpu"` to the
`videoDrivers` list is actually necessary, and figure out how to
ensure that powermanagement is actually turned on, see #383.

*Then* set up a good offload script, also see #383 for hints.
tlater-famedly added a commit that referenced this issue Jan 22, 2025
Turns out that:

- The usual env variables make everything use nvidia even if it
  shouldn't (duh)
- To use a non-default GPU on wlroots, use `$WLR_DRM_DEVICES`
  - On my current testbed the default GPU happens to be nvidia, see
    sway docs on how to handle this elsewhere
- Using unstable nixpkgs in nixpkgs-wayland can cause issues with
  drivers

Still need to confirm if the addition of `"amdgpu"` to the
`videoDrivers` list is actually necessary, and figure out how to
ensure that powermanagement is actually turned on, see #383.

*Then* set up a good offload script, also see #383 for hints.
tlater-famedly added a commit that referenced this issue Jan 22, 2025
Turns out that:

- The usual env variables make everything use nvidia even if it
  shouldn't (duh)
- To use a non-default GPU on wlroots, use `$WLR_DRM_DEVICES`
  - On my current testbed the default GPU happens to be nvidia, see
    sway docs on how to handle this elsewhere
- Using unstable nixpkgs in nixpkgs-wayland can cause issues with
  drivers

Still need to confirm if the addition of `"amdgpu"` to the
`videoDrivers` list is actually necessary, and figure out how to
ensure that powermanagement is actually turned on, see #383.

*Then* set up a good offload script, also see #383 for hints.
tlater-famedly added a commit that referenced this issue Jan 22, 2025
Turns out that:

- The usual env variables make everything use nvidia even if it
  shouldn't (duh)
- To use a non-default GPU on wlroots, use `$WLR_DRM_DEVICES`
  - On my current testbed the default GPU happens to be nvidia, see
    sway docs on how to handle this elsewhere
- Using unstable nixpkgs in nixpkgs-wayland can cause issues with
  drivers

Still need to confirm if the addition of `"amdgpu"` to the
`videoDrivers` list is actually necessary, and figure out how to
ensure that powermanagement is actually turned on, see #383.

*Then* set up a good offload script, also see #383 for hints.
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

No branches or pull requests

1 participant