Hey, we have forums!

Author Topic: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card  (Read 28092 times)

0 Members and 3 Guests are viewing this topic.

Offline False.Genesis

  • Administrator
  • Super Bit
  • **********
  • Posts: 461
  • PRESS COMPILE FOR RAINBOWS
    • View Profile
    • My source code!
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #15 on: January 18, 2012, 07:05:33 am »
Just thought of something to try...

You could try treating Myth with patchelf (which replaces the older chrpath), and set the rpath to $ORIGIN/lib32 or something, and put the lib32 folder from my builds next to it, so it will load these, and not the system ones. You will possibly have to escape $ORIGIN, so that the shell doesn't mangle it.

Then use ldd and objdump -x Myth2 | grep RPATH or readelf -d Myth2 | grep RPATH to verify it loads the new libs. If objdump literally prints $ORIGIN/lib32, you've been successful. You can also test objdump on aquaria32.
(Fyi, when compiling, I used -Wl,-rpath,\$ORIGIN/lib32 from ccmake, as CXX flag.)

Well... this is more random experimenting than anything else. :P

But one thing Myth2 and aquria32 do NOT have in common is that Myth2 uses system libs only. Could be the problem, but i doubt it - it would mean the ubuntu packagers have messed up.
The HiB release ships its own libraries too, and nevertheless it had the rectangles.
« Last Edit: January 18, 2012, 07:13:35 am by False.Genesis »

Offline flabbergastedpickle

  • Bit
  • ***
  • Posts: 16
    • View Profile
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #16 on: January 18, 2012, 07:41:18 am »
Hmmm, this may be potentially possible but I would probably have to move all the libs into that new folder, no? Also, some libs are in /lib32/ and other are in /usr/lib32 folder... Is it possible to change that prefix for only some of the libs?

I am also suspecting that the game might be using statically linked SDL (although I have no proof at this point as nm executable gives me no symbols). so until I hear from the Myth 2 folks, it's going to be difficult to move forward...

Once again, many thanks for all your help!

Offline False.Genesis

  • Administrator
  • Super Bit
  • **********
  • Posts: 461
  • PRESS COMPILE FOR RAINBOWS
    • View Profile
    • My source code!
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #17 on: January 18, 2012, 07:51:16 am »
I meant ./lib32 inside of the Myth2 dir, which is basically what $ORIGIN/lib32 translates to. /usr/lib32 are the system ones, don't touch them.
RPATH is just to tell the dynamic linker to check the specified directories before the system ones, allowing you to replace libs. There is another way with environent variables (world of goo uses this), but it is rather hackish.
And why "all the libs" ? Mine's just 4 ...

Statically linked SDL would be against the LGPL, unless they published their source code.
You could try to find SDL-related strings in the binary with a hex editor just for fun...

Offline flabbergastedpickle

  • Bit
  • ***
  • Posts: 16
    • View Profile
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #18 on: January 18, 2012, 08:05:43 am »
Never mind. I misunderstood what RPATH stood for. I thought it is a prefix for all lib paths but instead it is another path altogether that is searched before looking through system paths. Speaking of hacki-ish ways, couldn't I simply do LD_PRELOAD=path-to-lib executable and do one lib at a time? Alternatively, what version of patchelf would you recommend since there is no recent release for Ubuntu or any other distro (latest one was from 2008 or thereabouts)?

EDIT: tried LD_PRELOAD trick with all 4 of your libs as well as individual ones and no change. I also tried to preload alternative libGL.so.1.2 and that made no difference either... Is there still a point of trying patchelf?
« Last Edit: January 18, 2012, 08:19:09 am by flabbergastedpickle »

Offline False.Genesis

  • Administrator
  • Super Bit
  • **********
  • Posts: 461
  • PRESS COMPILE FOR RAINBOWS
    • View Profile
    • My source code!
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #19 on: January 18, 2012, 05:41:56 pm »
Yes, LD_PRELOAD is almost the same thing, just had forgotten the variable name yesterday.
If ldd says your custom libs were loaded, there is no point in trying patchelf. Haven't tried it myself though.

Looks like the Myth2 devs need to help you now ;)

Offline flabbergastedpickle

  • Bit
  • ***
  • Posts: 16
    • View Profile
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #20 on: January 18, 2012, 06:02:47 pm »
Many thanks for all your help!

As it turns out apparently Myth does statically link against SDL and hence LD_PRELOAD has no effect in respect to SDL lib (AFAIK). I am curious to hear why is SDL being statically linked (hopefully they are not using some kind of hacked version) and if there is a way to get a build that is dynamically linked. Myth2 BTW is not open-source so there is no way for me to recompile it...

Offline flabbergastedpickle

  • Bit
  • ***
  • Posts: 16
    • View Profile
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #21 on: January 19, 2012, 07:10:45 am »
Sorry to bother you again, but I am wondering can you tell me what exact OpenGL function did you add and what does it do? I am still having no luck trying to identify the source of this problem even on Aquaria-side. The old and new 32-bit binaries only differ in that the new one relies on system libs and yet when I LD_PRELOAD included one it still doesn't show any problems (unless I am missing something)...

