SDL/OpenGL Splash Screen

Recently compiled the 4.8 preview from Git and have attempted to run the UE4 Editor but I receive an libGL error:

[2015.06.05-10.29.32:043][  0]LogHAL:Error: LinuxSplash_InitSplashResources() : Splash screen window could not be created! SDL_Error: Failed loading libGL.so.1: dlopen: cannot load any more object with static TLS
Fatal error: [File:/home/michael/Projects/UnrealEngine/Engine/Source/Runtime/OpenGLDrv/Private/Linux/OpenGLLinux.cpp] [Line: 801]

I’m currently running NVIDIA drivers 349 on 64 bit Arch Linux as seen here:

michael@Michael-Arch /u/lib> pacman -Q nvidia nvidia-utils nvidia-libgl
nvidia 349.16-3
nvidia-utils 349.16-1
nvidia-libgl 349.16-1

and libGL is found in both 32 bit and 64 bit lib folders:

michael@Michael-Arch /u/lib> ls -al | grep libGL.so.1
lrwxrwxrwx   1 root root       15 Apr 23 02:10 libGL.so.1 -> libGL.so.349.16


michael@Michael-Arch /u/lib32> ls -al | grep libGL.so.1
lrwxrwxrwx  1 root root       15 Apr 23 02:07 libGL.so.1 -> libGL.so.349.16

Any information would be greatly appreciated.

This is a known problem on Arch - total number of shared objects with static TLS loaded at the moment of the OpenGL initialization exceeds the glibc’s DTV_SURPLUS limit.

Granted, we shouldn’t be using static TLS (and we pass appropriate -ftls-model=… switch), but for some reason this doesn’t seem to work.

Note that Ubuntu 14.10 and later (together with Fedora 22) upped DTV_SURPLUS to 32, so you won’t run into this problem on those OSes. Alternatively, if you want to stay with Arch, you may want to patch your glibc in the same way: Carlos O'Donell - Fixing the distribution problems with TLS and DTV_SURPLUS slots.

Lovely, just added a patch to my glibc allowing for a DTV_SURPLUS of 32. Thanks :slight_smile:

For anyone else who faces this same issue, see this thread on stack exchange

It solves the issue for those who want to manually rebuild their glibc. But don’t think this should be resolved as it is quite intrusive and forces users dependency to maintain their own patched version of a core library.

Another workaround is to use LD_PRELOAD to load libGL.so.1 when running the editor.

Like this:

LD_PRELOAD=/u/lib/libGL.so.1 ./UE4Editor

This fixed the issue for me on Arch with the 352.21-1 nvidia drivers. No patching required.

can confirm this works =)