This is a contained/standalone ROCm bundle in a dwarfs archive that can be mounted and LD_PRELOADED. Main purpose is to provide ROCm to Flatpak, as the Freedesktop Platform is still missing ROCm runtimes.
It is actually just a repackaging of amdgpu-install ROCm packages.
It is reccomended that you install dwarfs beforehand. If it is not already installed. this script installs a compressed universal binary to ~/.local/bin
There are three scripts, concerning installing, you only need two: install.sh and integrate.sh.
This is not to be used, this is just for transparency on how the bundle is made. And will be used in the future for CI/CD pipelines, as of now, packaging is done manually.
This will check for for availability of dwarfs in the system, if doesn't exist, it will download the universal binary and install it to ~/.local/bin. And then will download the portable ROCm bundle and mount it to $HOME/.local/rocm and set up auto mounting on login.
This will set up ROCm environment variables to a Flatpak app. Adding global env override may break things, so integrate.sh operates on a per-app basis.
./integrate.sh <flatpak-app-id-1> <flatpak-app-id-2> ...
Want to use this outside flatpak too? You can use /etc/ld.so.conf.d/rocm-portable.conf or directly to /etc/ld.so.conf with content:
/path/to/rocm-portable-mount/lib
as well as add /etc/OpenCL/vendors/rocm-portable.icd with content:
libamdocl64.so
- Install dwarfs with method of your choosing (tarball, AUR, universal binary, COPR, PPA, etc)
- Download one of the portable ROCm bundles below
- Use dwarfs to mount the bundle to
$HOME/.local/rocm - Create icd file
$HOME/.local/rocm/etc/OpenCL/vendors/rocm-portable.icdwith content:
libamdocl64.so
or
$HOME/.local/rocm/lib/libamdocl64.so
Note $HOME should be expanded to your home directory, as in you write the absolute path to the file. 5. Add these global flatpak overrides
--filesystem=~/.local/share/OpenCL:ro--filesystem=~/.local/rocm:ro--filesystem=/sys/module/amdgpu:ro
- Run
integrate.shto set up ROCm environment variables for your app of choice (or add overrides yourself)