RunningRiot 3 déc 2012 à 11h37
[WORKAROUND] Allow TF2 to run with legacy ATI drivers 12.6.
NOTE: AMD have released a new Legacy driver which resolves the problem this workaround originally... worked around. Go get 'em!


























The Catalyst Legacy 12.6 drivers are missing a fairly trivial extension, GL_EXT_texture_sRGB_decode. This extension allows the game engine to switch a texture between sRGB decoding(gamma correction) and linear decoding (no gamma correction). It is used for DX9 emulation, which it appears the source engine is doing. Thus, colors are off quite a bit in-game when using dxlevel9* (tends to be a bit dark). dxlevel81 runs perfectly well.

Here is a temporary fix for the missing extension:

This has been consistently working for many users for a few weeks now.

Essentially, we're overriding the libc function strstr, which searches for a string within a string. This function is used by TF2 to check for GL extensions. We're overriding the default with a version which will always claim that the string GL_EXT_texture_sRGB_decode matches, even if it doesn't.

If you are running 64bit, install some necessary 32bit development packages:

sudo apt-get install libc6-dev-i386
Create a file "strstr.c" with the following content:
#include <string.h>

char * strstr( const char * haystack, const char * needle )
{
//Default strstr implementation. Kind of Slow, but hopefully
//TF2 doesn't use this often.
if( needle == NULL || haystack == NULL )
{
return (char*)haystack;
}
char * n = (char*)needle;
char * h = (char*)haystack;
while( *h ) {
if( *n == '\0' ) {
return h-n+(char*)needle;
}
if( *h == *n ) {
n++;
}
else {
n = (char*)needle;
}
h++;
}

//Suddenly, MAGIC!
if( strcmp(needle,"GL_EXT_texture_sRGB_decode") == 0 ) {
return (char*)haystack;
}
return NULL;}
Build the file (64bit):
gcc -fPIC -DPIC -g -m32 -c strstr.c && ld -m elf_i386 -shared -o strstr.so strstr.o

Now, to get the game to use our override, we can make use of the GAME_DEBUGGER variable, which is used by the game launch scripts to allow hooking into gdb or strace to debug the game. It is invoked with the hl2_linux process and arguments (find and look at hl2.sh for more details).

First, create our "debugger", a process that loads that library we just built, but doesn't really do any debuging (won't affect performance). Use your favorite editor to create the file ~/bin/hl2debug and add the following content. Adjust the path to strstr.so depending on where you built it.

#!/bin/bash

export LD_PRELOAD="$HOME/strstr.so $LD_PRELOAD"
"$@" #Launch the original process and all arguments

Now, make it executable:
chmod +x ~/bin/hl2debug

In your .bashrc (or .zshrc, or .profile), add this at the end so that steam knows what "debugger" to use and where to find it:

export PATH=$HOME/bin:$PATH
export GAME_DEBUGGER="hl2debug"

Either log out/back in if you want to launch steam with the menu option, or just get the variable into your environment (`source ~/.bashrc`) and launch steam from the terminal.

Other posts mention TF2 specific launch options to help improve performance or work around other bugs, but launching with "-novid" works around some errors related to video playback, and launching with "-nojoy" improves performance a lot for some older cards.

Voila!
Dernière modification de RunningRiot; 19 oct 2013 à 19h11
Affichage des commentaires 1 à 15 sur 112
< >
[Linux] Schrödinger's cat 3 déc 2012 à 12h13 
How much fps is difference between fglrx-legacy and open source driver?
RunningRiot 3 déc 2012 à 12h15 
I haven't even tried the open source driver, but I would guess at least 2x, if not more.
[Linux] Schrödinger's cat 3 déc 2012 à 12h16 
And what is your GPU and how much fps do you get?
Beelzebud 3 déc 2012 à 12h17 
I hope AMD gets their act together soon, because with a 5770 and the latest beta driver, it simply can't run TF2 at full speed. Same hardware in Win7 has no trouble with TF2.
boot 3 déc 2012 à 12h34 
Tried to follow this, but it doesn't compile.

In file included from /usr/include/stdio.h:28:0,
from strstr.c:1:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
compilation terminated.
RunningRiot 3 déc 2012 à 12h39 
boot a écrit :
Tried to follow this, but it doesn't compile.

In file included from /usr/include/stdio.h:28:0,
from strstr.c:1:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
compilation terminated.

Hmm, that's unusual. You may not have required development headers or something. As you can see, the program is extermely trivial... though it doesn't even need stdio.h. Try removing that include.
boot 3 déc 2012 à 12h42 
Same error.(with /usr/include/string.h:27:0,)
I'm using Kubuntu 12.10 64-bit.
Dernière modification de boot; 3 déc 2012 à 12h43
RunningRiot 3 déc 2012 à 12h43 
boot a écrit :
Same error.
I'm using Kubuntu 12.10 64-bit.
Ok. I just edited the main post. Looks like package libc6-dev-i386 is necessary for building 32bit library.
boot 3 déc 2012 à 12h51 
It's launching, but getting some errors.

Error: Material "fullscreenvideomaterial" uses unknown shader "Bik"

Used -novid flag to bypass this.
Now getting:

Could not load chromehtml library.IDirect3DDevice9::Create: BackBufWidth: 1920, BackBufHeight: 1080, D3DFMT: 3, BackBufCount: 1, MultisampleType: 0, MultisampleQuality: 0
Can't find background image materials/Console/startup_loading.vtf

So I'm trying to verify game files.
RunningRiot 3 déc 2012 à 12h54 
boot a écrit :
It's launching, but getting some errors.

Error: Material "fullscreenvideomaterial" uses unknown shader "Bik"

Used -novid flag to bypass this.
Now getting:

Could not load chromehtml library.IDirect3DDevice9::Create: BackBufWidth: 1920, BackBufHeight: 1080, D3DFMT: 3, BackBufCount: 1, MultisampleType: 0, MultisampleQuality: 0
Can't find background image materials/Console/startup_loading.vtf

So I'm trying to verify game files.

I had all that too. Are you symlinking to your ntfs partition? I was at first, but now I'm only symlinking the gcf. The SteamApps/$USER/Team Fortress 2/ folder is on my /home. Uses about 1.2GB of "extracted" space, but it works!
Dernière modification de RunningRiot; 3 déc 2012 à 12h55
RunningRiot 3 déc 2012 à 12h56 
gcc a écrit :
And what is your GPU and how much fps do you get?

HD3870. Looks like ~10fps at 2560x1600. I only just got it to launch when I made my post, so yeah... its kind of unplayable.

Edit: With highframes[fakkelbrigade.eu], I'm getting 35fps at 1280x800. Reasonably playable. Colors look much better here, too.

Edit again. Oh wow. Yeah, turn off pyrovision->100fps.
Dernière modification de RunningRiot; 4 déc 2012 à 1h23
boot 3 déc 2012 à 12h59 
RunningRiot a écrit :

I had all that too. Are you symlinking to your ntfs partition? I was at first, but now I'm only symlinking the gcf. The SteamApps/$USER/Team Fortress 2/ folder is on my /home. Uses about 1.2GB of "extracted" space, but it works!

Yes, I'm symlinking SteamApps folder to another driver, but it is on a ext4 partition.

Edit: Is there anyway to solve this problem without changing the symlink?
Dernière modification de boot; 3 déc 2012 à 13h21
RunningRiot 3 déc 2012 à 14h17 
boot a écrit :

Edit: Is there anyway to solve this problem without changing the symlink?

Try just deleting your $USER/Team Fortress 2/ directory, leaving all the gcfs in place. After launching it again (And it "Verified Local Cache") it seems work work wonderfully.
Dernière modification de RunningRiot; 3 déc 2012 à 14h18
boot 3 déc 2012 à 14h51 
Ok, lets see.

Game tends to crash..., a lot. Especially when changing video settings.
Intro video has a sort of green overlay to it.
The colours are somewhat darker in some parts.
Brightness slider option does nothing.
Sky box isn't rendering properly.
Some fonts not rendering properly in-game.
Slower performance than windows.
Everything on menus (before starting/entering server) displays properly.

Kubuntu 12.10 64-bit
Ati HD4770 with fglrx-legacy 12.6
RunningRiot 3 déc 2012 à 14h56 
boot a écrit :
Ok, lets see.

Game tends to crash..., a lot. Especially when changing video settings.
Intro video has a sort of green overlay to it.
The colours are somewhat darker in some parts.
Brightness slider option does nothing.
Sky box isn't rendering properly.
Some fonts not rendering properly in-game.
Slower performance than windows.
Everything on menus (before starting/entering server) displays properly.

Kubuntu 12.10 64-bit
Ati HD4770 with fglrx-legacy 12.6

Did you try applying the highframes config from http://fakkelbrigade.eu/chris/configs/ ? I'm getting over 100fps with no problems on an older card with half the number of shaders. Graphics quality is a bit lowered. I still need to find the right balance, but this is a great start. Windowed mode seems to help quite a bit, as does turning off compiz ( metacity --replace )
Affichage des commentaires 1 à 15 sur 112
< >
Par page : 15 30 50