Is it possible to use OpenCL backend on AMD GPUs? #9388
-
According to the documentation of oneAPI DPC++, currently the "official" way of using DPC++ on AMD GPUs is using the ROCm HIP backend. However, so far AMD only supports a few selected datacenter and workstation model in ROCm. From the documentation alone, it appears that there's no way to port DPC++ programs to desktop AMDGPU models. However, from a previous question from 2021, OpenCL backend on Nvidia GPU, I realized DPC++ in fact still has a OpenCL backend as a fallback, although it requires OpenCL 2.1. The questions are:
Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Hi! Not an official answer, but I tried using oneAPI with AMD consumer hardware recently: OpenCL backend of DPC++ uses SPIR-V, which is not supported in any current AMD driver. E.g., here's an old official AMD reply: https://community.amd.com/t5/opencl/amd-rx5700xt-opencl-2-1-suport-for-clcreateprogramwithil/td-p/423303; I haven't seen any related activity since then. That said, while ROCm HIP does not officially support consumer devices, it tends to work fine on them, as does DPC++. Note: since recently, DPC++ decided to use an explicit of supported architectures, and some consumer devices might be missing there, despite working with ROCm HIP; that is a bit annoying, but not too hard to work around. |
Beta Was this translation helpful? Give feedback.
-
Hi @biergaizi,
Yes, OpenCL is still one of the supported backends by this SYCL implementation and I haven't heard about any plans to deprecate it.
Yes, it should be possible. Strictly speaking, you don't even need OpenCL 2.1, but you need support for SPIR-V. It could also be achieved by supporting At DPC++ side, you would need to compile with Unfortunately, I don't have any practical experience with AMD devices (regardless of the backend). Please also see reply from @al42and with more practical data points. |
Beta Was this translation helpful? Give feedback.
Hi @biergaizi,
Yes, OpenCL is still one of the supported backends by this SYCL implementation and I haven't heard about any plans to deprecate it.
Yes, it should be possible. Strictly speaking, you don't even need OpenCL 2.1, but you need support for SPIR-V. It could also be achieved by supporting
cl_khr_il_program
by OpenCL runtimes of an older version or it could be OpenCL 3.0 which returns SPIR-V throughCL_DEVICE_IL_VERSION
(or other similar queries).At DPC++ side, you would need to compile with
spir64
targ…