Skip to content

Instantly share code, notes, and snippets.

@lrvick
Last active April 5, 2023 05:02
Show Gist options
  • Save lrvick/ca754ddfd8d4201d9cac793fc97b3754 to your computer and use it in GitHub Desktop.
Save lrvick/ca754ddfd8d4201d9cac793fc97b3754 to your computer and use it in GitHub Desktop.
GPD Win Max 2 - QubesOS

GPD Win Max 2 - QubesOS 4.1

Firmware Settings

  1. Get to firmware settings by tapping "Del" while booting
  2. Alt+F5 then reboot and return to firmware settings to get secondary "Advanced" menu
  3. Advanced -> CPU Configuration -> SVM Mode -> Enabled
  4. Advanced -> PCI Subsystem Settings -> SR-IOV Support -> Enabled
  5. Advanced -> AMD CBS -> NBIO Common Options -> IOMMU -> Enabled

Boot issues

  • Must set x2apic=false in xen*.gz grub line during install
  • In dom0: echo 'GRUB_CMDLINE_XEN_DEFAULT="$GRUB_CMDLINE_XEN_DEFAULT x2apic=false"'

Wifi Issues

  • Must use usb ethernet or wifi after install to apply updates
  • Switch to kernel-latest (6x or newer)

USB issues

External USB ports are unable to resume after usbcore suspends them. To avoid losing the ports on a given boot, we must prevent dom0 from seeing the usb controllers, then ensure the kernel inside the sys-usb templatevm disables usbcore autosuspend functionality.

  • Create 'sys-usb' qube, adding all USB PCI controllers manually
    • Below assumes debian-11 is used
    • Ensure it does -not- start on boot until it is confirmed working
  • In dom0:
    echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX rd.qubes.hide_all_usb"'
    grub2-mkconfig -o /boot/efi/EFI/qubes.cfg
    
  • In sys-usb template VM:
    echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX usbcore.autosuspend=-1"'
    grub-mkconfig -o /boot/grub/grub.cfg
    

Suspend issues

This is currently not working. Here is what we know so far.

Suspend to idle

  • Sleep:
    • echo freeze > /sys/power/state
    • screen turns off
    • power led still on
    • keyboard backlight still on
  • Wake:
    • Unresponsive
    • Must hard reset

Suspend to ram

  • Sleep:
    • echo mem > /sys/power/state
    • screen turns off
    • power led pulses
    • keyboard backlight turns off
  • Wake:
    • keyboard backlight turns on
    • power led goes solid
    • Unresponsive
    • Must hard reset

Suspend to disk

  • Sleep:
    • echo disk > /sys/power/state
    • "bash: echo: write error: function not implemented"
  • Wake:
    • N/A

Debug attempts

  • mem_sleep_default=deep in kernel cmdline
    • no impact
  • Advanced -> AMD PBS -> Power Saving Configurations -> Modern Standby Enable
    • had no impact
    • A lot of other options in this menu are potentially of interest

Debug todo

  • Start disabling XCHI devices one by one
    • echo XHC1 > /proc/acpi/wakeup
      • One owner reported this stopped machine from instantly waking after a suspend on Ubuntu.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment