Skip to content

About

No description, website, or topics provided.

Resources

Stars

20 stars

Watchers

3 watching

Forks

Latest commit

 

History

56 Commits

Folders and files

Repository files navigation

rocm-flatpak

The AMD ROCm stack built from TheRock 7.14 sources for Flatpak 26.08.
This builds two artifacts: ROCm Runtime and ROCm SDK.

The ROCm Runtime provides the ROCm userspace stack together with a full AMD Mesa build for OpenGL, EGL, GLX, GBM, Vulkan, VA-API and OpenCL. The runtime extension is published on the Flatpak GL ABI branch 1.4, so it can bind to Freedesktop/KDE runtimes that use a different base branch.

The ROCm SDK provides amd-llvm, hipcc, and all of the tools AMD ship for building ROCm accelerated code. This is largely untested as yet as I don't have a use case for this. However it successfully builds the AMD runtimes we ship here.

Installation

  1. Download the latest release from the Release section, already packaged as a .flatpak.
flatpak install <x>.flatpak

Usage

  1. Using ROCm for OpenCL and graphics: Currently the Freedesktop SDK doesn't know how to autoload the AMD ROCm extension. Until it does you'll need to update the FLATPAK_GL_DRIVERS environment variable to run ROCm apps. Example:
❯ export FLATPAK_GL_DRIVERS=ROCm

Use ROCm alone, not ROCm:default. The runtime now includes its own Mesa stack, so loading the Freedesktop default driver as well would duplicate the GL drivers and can cause conflicts.

If you previously used ROCm:default, remove default from the list.

If you use systemd, you can use the following to set this permanently into your environment:

mkdir -p ~/.config/environment.d
echo FLATPAK_GL_DRIVERS=ROCm | tee ~/.config/environment.d/60-flatpak_gl_drivers.conf

After a logout and login, or reboot you should see FLATPAK_GL_DRIVERS set in the environment.

The latest 7.14.1 rebuild includes a patched OpenCL ICD loader and no longer requires OCL_ICD_VENDORS. If you upgraded from an older 7.14.1 release, remove any existing override:

❯ flatpak override --user --unset-env=OCL_ICD_VENDORS <app-id>

For a system-wide override, use sudo flatpak override --system --unset-env=OCL_ICD_VENDORS <app-id>.

Older 7.14.1 releases still need the override because their bundled loader only looks in /etc/OpenCL/vendors/. If you are using one of those and clinfo reports zero platforms, set it with the trailing slash intact:

❯ flatpak override --user --env=OCL_ICD_VENDORS=/usr/lib/x86_64-linux-gnu/GL/OpenCL/vendors/ <app-id>

ClInfo:

❯ flatpak run --device=all --command=/bin/bash --devel org.freedesktop.Platform.ClInfo
[📦 org.freedesktop.Platform.ClInfo ~]$ clinfo
Number of platforms                               2
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 23.0.2 (git-4d5e73870e)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   AMD Accelerated Parallel Processing
  Platform Vendor                                 Advanced Micro Devices, Inc.
  Platform Version                                OpenCL 2.1 AMD-APP (3513.0)
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd cl_amd_event_callback
  Platform Extensions function suffix             AMD
  Platform Host timer resolution                  1ns

Issues, Workarounds and Caveats

  1. /dev/kfd

If you use Flatpak < 1.18 : the --device=dri flag doesn't enable access to /dev/kfd, which is required for ROCm to function. You'll need to pass --device=all to any apps to allow ROCm to see /dev/kfd. You can use Flatseal to add this to apps and make it permanent.

Flatpak > 1.18: enabling GPU permissions for a Flatpak app will pass through /dev/kfd.

About

No description, website, or topics provided.

Resources

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages