PRIME is a recent technology used to manage hybrid graphics found on most laptops (Optimus for NVIDIA, AMD Dynamic Switchable Graphics for ATI). The following drivers support it (incomplete list, please add your driver if your can make it work !) :
First, check the list of video cards attached to your display :
$ xrandr --listproviders Providers: number : 2 Provider 0: id: 0x7d cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 4 associated providers: 1 name:Intel Provider 1: id: 0x56 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 6 outputs: 1 associated providers: 1 name:radeon
We can see that there are two graphic cards : Intel, the integrated card (id 0x7d) and radeon, the discrete card (id 0x56), which should be used for GPU-intensive applications. We can see that, by default, Intel is always used :
$ glxinfo | grep "OpenGL renderer" OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile
To use your discrete card (in this case, radeon), you must first define it as an offload provider for the integrated one, since it’s the integrated one that is connected to your display.
$ xrandr --setprovideroffloadsink 0x56 0x7d
Now, you can use your discrete card for the applications who need it the most (for example games, 3D modelers…):
$ DRI_PRIME=1 glxinfo | grep "OpenGL renderer" OpenGL renderer string: Gallium 0.4 on AMD TURKS
Other applications will still use the less power-hungry integrated card. The xrandr --setprovideroffloadsink 0x56 0x7d must be run at each X server restart ; you may want to make a script and auto-run it at the startup of desktop environment (or you may put it in /etc/X11/xinit/xinitrc.d/)
When an application is rendered with the discrete card, it only renders a black screen
In some cases PRIME needs a composition manager to properly work. If your window manager doesn’t do compositing, you can use xcompmgr on top of it.