|
| 1 | +# TAGLINE |
| 2 | + |
| 3 | +Launch a command on a specific GPU |
| 4 | + |
| 5 | +# TLDR |
| 6 | + |
| 7 | +**List** known GPUs (default when no command is given) |
| 8 | + |
| 9 | +```switcherooctl``` |
| 10 | + |
| 11 | +**List** GPUs explicitly |
| 12 | + |
| 13 | +```switcherooctl list``` |
| 14 | + |
| 15 | +Launch a command on the **first discrete GPU** |
| 16 | + |
| 17 | +```switcherooctl launch [glxgears]``` |
| 18 | + |
| 19 | +Launch a command on a **specific GPU** (number from **list**) |
| 20 | + |
| 21 | +```switcherooctl launch [-g|--gpu] [1] [firefox]``` |
| 22 | + |
| 23 | +Print the **switcheroo-control** version |
| 24 | + |
| 25 | +```switcherooctl version``` |
| 26 | + |
| 27 | +Show **help** for a subcommand |
| 28 | + |
| 29 | +```switcherooctl help launch``` |
| 30 | + |
| 31 | +Start the **switcheroo-control** daemon |
| 32 | + |
| 33 | +```sudo systemctl enable --now switcheroo-control.service``` |
| 34 | + |
| 35 | +# SYNOPSIS |
| 36 | + |
| 37 | +**switcherooctl** **help** [_COMMAND_] |
| 38 | + |
| 39 | +**switcherooctl** **version** |
| 40 | + |
| 41 | +**switcherooctl** **list** |
| 42 | + |
| 43 | +**switcherooctl** **launch** [**-g**|_**--gpu=**_GPU_] _COMMAND_... |
| 44 | + |
| 45 | +# COMMANDS |
| 46 | + |
| 47 | +**help** [_COMMAND_] |
| 48 | +> Print a short synopsis, or detailed help for one command. |
| 49 | +
|
| 50 | +**version** |
| 51 | +> Print the **switcheroo-control** version this CLI belongs to. |
| 52 | +
|
| 53 | +**list** |
| 54 | +> List known GPUs. Each entry includes a device number used with **launch --gpu**. This is the default command when none is given. |
| 55 | +
|
| 56 | +**launch** [_OPTION_] _COMMAND_... |
| 57 | +> Run _COMMAND_ on a GPU. With no **-g**, the first discrete (non-default) GPU is used, or the default GPU if the system has no discrete GPU. |
| 58 | +
|
| 59 | +# PARAMETERS |
| 60 | + |
| 61 | +**-g**, **--gpu=**_GPU_ |
| 62 | +> GPU to launch on (device number from **list**). Applies to **launch**. |
| 63 | +
|
| 64 | +# DESCRIPTION |
| 65 | + |
| 66 | +**switcherooctl** is the command-line client for **switcheroo-control**, a D-Bus service that discovers GPUs on hybrid-graphics Linux systems and tells desktop environments which adapters exist. GNOME and KDE use that API for menu actions such as "Launch using Discrete Graphics". |
| 67 | + |
| 68 | +**list** prints each adapter with a device number, whether it is the default or a discrete GPU, and the environment variables the daemon would set for that device. **launch** starts a process with those variables so the application renders on the chosen GPU (typically PRIME render offload: Mesa **DRI_PRIME** and, on NVIDIA, the vendor offload variables). It does not flip a hardware mux. |
| 69 | + |
| 70 | +The daemon is **switcheroo-control.service**. Without it, **switcherooctl** cannot enumerate GPUs. The package name is **switcheroo-control**; the command you type is **switcherooctl**. |
| 71 | + |
| 72 | +# CAVEATS |
| 73 | + |
| 74 | +Requires **switcheroo-control.service** to be running and a machine with more than one GPU. This is render offload, not mux switching: the display can stay on the integrated GPU while a single app uses the discrete one. Detection can mis-label adapters on unusual hardware. Wayland plus the proprietary NVIDIA driver has historically needed extra compositor and driver support; **prime-run** or vendor tools may still be required for some titles. |
| 75 | + |
| 76 | +# HISTORY |
| 77 | + |
| 78 | +**switcheroo-control** was written by **Bastien Nocera** (hadess) for GNOME so desktop shells could offer discrete-GPU launch without users setting environment variables by hand. The source moved from GitHub to **gitlab.freedesktop.org**; the old GitHub mirror was archived in **June 2020**. GNOME 3.36 (2020) tightened the D-Bus API. openSUSE later recommended **switcherooctl** over **suse-prime** and Bumblebee for hybrid laptops. |
| 79 | + |
| 80 | +# INSTALL |
| 81 | + |
| 82 | +```apt: sudo apt install switcheroo-control``` |
| 83 | + |
| 84 | +```dnf: sudo dnf install switcheroo-control``` |
| 85 | + |
| 86 | +```pacman: sudo pacman -S switcheroo-control``` |
| 87 | + |
| 88 | +```zypper: sudo zypper install switcheroo-control``` |
| 89 | + |
| 90 | +```nix: nix profile install nixpkgs#switcheroo-control``` |
| 91 | + |
| 92 | +<!-- packages: 2026-08-17 --> |
| 93 | + |
| 94 | +# SEE ALSO |
| 95 | + |
| 96 | +[prime-run](/man/prime-run)(1), [optirun](/man/optirun)(1), [envycontrol](/man/envycontrol)(1), [nvidia-smi](/man/nvidia-smi)(1), [glxinfo](/man/glxinfo)(1) |
| 97 | + |
| 98 | +# RESOURCES |
| 99 | + |
| 100 | +```[Source code](https://gitlab.freedesktop.org/hadess/switcheroo-control)``` |
| 101 | + |
| 102 | +<!-- verified: 2026-08-17 --> |
0 commit comments