Skip to content

Conversation

@itmo153277
Copy link

@itmo153277 itmo153277 commented Jul 29, 2025

Add some missing functions that are necessary for a proper GPU mode change.

Mode gsync (inverted) igpumode
dGPU 0 0
Hybrid 1 0
iGPU-only 1 1
Hybrid (auto) 1 2

To enable iGPU-only mode:

echo 1 > /sys/module/legion_laptop/drivers/platform\:legion/PNP0C09\:00/igpumode

# Wait for GPU to disappear
while lspci | grep -i nvidia &> /dev/null ; do
  echo 1 > /sys/module/legion_laptop/drivers/platform\:legion/PNP0C09\:00/notify_dgpu
  sleep 5
  # echo 1 > /sys/bus/pci/rescan
done
echo 0 > /sys/module/legion_laptop/drivers/platform\:legion/PNP0C09\:00/notify_dgpu

To go back to Hybrid mode:

echo 0 > /sys/module/legion_laptop/drivers/platform\:legion/PNP0C09\:00/igpumode

# Wait for GPU to appear
while ! lspci | grep -i nvidia &> /dev/null ; do
  echo 0 > /sys/module/legion_laptop/drivers/platform\:legion/PNP0C09\:00/notify_dgpu
  sleep 5
  echo 1 > /sys/bus/pci/rescan
done
echo 1 > /sys/module/legion_laptop/drivers/platform\:legion/PNP0C09\:00/notify_dgpu

Caveats:

  • prime-select should be set up correctly before changing modes
  • brightness in iGPU mode should be controlled by acpi_backlight=video, but in dGPU mode it does not work
  • changing modes requires reboot to fully work
  • hybrid-auto requires notify_dgpu to wake dGPU up and also requires rebooting the system

@itmo153277 itmo153277 marked this pull request as ready for review July 29, 2025 11:42
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.

1 participant