You are not logged in.

#1 2011-05-13 17:39:54

Vi0L0
Member
From: Poland
Registered: 2009-06-24
Posts: 1,349
Website

[SLVD] force using /usr/lib/xorg/modules/updates/extensions/libglx.so

Latest versions of catalyst bring powerXpress support - it means that we can now switch between discreet AMD gfx driver and integrated intel gfx driver (and maybe also switch between catalyst and ati oss driver).
I'm working on it now, unfortunatelly it's not that easy to implement in a right way in Arch. There's no way without doing some ugly tricks (like creating /usr/X11R6 dir). Although i must say that i almost succeeded.

Yes, i know that /usr/X11R6/lib is obsolete and not supported by Arch, but i must to place catalyst's libGL.so somewhere so it wouldn't conflict with libgl's libGL.so (+ more important is to be able to update libgl package without problems), and that directory is looking good.

Basically this whole powerXpress suport = linking libGL and libglx libraries into right place. Let me show you some functions:

switching libGL:

function switch_to_amd() {

    ln -snf /usr/X11R6/lib/fglrx/fglrx-libGL.so.1.2 \
            /usr/X11R6/lib/libGL.so.1.2
    ln -snf libGL.so.1.2 /usr/X11R6/lib/libGL.so.1
    ln -snf libGL.so.1 /usr/X11R6/lib/libGL.so
    ldconfig /usr/X11R6/lib

}

function switch_to_intel() {

    ln -snf /usr/lib/libGL.so.1.2 \
            /usr/X11R6/lib/libGL.so.1.2
    ln -snf libGL.so.1.2 /usr/X11R6/lib/libGL.so.1
    ln -snf libGL.so.1 /usr/X11R6/lib/libGL.so
    ldconfig /usr/X11R6/lib

}

switching libglx:

function switch_to_amd() {

    ln -snf /usr/lib/xorg/modules/updates/extensions/fglrx/fglrx-libglx.so \
            /usr/lib/xorg/modules/updates/extensions/libglx.so

}

function switch_to_intel() {

    ln -snf /usr/lib/xorg/modules/extensions/libglx.so \
            /usr/lib/xorg/modules/updates/extensions/libglx.so

}

I've created /etc/ld.so.conf.d/catalyst.conf with:

/usr/X11R6/lib

