On 06/02/13 06:45, Armin K. wrote:
Hello, I have been playing with Catalyst on ArchLinux in order to get my Hybrid Graphics working. Catalyst supports PowerXpress 4.0+ in Linux, so muxless graphics can work. It took me some time to get it to work, I had to workaround many stuff. Here follows: First thing that I was bothered with is that /usr/lib/fglrx/switchlib{GL,glx} were missing. Their purpose is to switch /usr/lib/libGL.so.1 and /usr/lib/xorg/modules/extensions/libglx.so to either AMD (Catalyst) or Intel (Mesa and Xorg) libraries. Each one is called with "intel" or "amd" as an argument, and both must exit sucessfully with "echo amd" or "echo intel" after getting the job done. I've managed to "fool" Catalyst by creating dummy files. #!/bin/bash echo amd exit 0 By default, aticonfig --initial will use AMD (Discrete) GPU, so the current installation seems to be okay. I'll continue with other issues that can arise later in this mail. Next major problem is that fglrx will load intel driver, which, unfortunately can't be installed by default since it depends on intel-dri, which depends on libgl which is in conflict with catalyst-utils package (doh). I had to rebuild it without intel-dri dependency to get this working. On why intel driver is necesary, I can answer the following: Most newer hybrid graphics are muxless, they do not have hardware multiplexer and you can't select on which GPU you want to output. Instead, Discrete GPU is just wired to Integrated one and is meant only for Processing while it is on Integrated GPU to display anything passed from the Discrete GPU. For more information on this term, you may want to look at DRI PRIME and DMA BUF (An open source solution for this mess). So in fact, intel driver is needed since it is used for 2D and stuff, where fglrx only does the encoding/decoding stuff. How to fix it? Well, I couldn't think of any nice way to fix this. Debian has their alternatives system so they can have multiple libGL installed and set with alternatives. Gentoo does the same with their eselect stuff or whatever it's called. Since aticonfig --px-dgpu tells xorg.conf to use Discrete (AMD) GPU, it also runs /usr/lib/fglrx/switchlib{GL,glx} with "amd" as parameter in order to "make" /usr/lib/libGL.so.1 and /usr/lib/xorg/modules/extensions/libglx.so point to AMD provided libraries. aticonfig --px-igpu would switch to Mesa libGL.so.1 and Xorg Server libglx.so which are, you know, not present when catalyst-utils are installed. (Xserver libglx.so is present, but it's useless without Mesa's libGL.so.1). On how to solve this I can only think of making another package (part of Mesa source package) called something like intel-dri-hybrid (which depends on catalyst-utils and can only be used with it) that installs Intel DRI drivers and libGL.so.1 into some nonstandard place or just renamed to something else like libGL-intel.so.1. Also, it would be necesary to make /usr/lib/fglrx/switchlib{GL,glx} to correctly switch (symlinks should do it, but carefully) between AMD and Open Source libGL and libglx. I haven't done this yet but some may want to use this - not everyone wants to use Discrete GPU always - especially when on battery. I can say that power consumption on my laptop has dropped even though I always disabled Discrete GPU via vgaswitcheroo (radeon driver). Any comments and suggestions are welcome. I can try to implement something if necesary, it's just the question if my suggestions are good enough and will be accepted. I appologize for any gramatical mistakes.
Definitely sounds useful, as a lot of laptops seem to have hybrid graphics these days. Mine has two AMD cards (APU and GPU) so I can just use `aticonfig` to switch, but it forces me to use the Catalyst drivers (several versions behind too!) as the open-source ones give me a blank screen.
Have you had a look at Vi0l0's catalyst-pxp packages in his unofficial Catalyst repos[1]? There was some discussion on the "AMD/ATi Bar & Grill" thread a few months back about this too.
[1] http://catalyst.apocalypsus.net/repo/catalyst/