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.