From Fedora Project Wiki

Description

This test case tests that power management of hybrid graphics systems works correctly - i.e., the secondary GPU is kept powered down when not being used.

When to run this test
It is only useful and valid to run this test case if you have outputs attached to more than one of the system's display adapters. If you are taking part in a Test Day, the switchcheck script should have told you whether or not to run this test. Otherwise, you can run xrandr --listproviders and check the output: only run this test if it shows more than one provider with more than 0 'outputs'.

Setup

  1. Clean boot the system, with no video-related kernel parameters or custom configuration, and no external displays connected to start with

How to test

  1. Run sudo cat /sys/kernel/debug/vgaswitcheroo/switch
  2. For each external output you have the appropriate cables to connect a display to:
    1. Connect a display
    2. Run sudo cat /sys/kernel/debug/vgaswitcheroo/switch again
    3. Disconnect the display
    4. Wait 15 seconds and run sudo cat /sys/kernel/debug/vgaswitcheroo/switch again

Expected Results

Reading Switcheroo output
Each time you run sudo cat /sys/kernel/debug/vgaswitcheroo/switch, you should see output something like:

0:IGD:+:Pwr:0000:00:02.0 1:DIS: :DynOff:0000:01:00.0

This is two entries, one starting with 0:, the other with 1:. The secondary GPU (the more powerful one) should always be the second entry. The power status is indicated by the third field in each entry. In this example, it's Pwr for the first entry, and DynOff for the second entry. This power status is the thing we're interested in every time.
  1. When you first check the output, with no external displays connected, the power status for the secondary GPU should be DynOff
  2. When you connect a display to the secondary GPU and check the output, the power status for the secondary GPU should change to DynPwr
    • Unfortunately it's difficult to tell which outputs are connected to which adapters; checking when the power status changes is actually one of the best ways to tell which adapter the output is connected to. It is possible that none of the outputs is connected to the secondary GPU and so the state will never change to DynPwr. If you test all the outputs you can and they all work but the state stays as DynOff throughout, that's OK: this is still a 'pass'.
  3. If you do find an output connected to the secondary GPU, then after you disconnect the display from it, wait 15 seconds, and check the output again, the power status for the secondary GPU should change back to DynOff