Re: GPU programming?

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Mon, 05 Feb 2024 11:17:57 UTC
Alexander Leidinger <Alexander@Leidinger.net> writes:

> ROCm: No idea. I have not seen any report about it working or even
> being tried. But there was at least some discussion about it:
>     https://github.com/ROCm/ROCm/issues/138
>     https://github.com/ROCm/ROCm/issues/1913

AFAIU (never owned an AMD GPU):
- ROCm requires amdkfd.ko which drm-kmod doesn't provide since
  https://github.com/freebsd/drm-kmod/commit/a381f46adf8b
- ROCm has poor *consumer* GPU support thus unattractive for
  volunteers/community to spend time porting

> Intel: Maybe. We have spirv ports in the tree, and my limited
> understanding is, that SPIR-V comes into play when someone wants to do
> GPU compute there. CCing Jan as the port maintainer for the two spirv
> ports. Maybe he can shed some light on this part.

- Vulkan Compute works fine on every modern GPU (used at least by ncnn)
- OpenCL works fine on Intel + AMD via Rusticl (Mesa), see
  https://cgit.freebsd.org/ports/commit/?id=d8990eff958b
- OpenCL + oneAPI Level Zero via lang/intel-compute-runtime requires userptr, see
  https://github.com/FreeBSDDesktop/kms-drm/issues/197

As a volunteer I've burned out porting Intel stuff, so hopefully Rusticl
kills Intel NEO (intel-compute-runtime) while Vulkan Video kills VA-API
(libva-intel-media-driver) and QuickSyncVideo (intel-media-sdk + onevpl)

Related https://www.phoronix.com/news/David-Airlie-oneAPI-Meetup