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.

Is DRI_PRIME undocumented?

I wish to read the documentation but cannot find it. Oddly, it isn't here. Moreover, Google cannot locate it. If you know where the documentation is, would you tell?

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 DRI_PRIME, please?

  • 1
    See Here – RubberStamp Dec 3 '18 at 1:23
  • @RubberStamp: Aha! Excellent. That is what I wanted. If you have time to make your comment an answer, then I would like to upvote it. – thb Dec 4 '18 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.