Skip to content

Instantly share code, notes, and snippets.

@mdouchement
Last active April 22, 2025 21:13
Show Gist options
  • Save mdouchement/6cb9d5ebdc0ce1ca7603e6eb567780b9 to your computer and use it in GitHub Desktop.
Save mdouchement/6cb9d5ebdc0ce1ca7603e6eb567780b9 to your computer and use it in GitHub Desktop.
Setup AMDVLK with Flatpak

For a few days I tried to create a org.freedesktop.Platform.GL.amdvlk package but I didn't get it work due to my lack of Flatpak Runtime knowledge and the few documentation about GL extensions.
I was starting to give up using AMDVLK in Flatpak when I think about, can I inject AMDVLK in the default Mesa driver org.freedesktop.Platform.GL.default? I tried and it works.
Here is the "hack" I did to make it work.

Setup

Download the latest Debian/Ubuntu release from https://github.com/GPUOpen-Drivers/AMDVLK/releases/latest Currently it's amdvlk_2025.Q1.3_amd64.deb, open it with an archive manager and open the data.tar.gz archive.

Open the folder ~/.local/share/flatpak/runtime/org.freedesktop.Platform.GL.default/ (this is the default "user" location, it is an another place for "system" Runtime).
Go in the following subfolder x86_64/24.08/active/files/ (24.08 is the current runtime-version used by Steam).

In this subfolder, put the AMDVLK files from the archive like this:

.
├── bin
├── glvnd
├── lib
│   ├── amdvlk64.so
│   └── vulkan
│       └── icd.d
│           └── amd_icd64.json
├── OpenCL
├── share
├── vdpau
└── vulkan

Edit the amd_icd64.json and update paths like in the other JSON files. It should be updated from /usr/lib/x86_64-linux-gnu/amdvlk64.so to /usr/lib/x86_64-linux-gnu/GL/default/lib/amdvlk64.so.

In my case I used mesa-git (https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/wikis/Mesa-git) installed in ~/.local/share/flatpak/runtime/org.freedesktop.Platform.GL.mesa-git/ because my GPU is not supported yet. In that case the path is /usr/lib/x86_64-linux-gnu/GL/mesa-git/lib/amdvlk64.so.

Then you can now launch Steam and AMDVLK should be used.
You can activate the vulkan_driver flag in your MangoHud config to see if it's loaded correctly.

mh-mesa-git-radv mh-mesa-git-amdvlk
RADV (Mesa) AMDVLK

Limitations

  • It seems the environment variable AMD_VULKAN_ICD is not working in the Flatpak environment, AMDVLK is always loading, AMD_VULKAN_ICD=RADV is not taken ito account. As a workaround:
    • To ensure AMDVLK is loaded, you can rename radeon_icd.x86_64.json to radeon_icd.x86_64.json_
    • To ensure RADV is loaded, you can rename amd_icd64.json to amd_icd64.json_
  • In Steam, this may work: VK_ICD_FILENAMES="insert you path to amd_icd64.json" %command%

Troubleshooting

  • If AMDVLK is not used, try to rename radeon_icd.x86_64.json to radeon_icd.x86_64.json_ or move it to another folder.
  • If your GL runtime is a complete mess, you can flatpak remove it and flatpak install again.

Uninstallation

Remove AMDVLK files or just rename amd_icd64.json to amd_icd64.json_ to disable AMDVLK.

@KosmX
Copy link

KosmX commented Apr 22, 2025

There is an easier, less invasive solution:

  1. Download the driver as usual, extract it to somewhere in your system (just avoid /bin, /usr and /lib).
  2. Update amd_icd64.json
  3. Use flatseal (or CLI to make that directory read-only for flatpaks)
  4. use this env var (or something like this): VK_ICD_FILENAMES=/path/to/amdvlk/amd_icd64.json

This way you don't need to corrupt local packages to make this hack work.
It also works with mesa ZINK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment