DadSchoorse / vkBasalt

a vulkan post processing layer for linux
zlib License
1.23k stars 53 forks source link

vkBasalt: no good config file #152

Open tuxrinku opened 3 years ago

tuxrinku commented 3 years ago

I installed vkbasalt using the ubuntu ppa https://launchpad.net/~flexiondotorg/+archive/ubuntu/mangohud and created a vkBasalt.conf file in my game directory but when I start the game I have this error vkbasalt:err: no good config file (The conf file is a copy of the file in the repo).

I'm using lutris and set ENABLE_VKBASALT=1 in the environment variables.

Edit: Using VKBASALT_CONFIG_FILE worked.

DadSchoorse commented 3 years ago

vkBasalt.conf file in my game directory The working environment of the game has to be different then.

guglovich commented 3 years ago

@DadSchoorse I have the same error in Steam, but my config file is global. There is no error in Wine.

evelineraine commented 3 years ago

I'm having the same issue with Wine (DXVK) games. I debugged it a little with strace. Turns out that that the most recent chdir call preceeding the openat("vkBasalt.conf") is chdir("/")!

Error case Launch the game manually with Wine-TKG having vkBasalt.conf in current directory:

$ pwd
/home/eveline/games/bioshock-remastered/prefix/drive_c/bioshock-remastered-steam/Build/Final
$ ls -l vkBasalt.conf 
-rw-r--r--. 1 eveline wheel 8061 Sep 28 12:47 vkBasalt.conf
$ ENABLE_VKBASALT=1 strace -e open,openat,chdir -v -o /tmp/strace.log -f /home/eveline/.local/share/lutris/runners/wine/lutris-fshack-6.14-3-x86_64/bin/wine ./BioshockHD.exe
[...]
vkBasalt err:   no good config file

strace.log:

33605 chdir("/")
[...]
33605 openat(AT_FDCWD, "vkBasalt.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)

Hack-fix Place vkBasalt.conf in / and launch the game.

$ sudo cp vkBasalt.conf /
$ ls -l /vkBasalt.conf 
-rw-r--r--. 1 root root 8061 Sep 28 12:45 /vkBasalt.conf
$  ENABLE_VKBASALT=1 strace -e open,openat,chdir -v -o /tmp/strace.log -f /home/eveline/.local/share/lutris/runners/wine/lutris-fshack-6.14-3-x86_64/bin/wine ./BioshockHD.exe
[...]
vkBasalt info:  config file: vkBasalt.conf
vkBasalt info:  effects = smaa:cas:Clarity:Curves:Vibrance:FakeHDR:MagicBloom:LiftGammaGain
vkBasalt info:  toggleKey = Home
[...]

strace.log:

[...]
34003 openat(AT_FDCWD, "vkBasalt.conf", O_RDONLY|O_LARGEFILE) = 12
[...]

So in order to have the "per-game" config file loaded, it has to be placed in /, actually.

I have only tested with DXVK Wine game, I don't know if this issue happens with Linux-native Vulkan applications. I don't have a Linux Vulkan game at hand.

Here is my complete (limited to open, openat and chdir calls) log: strace.log. Feel free to give me another test scenario to run and report on.

GoGoOtaku commented 2 years ago

I am unsure about wine but with Proton (basically fancy wine anyway). Under wine this happens because proton uses a sandbox. The users home folder gets linked but the /etc and /usr locations are overridden. This probably also causes the cd.

The config files in ~/config/vkBasalt/vkBasalt.conf and ~/.local/share/vkBasalt/vkBasalt.conf work.

Under proton the hosts files can still be accessed under /run/host which is then just the hosts /. Not sure if checking in there would be good practice tho. I also do not know at this point how vulkan itself does this since it evidently finds /usr/share/vulkan/implicit_layer.d/vkBasalt.json which is not linked. Could just be that it is loaded before the sandboxing tho.

I have found all this by dumping the proton command and then replace used echo '%command%" && combined with the original proton command but replacing the games executable with explorer.

guglovich commented 2 years ago

I've moved all the shaders and configuration file from /usr and everything works without any further manipulation.