[Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH - Fix in a future build.

Ask here if you experience technical problems with X4: Foundations.

Moderator: Moderators for English X Forum

shmerl
Posts: 18
Joined: Fri, 5. Jul 19, 22:10

[Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH - Fix in a future build.

Post by shmerl »

Version: X4: Foundations (GOG) 2.50 Hotfix 1.
GPU: Sapphire Pulse Vega 56.

I tried to benchmark the game using Mesa's Vulkan overlay. However the overlay didn't show up. After some investigation, it turned out, that the game (X4 binary) does something weird to VK_LAYER_PATH environment variable, namely overrides it with "vulkan/linux" value, which makes Vulkan loader fail to load explicit layers, including the Mesa HUD I was trying to use.

See: https://bugs.freedesktop.org/show_bug.cgi?id=111054

Can you please fix it? The game shouldn't be overriding VK_LAYER_PATH like that.
edmondo
Posts: 14
Joined: Wed, 6. Nov 02, 20:31
x4

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH

Post by edmondo »

That's quite strange, but I've got it to run with some workarounds.

I've created an implicit layer definition in ~/.local/share/vulkan/implicit_layer.d like this:

Code: Select all

{
        "file_format_version" : "1.0.0",
        "layer" : {
                "name": "VK_LAYER_MESA_overlay_64",
                "type": "GLOBAL",
                "library_path": "/usr/lib64/libVkLayer_MESA_overlay.so",
                "api_version": "1.1.73",
                "implementation_version": "1",
                "description": "MESA Overlay Layer",
                "disable_environment": { "DISABLE_VK_LAYER_MESA_overlay": "1" },
                "enable_environment": { "ENABLE_VK_LAYER_MESA_overlay": "1" }
        }
}
And added following env variables to the launcher:

Code: Select all

VK_INSTANCE_LAYERS=VK_LAYER_MESA_overlay_64
ENABLE_VK_LAYER_MESA_overlay=1 
shmerl
Posts: 18
Joined: Fri, 5. Jul 19, 22:10

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH

Post by shmerl »

Yeah, I expect implicit layers to work. It's explicit ones that are messed up, due to the game messing up VK_LAYER_PATH variable.

A simpler way to work around it, is to create "vulkan/linux" subdirectories under the same location where your X4 binary is, and symlink your VkLayer_MESA_overlay.json there. That will use the hardcoded path in the game, and the HUD will come up.
timon37
EGOSOFT
EGOSOFT
Posts: 508
Joined: Fri, 14. Dec 12, 11:02
x4

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH

Post by timon37 »

Hi, it was needed for our testing.
I committed a fix, though I can't promise it'll be released with the next minor patch.
It might have to wait for a major release.
edmondo
Posts: 14
Joined: Wed, 6. Nov 02, 20:31
x4

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH - Fix in a future build.

Post by edmondo »

Thanks :)
shmerl
Posts: 18
Joined: Fri, 5. Jul 19, 22:10

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH

Post by shmerl »

timon37 wrote: Mon, 8. Jul 19, 12:00 Hi, it was needed for our testing.
I committed a fix, though I can't promise it'll be released with the next minor patch.
It might have to wait for a major release.
Great, thanks! By the way, for testing you can always override the location of the layers using the above mentioned environment variable explicitly when running the binary, so there is no need to hardcode it :)
shmerl
Posts: 18
Joined: Fri, 5. Jul 19, 22:10

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH

Post by shmerl »

timon37 wrote: Mon, 8. Jul 19, 12:00 Hi, it was needed for our testing.
I committed a fix, though I can't promise it'll be released with the next minor patch.
It might have to wait for a major release.
Just tested it with latest GOG release (2.60 hotfix 2). This issue is still there. Did you mean some major version like 3.x?
Imperial Good
Moderator (English)
Moderator (English)
Posts: 4931
Joined: Fri, 21. Dec 18, 18:23
x4

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH - Fix in a future build.

Post by Imperial Good »

I suggest checking if the issue still exists with the current beta (3.00). If it does then maybe it has been overlooked somehow.
shmerl
Posts: 18
Joined: Fri, 5. Jul 19, 22:10

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH - Fix in a future build.

Post by shmerl »

Imperial Good wrote: Wed, 25. Dec 19, 05:05 I suggest checking if the issue still exists with the current beta (3.00). If it does then maybe it has been overlooked somehow.
I don't have access to 3.0 unfortunately since GOG doesn't provide beta versions (and I have the GOG version). But I'll give it another test once 3.0 hits GOG.
Imperial Good
Moderator (English)
Moderator (English)
Posts: 4931
Joined: Fri, 21. Dec 18, 18:23
x4

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH - Fix in a future build.

Post by Imperial Good »

shmerl wrote: Wed, 25. Dec 19, 07:13 I don't have access to 3.0 unfortunately since GOG doesn't provide beta versions (and I have the GOG version). But I'll give it another test once 3.0 hits GOG.
Strange, according to the beta instructions GOG should offer the same betas as Steam.
viewtopic.php?f=192&t=405397
shmerl
Posts: 18
Joined: Fri, 5. Jul 19, 22:10

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH - Fix in a future build.

Post by shmerl »

Imperial Good wrote: Wed, 25. Dec 19, 07:15Strange, according to the beta instructions GOG should offer the same betas as Steam.
viewtopic.php?f=192&t=405397
Interesting, but I don't use Galaxy - it's not wired with Linux releases on GOG backend anyway - it only works with Windows ones. Do you know how to get beta Linux versions on GOG? I'd be really interested. The download through their site doesn't show anything beta related. I'll also ping GOG about it.
Imperial Good
Moderator (English)
Moderator (English)
Posts: 4931
Joined: Fri, 21. Dec 18, 18:23
x4

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH - Fix in a future build.

Post by Imperial Good »

shmerl wrote: Thu, 26. Dec 19, 02:52 Interesting, but I don't use Galaxy - it's not wired with Linux releases on GOG backend anyway - it only works with Windows ones. Do you know how to get beta Linux versions on GOG? I'd be really interested. The download through their site doesn't show anything beta related. I'll also ping GOG about it.
If the service is not available on Linux that I guess there is no Linux beta sadly.
Alan Phipps
Moderator (English)
Moderator (English)
Posts: 31702
Joined: Fri, 16. Apr 04, 19:21
x4

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH - Fix in a future build.

Post by Alan Phipps »

CBJ explained it here.
A dog has a master; a cat has domestic staff.
Rastuasi
Posts: 503
Joined: Mon, 1. Oct 18, 16:28
x4

Re: [Linux/bug] Vulkan layers don't work with X4 due to game overriding VK_LAYER_PATH - Fix in a future build.

Post by Rastuasi »

Linux Beta is not available on GoG.

Return to “X4: Foundations - Technical Support”