GPGPU support for more devices
Context
Some apps will most likely benefit from having more GPGPU support for various devices eg. AMD ROCm HIP and Intel oneAPI. The most notable app that would benefit today is Blender:
https://code.blender.org/2021/11/next-level-support-for-amd-gpus/
https://code.blender.org/2022/09/intel-arc-gpu-support-for-cycles/
https://github.com/flathub/org.blender.Blender/issues/121
Description
It needs to be noted that HIP and oneAPI can work on multiple GPU vendors and are not mutually-exclusive to their respective vendors, however I think the initial implementation shouldn't focus on that but should be designed with this in-mind.
Two merge-requests would be designed to tackle ROCm/HIP and oneAPI separately.
Using Arch PKGBUILD as a rough guide here on what to package, as well as Blender's build system. This will most likely need refinement.
ROCm/HIP:
-
components/numactl.bst
https://github.com/numactl/numactl -
extensions/platform-hip/amd
and a Flatpak imageorg.freedesktop.Platform.HIP.AMD
-
extensions/platform-hip/amd/rocm-cmake.bst
https://github.com/RadeonOpenCompute/rocm-cmake -
extensions/platform-hip/amd/hsakmt-roct.bst
https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/ -
extensions/platform-hip/amd/hsa-rocr.bst
https://github.com/RadeonOpenCompute/ROCR-Runtime -
extensions/platform-hip/amd/rocm-device-libs.bst
https://github.com/RadeonOpenCompute/ROCm-Device-Libs extensions/platform-hip/amd/runtime.bst
-
extensions/platform-hip/amd/rocminfo.bst
https://github.com/RadeonOpenCompute/rocminfo -
extensions/platform-hip/rocm-llvm.bst
(not sure if this could go away and the latest llvm has everything needed?) - (optional, blender doesn't need it)
elements/extensions/platform-hip/nvidia/runtime.bst
and a Flatpak imageorg.freedesktop.Platform.HIP.Nvidia
(dependent onPlatform.GL.nvidia
) and would need CUDA at build-time.
The two runtimes use a combination of https://github.com/ROCm-Developer-Tools/hipamd, https://github.com/ROCm-Developer-Tools/HIP, https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime, https://github.com/ROCm-Developer-Tools/ROCclr.
oneAPI:
-
components/level-zero.bst
(oneAPI) https://github.com/oneapi-src/level-zero -
extensions/platform-oneapi/intel
and a Flatpak imageorg.freedesktop.Platform.oneAPI.Intel
(needs to be dependent onPlatform.VAAPI.Intel
for gmmlib, va). -
extensions/platform-oneapi/intel/compute-runtime.bst
https://github.com/intel/compute-runtime -
extensions/platform-oneapi/intel/intel-graphics-compiler.bst
https://github.com/intel/intel-graphics-compiler (just needscomponents/llvm.bst
and not a custom one?) -
extensions/platform-oneapi/opencl-clang.bst
https://github.com/intel/opencl-clang
Acceptance Criteria
I'd like to discuss the current proposal first before working on it. Should it live in freedesktop-sdk, or be separate like https://github.com/flathub/org.freedesktop.Platform.GL.nvidia ? Perhaps only the elements/components
like numactl
, level-zero
and other neutral dependencies should live in freedesktop-sdk? It might be likely that each vendor needs its own LLVM so it's a heavy addition, as well as the hsakmt-roct
needing to be in-sync with specific AMDGPU versions in the Linux kernel, and Intel probably too.