My laptop is a normal, uninteresting machine with two standard, unmultiplexed GPUs and an ordinary Debian stretch installation. The secondary GPU (a Radeon) is usually powered down but I can activate and use it by (for example)
DRI_PRIME=1 glxgears. Mesa's source file src/loader/loader.c manages it.
Switching GPUs is a fairly important system function. One would think that the mechanism that does it would be thoroughly documented, but all I can find are a few oblique changelog entries and some online lore like this.
You won't need Debian to answer my question. Any Linux should do.
In case a reader who wishes to start to learn about GPU switching stumbles in here, he can try
sudo cat /sys/kernel/debug/vgaswitcheroo/switch and then read html/newstyle/gpu/vga-switcheroo.html in the Linux kernel source. Also,
man 8 lspci. It took me two hours to figure out that much, so I mention it here to save the reader time.
Meanwhile, where is the proper documentation of Mesa environment variables like