SYCL and OpenCL for AMD gpu

I have an AMD 5700XT gpu and I am trying to learn SYCL but I have a lot of doubts of the current state of AMD gpu driver stacks. According to what I read, there are several driver stacks for AMD gpus: mesa, amdgpu and amdgpu-pro. If I understand correctly, mesa has its own opencl implementation and there is another implementation for the amdgpu drivers.

Also, amd has ROCm, which its another OpenCL implementation, HIP, which something like CUDA and some tooling, right?

enter image description here

There is at least 2 implementations, ComputeCpp and hipSYCL, which could possibly run SYCL on AMD gpus. Shouldnt the clang implementation be able to run also on AMD gpus, as according to the image it runs with OpenCL and SPIR-V devices?

In I understand correctly, there is also oneAPI, which is an implementation of SYCL (DPC++) with some extensions (SYCL 2020) and some libraries on top of that SYCL implementation (kind of what cuBLAS or cuSPARSE are to CUDA). Should it be possible to run oneAPI libraries on top of another SYCL implementation?

Fonally, if I use mesa for graphics (OpenGL and Vulkan), is it possible to run ROCm on top of that? How does ROCm and OpenCL mesa implementation interact with mesa graphic drivers?

As you can see I have a big confusion about all the ecosystem. Can someone provide some light on it?

Answer

My understanding is that there’s a single kernel driver, amdgpu. Mesa lives in userland and is an OpenGL implementation. amdgpu-pro provides alternative closed-source userland libraries (OpenGL, OpenCL etc).

clover is an OpenCL implementation on top of Mesa. I’m not sure what state it is in (my impression is that it was not very well maintained for some time and development has stalled), but I doubt it will be able to run SYCL programs.

ROCm is more than an OpenCL implementation. It’s AMD’s GPGPU platform, providing an AI platform, accelerated libraries, tools, and compilers. It also contains an OpenCL implementation.
HIP is not an OpenCL implementation, it’s effectively AMD’s implementation of the CUDA programming model.

To my knowledge, unfortunately no recent AMD OpenCL implementation is able to run SYCL programs because AMD neither supports SPIR nor SPIR-V. AMD OpenCL has never supported SPIR-V, so DPC++/clang won’t work. ComputeCpp can also work with SPIR, but support for that was removed already some time ago from AMD’s OpenCL implementation.

As far as SYCL support for AMD is concerned, hipSYCL usually is the way to go. Unfortunately, AMD does not support your specific GPU on ROCm (on which hipSYCL builds) because they focus ROCm support on chips that are also used in data center cards.
See here for more details:
https://github.com/RadeonOpenCompute/ROCm#supported-gpus

oneAPI is Intel’s umbrella term for their compute platform, providing libraries, tools and compilers (similarly to ROCm). DPC++/LLVM SYCL/Intel SYCL is part of oneAPI. All those terms refer to the same thing, namely Intel’s implementation of the Khronos SYCL 2020 standard. Pretty much all of Intel’s extensions have been merged into the SYCL 2020 specification, so don’t think about DPC++ as a separate language.

It is possible to add additional backends to oneAPI libraries, for example Codeplay has done so for NVIDIA. It is also in principle possible to port them to another SYCL implementation. We’re working on some groundwork to potentially move in that direction with hipSYCL by improving compatibility between hipSYCL and DPC++:
https://www.urz.uni-heidelberg.de/en/2020-09-29-oneapi-coe-urz

It is not possible to run ROCm on top of mesa. It’s a fully independent stack for GPU compute. As far as I know there is no interaction between ROCm and mesa.

Attribution
Source : Link , Question Author : jjcasmar , Answer Author : illuhad

Leave a Comment