In this mode of use, the file /sys/kernel/debug/vgaswitcheroo/switch can be read to retrieve the current vga_switcheroo state and commands can be written to it to change the state. The file appears as soon as two GPU drivers and one handler have registered with vga_switcheroo. The following commands are understood:
* OFF: Power off the device not in use. * ON: Power on the device not in use. * IGD: Switch to the integrated graphics device. Power on the integrated GPU if necessary, power off the discrete GPU. Prerequisite is that no user space processes (e.g. Xorg, alsactl) have opened device files of the GPUs or the audio client. If the switch fails, the user may invoke lsof(8) or fuser(1) on /dev/dri/ and /dev/snd/controlC1 to identify processes blocking the switch. * DIS: Switch to the discrete graphics device. * DIGD: Delayed switch to the integrated graphics device. This will perform the switch once the last user space process has closed the device files of the GPUs and the audio client. * DDIS: Delayed switch to the discrete graphics device. * MIGD: Mux-only switch to the integrated graphics device. Does not remap console or change the power state of either gpu. If the integrated GPU is currently off, the screen will turn black. If it is on, the screen will show whatever happens to be in VRAM. Either way, the user has to blindly enter the command to switch back. * MDIS: Mux-only switch to the discrete graphics device.
For GPUs whose power state is controlled by the driver's runtime pm, the ON and OFF commands are a no-op (see next section).
For muxless machines, the IGD/DIS, DIGD/DDIS and MIGD/MDIS commands should not be used.