Offline False.Genesis

  • Administrator
  • Super Bit
  • **********
  • Posts: 461
  • PRESS COMPILE FOR RAINBOWS
    • View Profile
    • My source code!
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #22 on: January 19, 2012, 10:15:42 am »
glVertex3i(). It is like glVertex3f(), just taking 3 integers instead of float for vertex coordinates. Internally, on openGL side, it may as well be impemented to convert the integers to floats and call glVertex3f(). But not sure.

But as said earlier, this has nothing do do with it. It *might* be because of SDL, but more likely is some internal gfx driver failure. If you really want i can make a version that does not use glVertex3i(), but it will be the same as it is now. Or build from current *original* icculus code, and not my patched version. Although you'd miss a few goodies then :P

Btw, unrelated note, there is way too few activity on this forum, so you're not bothering me or anyone. Just go ahead.
« Last Edit: January 19, 2012, 10:18:18 am by False.Genesis »

Offline flabbergastedpickle

  • Bit
  • ***
  • Posts: 16
    • View Profile
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #23 on: January 19, 2012, 01:40:20 pm »
Actually both of the scenarios you suggested would be interesting to test just to figure out where the problem lies.... If both of these don't exhibit the problem then we'll need to look into build environment/flags in hope to find the culprit...

Another interesting thing is that Myth2 dev built a fully dynamically linked version (including SDL) and the problem persists, albeit I get this weird error when trying to run it:

Inconsistency detected by ld.so: dl-close.c: 743: _dl_close: Assertion `map->l_init_called' failed!

This happens only a few times per session, though... What could this mean when the executable is supposed to be fully dynamic?

http://tain.totalcodex.net/forum/viewtopic.php?f=2&t=5800&start=15
« Last Edit: January 19, 2012, 01:43:24 pm by flabbergastedpickle »

Offline flabbergastedpickle

  • Bit
  • ***
  • Posts: 16
    • View Profile
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #24 on: January 20, 2012, 02:39:03 am »
I have some time this evening to do some testing... Any chance you could get me the two executables to test as discussed above? That would be awesome :-)

Alternately, is there a repository of source of older executables that I might be able to compile on my own?

Offline False.Genesis

  • Administrator
  • Super Bit
  • **********
  • Posts: 461
  • PRESS COMPILE FOR RAINBOWS
    • View Profile
    • My source code!
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #25 on: January 20, 2012, 06:25:27 am »
Wait, what? Didn't get that one.
Anyway, if you need really old stuff, grab the icculus repo and checkout the initial changeset rather than tip, that should closely resemble the HiB builds (But you seriously don't want to use that version anymore except for testing).

And before i forget, i configured SDL like this:
Quote
./configure --enable-x11-shared=yes --disable-video-svga --disable-video-fbcon --disable-video-directfb --disable-arts --enable-input-tslib --disable-audio

Which keeps the dependencies minimal (32bit .so below):
Quote
   linux-gate.so.1 =>  (0xf7702000)
   libm.so.6 => /lib32/libm.so.6 (0xf7657000)
   libdl.so.2 => /lib32/libdl.so.2 (0xf7652000)
   libpthread.so.0 => /lib32/libpthread.so.0 (0xf7637000)
   libc.so.6 => /lib32/libc.so.6 (0xf7494000)
   /lib/ld-linux.so.2 (0xf7703000)

Ubuntu SDL has more stuff enabled for sure. I saw that Myth has --disable-audio too, btw...

EDIT: The error you are getting are incompatibilities between some runtime libs on your system vs. what myth expects, or between the runtime libs myth has already loaded, and SDL can't cope with, because it loads your system libs ADDITIONALLY...? Not sure what the dynamic linker is doing there. I imagine that there are structures in use that have changed, and either myth or SDL expect another version (= diff. memory layout)... that is, Myth passes a structure to SDL, and that, which is using your system libs and not those myth has loaded, fails because the memory layout is different. Or the other way around. Whatever, i might be wrong. In any case, this is not functional.
« Last Edit: January 20, 2012, 06:36:25 am by False.Genesis »

Offline flabbergastedpickle

  • Bit
  • ***
  • Posts: 16
    • View Profile
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #26 on: January 20, 2012, 11:08:14 am »
I was hoping you could produce 2 binaries you suggested in your previous email for me to test as I am not sure how I can check out older branch from icculus (what is the command for that?).

I think the current icculus code already creates properly working executables for me (at least 64-bit ones, BTW how do I build 32-bit one on a 64-bit machine?), so I would need to figure out how to get the original source of the HiB release... Any ideas?

Offline flabbergastedpickle

  • Bit
  • ***
  • Posts: 16
    • View Profile
Re: [SOLVED] Linux version 2D texture issues on the Intel HD 3000 video card
« Reply #27 on: January 20, 2012, 03:02:18 pm »
Never mind. No matter what I tried, I could not reproduce the problem on my machine even when forcefully building a 32-bit version of the app so this clearly has something to do with a discrepancy between build environments and that's that...