protonscr

Doesn't follow XDG basedir spec (XDG_DATA_HOME) when configuring Vulkan layers

steamopen
ValveSoftware/steam-for-linux#8337 · opened 2022-01-07 by smcv · updated 2023-09-21 · 3 comments · github
Ssmcv 2022-01-07 github

Your system information

  • Steam client version (build number or date): 1639697812 (2021-12-16)
  • Distribution (e.g. Ubuntu): tested on Ubuntu 18.04, but probably distro-independent
  • Opted into Steam client beta?: yes
  • Have you checked for system updates?: yes

Steps for reproducing this issue:

  1. Rename ~/.steam out of the way (or delete it, or use a newly-created user)
  2. Delete ~/.local/share/vulkan/implicit_layer.d (or move it out of the way, or use a newly-created user)
  3. Run: XDG_DATA_HOME="$HOME/mock-data-home" steam

Expected result

Steam should create steamfossilize_i386.json, steamfossilize_x86_64.json, steamoverlay_i386.json, steamoverlay_x86_64.json in ~/mock-data-home/vulkan/implicit_layer.d, where they will be found by all versions of Vulkan-Loader since 1.0.30.0 (specifically KhronosGroup/Vulkan-Loader@6e3ebec) in processes that inherit environment variables from Steam.

The Steam Runtime contains Vulkan-Loader 1.2.x (currently 1.2.170, but I'm looking into upgrading to 1.2.198), so we can rely on having at least that version.

Actual result

Steam creates those files in ~/.local/share/vulkan/implicit_layer.d, which will not be searched if XDG_DATA_HOME is set.

References

Layer discovery is documented here: https://github.com/KhronosGroup/Vulkan-Loader/blob/master/docs/LoaderLayerInterface.md#linux-layer-discovery

On Linux, it follows the XDG basedir spec, searching both the "config" and "data" stacks: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Other notes

I think Steam is correct to install its ICDs into the XDG "user-specific data files" path, but it should match the Vulkan loader's behaviour by following $XDG_DATA_HOME instead of hard-coding ~/.local/share.

To avoid duplication, it should probably do the equivalent of this for a transitional period, so that the files are removed from ~/.local/share and only written to $XDG_DATA_HOME, if different:

data_home=${XDG_DATA_HOME:-$HOME/.local/share}
rm $HOME/.local/share/vulkan/implicit_layer.d/steamoverlay_i386.json
cp $source_file $data_home/vulkan/implicit_layer.d/steamoverlay_i386.json
Ssmcv 2022-01-07 github

This is a small subset of #1890 that is necessary for interop with the Vulkan-Loader, so I think it would make sense to fix this part even if ~/.steam* need to continue to exist (which, if I understand correctly, they do, because they are "API" used by third-party games).

The larger request in #1890 is to stop using ~/.steam*, and I don't want to get into that.

Nnm004 2023-09-21 github

I encountered a similar issue. Icon files are placed in $XDG_DATA_HOME/icons directory, but .desktop files are placed in $HOME/.local/share/applications directory instead of $XDG_DATA_HOME/applications directory if you put a check "Create an application shortcut" during game installation.