inside. I've also added /usr/X11R6/lib into PATH in /etc/profile in 1st place (just in case).
And it's working fine (i mean catalyst is working fine) untill i will install libgl (so it's not fine)... After restart, when running X server screen goes blank and i cannot do anything (even when it's switched to amd). /var/log/Xorg.0.log looks fine, no errors, it's longer than usuall with those lines:

[  2515.883] (II) Power Button: Close
[  2515.883] (II) UnloadModule: "evdev"
[  2515.883] (II) Unloading evdev
[  2515.895] (II) Power Button: Close
[  2515.895] (II) UnloadModule: "evdev"
[  2515.895] (II) Unloading evdev
[  2515.911] (II) My keyboard: Close
[  2515.911] (II) UnloadModule: "evdev"
[  2515.911] (II) Unloading evdev
[  2515.926] (II) My keyboard: Close
[  2515.926] (II) UnloadModule: "evdev"
[  2515.926] (II) Unloading evdev
[  2515.942] (II) My Mouse: Close
[  2515.942] (II) UnloadModule: "evdev"
[  2515.942] (II) Unloading evdev
[  2515.947] (II) fglrx(0): Shutdown CMMQS
[  2515.948] (II) fglrx(0): [uki] removed 1 reserved context for kernel
[  2515.948] (II) fglrx(0): [uki] unmapping 8192 bytes of SAREA 0x2000 at 0x7fdc4f862000
[  2515.962] (II) fglrx(0): Interrupt handler Shutdown.

but it doesn't look relevant.


I don't know is it:
- /usr/X11R6/lib that is chosen after /usr/lib
- OR /usr/lib/xorg/modules/updates/extensions/ that is chosen after /usr/lib/xorg/modules/extensions/  - i though that updates should be taken in 1st place by default

Maybe both of them?
Right now i'm thinking that this is the problem of /usr/X11R6/lib that need to be taken before /usr/lib, so my question is same as the question in topic of this post.
I will really appreciate any help.


Btw: there's only one file in /usr/X11R6/lib : /usr/X11R6/lib/fglrx/fglrx-libGL.so.1.2
+ there's only one file in /usr/lib/xorg/modules/updates/extensions : /usr/lib/xorg/modules/updates/extensions/fglrx/fglrx-libglx.so

I took this whole solution and scripts from SUSE (AMD's solution is really ugly). SUSE also doesn't like /usr/X11R6/lib, but they used it and there it seems to work. I mean i don't have SUSE, i just see their catalyst packaging script.

Last edited by Vi0L0 (2011-05-15 10:02:32)

Offline

#2 2011-05-14 00:39:11

Vi0L0
Member
From: Poland
Registered: 2009-06-24
Posts: 1,349
Website

Re: [SLVD] force using /usr/lib/xorg/modules/updates/extensions/libglx.so

Imoprtant update:
i was wrong about /usr/X11R6/lib.
I've installed libgl, then removed /usr/lib/libGL.so* and problem persist. Then i reinstalled libgl, and removed /usr/lib/xorg/modules/extensions/libglx.so - it was working fine...

So the problem is that /usr/lib/xorg/modules/extensions/libglx.so is picked up in 1st place, not /usr/lib/xorg/modules/updates/extensions/libglx.so ...
Adding /usr/lib/xorg/modules/updates/extensions/libglx.so into /etc/ld.so.conf.d/catalyst.conf and into PATH in /etc/profile gives nothing.

Any idea?

Offline

#3 2011-05-14 09:37:41

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SLVD] force using /usr/lib/xorg/modules/updates/extensions/libglx.so

've installed libgl, then removed /usr/lib/libGL.so* and problem persist. Then i reinstalled libgl, and removed /usr/lib/xorg/modules/extensions/libglx.so - it was working fine...

This may be because of  a fallback option that if libglx.so is not found , xorg uses libglx.xorg .


It does look like xorg doesn't entirely folllow ldconfig / symbolic links , so i'm inclined to suggest to keep things as simple as possible and change only what's really necessary .

As your libraries have different names as the mesa ones :

place fglrx-libGL.so.1.2 in /usr/lib

put fglrx-libglx.so in /usr/lib/xorg/modules/extensions

for libgl only change the symbolic link just above the binary :  /usr/lib/libGL.so.1

for libglx change /usr/lib/xorg/modules/extensions/libglx.so

If that works, you'll atleast know the switch is possible.

Last edited by Lone_Wolf (2011-05-14 09:41:08)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2011-05-14 10:30:15

Vi0L0
Member
From: Poland
Registered: 2009-06-24
Posts: 1,349
Website

Re: [SLVD] force using /usr/lib/xorg/modules/updates/extensions/libglx.so

Lone_Wolf wrote:

've installed libgl, then removed /usr/lib/libGL.so* and problem persist. Then i reinstalled libgl, and removed /usr/lib/xorg/modules/extensions/libglx.so - it was working fine...

This may be because of  a fallback option that if libglx.so is not found , xorg uses libglx.xorg .

But libglx.so owned by catalyst (/usr/lib/xorg/modules/updates/extensions/libglx.so) should be found, and is found if only libglx.so owned by libgl (/usr/lib/xorg/modules/extensions/libglx.so) is not present. And if the last one is absent i can see in Xorg.0.log that xserver/catalyst is using that one placed in updates dir, not libglx.xorg.
Now i removed libgl, and removed /usr/lib/xorg/modules/updates/extensions/libglx.so, so catalyst should got troubles, restart X and same problem: blank screen with only one char sign on top left corner: _
So obviously catalyst need that /usr/lib/xorg/modules/updates/extensions/libglx.so
I just don't know how to force using /usr/lib/xorg/modules/updates/extensions directory over /usr/lib/xorg/modules/extensions dir...
Maybe i need something like LD_PRELOAD or something.

This maybe not clear but what i'm trying to reach right now is to get catalyst working when libgl package is present, cuz it's looking like good begining.

Lone_Wolf wrote:

It does look like xorg doesn't entirely folllow ldconfig / symbolic links , so i'm inclined to suggest to keep things as simple as possible and change only what's really necessary .

Ofcourse, i also don't like this whole /usr/X11R6/lib thing. Hell no, i even don't got intel gfx smile, i'm only trying to implement something that can be usefull for others.
And since SUSE know how to use /usr/lib/xorg/modules/updates/extensions directory over /usr/lib/xorg/modules/extensions i'm sure it's also possible in Arch. Maybe the right and only way is to change something in xserver compilation, i don't know. Right now i'm trying to do this in "easier" way.

Lone_Wolf wrote:

As your libraries have different names as the mesa ones :

place fglrx-libGL.so.1.2 in /usr/lib

put fglrx-libglx.so in /usr/lib/xorg/modules/extensions

for libgl only change the symbolic link just above the binary :  /usr/lib/libGL.so.1

for libglx change /usr/lib/xorg/modules/extensions/libglx.so

That ofcourse should work - since it will link to proper libs.
But it's not what i'm trying to reach : catalyst and libgl installed without conflicts.

Lone_Wolf wrote:

If that works, you'll atleast know the switch is possible.

Just a mention: this whole linking thing isn't anything new, it was used by linux users for long time so such switch is possible (as i can see they used to use such linking as you suggested but imho it's bad way - it should to be done without pacman's conflicts), now ati is just trying to implement it by default.
This powerXpress support is still in developement, although i can see what way ati picked up, i'm trying to follow it and i'm pretty sure that it will work if i will follow it. The sooner - the better.

Offline

#5 2011-05-15 10:01:45

Vi0L0
Member
From: Poland
Registered: 2009-06-24
Posts: 1,349
Website

Re: [SLVD] force using /usr/lib/xorg/modules/updates/extensions/libglx.so

Solved with lines:

Section "Files"
         ModulePath   "/usr/lib/xorg/modules/updates"
         ModulePath   "/usr/lib/xorg/modules"
EndSection

that need to be added into /etc/X11/xorg.conf or ie. by creating /etc/X11/xorg.conf.d/20-somefile.conf and adding those lines there.

Ok, so i can now move forward.

Offline

Board footer

Powered by FluxBB