“I always say, 'This will be my last 'Metal Gear.'” Hideo Kojima

Howto use Hybrid Graphics on Manjaro/Archlinux with PRIME

This is fucking awesome! If you have a machine with Intel/AMD Hybrid graphics, you are (finally) a lucky person. Only tested on Manjaro, but probably works with any other Linux distro out there (specially Archlinux). If you can’t use DRI3, scroll down for a DRI2 tutorial.

DRI3

UPDATE 12/03/2017: Steam is NOT compatible with DRI3. See this.
  • Install Manjaro (or Archlinux). Don’t use closed source drivers, intel/radeon open source drivers are your friends.
  • Comment this three lines on /etc/X11/xorg.conf.d/90-mwhd.conf (for Archlinux create a file /etc/X11/xorg.conf.d/90-intel.conf to enable DRI3)
Section "Device"
	Identifier  "Device0"
	Driver      "intel"
	#BusID       "PCI:0:2:0"
	#Option      "AccelMethod" "sna"
	#Option      "DRI"    "true"
	Option       "DRI" "3"  
EndSection
  • Restart X.
  • Use DRI_PRIME=1 to launch things using your Radeon card. Examples:
DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
DRI_PRIME=1 wesnoth
  • THAT’S IT! FINALLY A PROPER WAY TO HANDLE HYBRID GRAPHICS ON LINUX. THANK GOD (or whoever did this possible)!

Only programs started with DRI_PRIME=1 will be using the Radeon card. So you should get the same as on Windows. The two major downsides I see are that open source drivers are not as good in 3D as propietary ones are (let’s hope for AMDGPU to solve this at least for GCN users), and that Unity3D based games seems to dislike AMD hardware and they look ugly (no Anti-Aliasing).

Also, for Steam games, you can right-click on your game and select “Properties”. On the general tab, click “Set launch options” and add DRI_PRIME=1 %command% .

DRI2

If, for whatever reason you can’t use DRI3 and have to stick with DRI2, you can still use this method but you must manage the offload sink yourself. So, for DRI2 you have to:

  • Install Manjaro (or Archlinux).
  • Remove /etc/X11/xorg.conf.d/90-mhwd.conf (skip this on Archlinux).
  • Restart X
  • xrandr --listproviders
    

    (it must show 2 providers, take note of the second provider name field)

  • xrandr --setprovideroffloadsink radeon Intel
    

    (radeon might actually be something like “HAINAN @ pci:0000:03:00.0” and USE QUOTES)

  • Use DRI_PRIME=1 to launch things using your Radeon card.Examples:
DRI_PRIME=1 glxinfo | grep "OpenGL renderer"
DRI_PRIME=1 wesnoth

HAPPY GAMING!

Jordi