We used to compile our OpenCL code on a virtual machine without an AMD GPU by extracting all DLL files from AMD driver to a folder in PATH. This worked fine until at least Catalyst 17.8.2 and allowed us to compile binaries for up to Vega 56/64 (gfx900).
When we tried to do the same for Radeon VII (gfx906) and used the Adrenaline 19.2.2 driver, clGetPlatformIDs returned CL_PLATFORM_NOT_FOUND_KHR. We are thus unable to ship our products with binaries for Radeon VII.
Steps to reproduce:
1. Prepare a clean virtual machine (we use Windows 7) without any AMD GPUs
2. Install OpenCL SDK (we use APP SDK 3.0)
3. Create a folder and extract all binary files from the Adrenaline 19.2.2 package to that folder
4. Add this folder to PATH
5. Make sure that HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors includes the 'amdocl64.dll' DWORD value.
6. Compile a simple C-program that tries to initialize OpenCL like this:
#include "CL/cl.h"
int main(int argc, char** argv)
{
cl_uint numPlatforms;
cl_int status = clGetPlatformIDs(0, NULL, &numPlatforms);
printf("status-1: %d\n", status);if(status == CL_SUCCESS && numPlatforms > 0)
{cl_platform_id* platforms = (cl_platform_id*)malloc(numPlatforms * sizeof(cl_platform_id));
status = clGetPlatformIDs(numPlatforms, data.platforms, NULL);printf("status-2: %d\n", status);
}}
7. Run the program. Status will be -1001 (CL_PLATFORM_NOT_FOUND_KHR).
Now if in step 3 you use binaries from Catalyst 17.8.2 instead, the code will work just fine.
Solved! Go to Solution.
Just wanted to report that the issue is resolved in Adrenalin 19.7.1.
Thank you for your assistance, Dipak.
With Adrenaline 19.2.2, does the above issue also occur for any other GPU devices? Or only for Radeon VII (gfx906)?
By the way, I assume you tried this driver: amd-radeon-vii
Thanks.
Thanks Dipak.
I can't even get to the actual compilation for gfx906 or any other devices -- our in-house OpenCL-based offline compiler simply fails when tries to initialize OpenCL as described in the post.
I will specifically check 19.3.4 from the link you provided and let you know the results.
Tested with 19.3.4 -- same result.
Please find the corrected listing below (the previous one did not compile):
#include "CL/cl.h"
#include "stdio.h"
#include "stdlib.h"
int main(int argc, char** argv)
{
cl_uint numPlatforms;
cl_int status = clGetPlatformIDs(0, NULL, &numPlatforms);
printf("status-1: %d\n", status);if(status == CL_SUCCESS && numPlatforms > 0)
{
cl_platform_id* platforms = (cl_platform_id*)malloc(numPlatforms * sizeof(cl_platform_id));
status = clGetPlatformIDs(numPlatforms, platforms, NULL);printf("status-2: %d\n", status);
}
}
Hi Dipak,
any updates on this?
What is the proper way to obtain a binary file for an OpenCL program on a virtual machine that can be later used on a physical Windows-based computer with Radeon VII by calling clCreateProgramWithBinary + clBuildProgram?
Thank you,
Tim
Sorry for this delayed reply. I've asked our OpenCL team for suggestion. Once I get their reply, I'll share with you.
By the way, thank you for sharing those details.
Thanks.
Update:
A bug ticket has been created against the issue. I'll let you know if I get any further update about it.
Thanks.
Thanks Dipak.
Looking forward to the response from the relevant team.
Hi Dipak,
could you please provide an update on the issue? Our customers are requesting support for Radeon VII in our products which we currently cannot provide, so it's becoming quite urgent.
From our internal issue tracking system, the issue seems still under investigation. I will try if I can get any further information about it. Thank you for your patience.
Thanks.