cancel
Showing results for 
Search instead for 
Did you mean: 

Devgurus Discussion

knzivid
Adept I

Suggested way of running cross platform GPGPU tasks?

I have proprietary GPGPU algorithms that I would like to distribute to my end users.

I am looking for ways to achieve the following

  • Single source code for algorithms
  • Compatible with Windows and Linux
  • Be able to run on AMD, Intel, NVIDIA GPUs
  • Prevention of theft of my algorithms
  • Minimal loss of performance compared to vendor-specific GPGPU frameworks / languages

I have skimmed through the forum to see if any questions already answer this, but I could not find anything concrete that's very recent. As someone who is invested in supporting AMD GPUs as a first class citizen in my application, what are my possible avenues of achieving the same?

What is AMD's current stance on the supported GPGPU frameworks?

8 Replies
dipak
Big Boss

Based on the features you are looking for, I think, OpenCL might be a good choice (though it does not follow single-source programming style). Here are couple of other GPGPU frameworks/APIs supported by AMD that you may explore as well.

Please Note:

Both the above frameworks support single-source programming, however currently platform/hardware support is limited (AMD devices via ROCm platform and NVIDIA devices via CUDA).

Thanks.

 

What are AMD's suggestions for distributing OpenCL kernels to end users while protecting against intellectual property theft?

0 Likes

In general, there are couple of ways to provide OpenCL applications without distributing the kernel source code:

  1. Generate device specific pre-compiled binary (implementation dependent format) and distribute the binary that can be loaded on the target machine.
  2. Create implementation-independent SPIR code and distribute it. 

P.S. Currently AMD supports ingestion of SPIR 1.2 only on some devices.

Thanks.

You mention AMD supporting SPIR1.2 only on some devices. Is there a table of GPU families vs driver versions vs SPIR/SPIRV support? I would like to know this without having to purchase these devices.

0 Likes

SPIR 1.2 is mainly supported on the SI devices (1st generation GCN). SPIR-V is not supported yet.

Thanks.

0 Likes

Is there any OpenCL compatible, implementation independent IL that can run on post-GCN1 devices?

0 Likes

No.

0 Likes
Meteorhead
Challenger

As it currently stands, I would advise against OpenCL. Performance will not be portable. AMD and Nvidia have neglected their OpenCL runtimes for many years now. (AMD Windows runtime is old, ROCm is in much better shape. There is no word of AMD ever wanting to finish ROCm for Windows.)

If you only want to target GPUs, Vulkan is a much better choice, IP is protected by compiling to SPIR-V which all vendors support. SPIR is already dropped by AMD, so it is false advertising by dipak. cl_khr_spir extension never existed on ROCm, the old fglrx derivate hybrid drivers (AMDGPU-PRO on Linux and Windows to this day) report the extension as present, even though I asked AMD to remove it, because backing functions are missing. If you actually try to ingest SPIR code, you'll get runtime errors. This has been the case for almost a year now, 10-12 drivers came and went and nothing happens. AMD doesn't even take the common courtesy to remove a damned string from their drivers.

So in the current state, OpenCL is unadvised, unless you wish to carry its flag in the name of greater good. (Totally legit reason BTW.) If you actually want it to run, use Vulkan.