We are shipping our Linux applications with pre-compiled GPU binaries for different device architecture (Tahiti, Hawaii, Fiji, Tonga, Ellesmere, Baffin, etc.).
The compilation is done by calling clCreateContextFromType with CL_CONTEXT_OFFLINE_DEVICES_AMD=1 and then running clCreateProgramWithSource, clBuildProgram. clGetProgramInfo(CL_PROGRAM_BINARIES).
When trying to do this on Linux with the 17.30 driver, neither 'gfx900' nor 'gfx901' are returned in the list of available devices for the program.
Below are the details of the tests conducted:
Test #1:
Environment: VMWare virtual machine, CentOS 6.5, AMDAPPSDK-2.9
Extracted libamdocl64.so, libamdocl12cl64.so, libamdocl32.so, libamdocl12cl32.s from amdgpu-pro 17.30 driver and placed to /home/user/bin/ATI_DRV/catalyst-17.30
export OPENCL_VENDOR_PATH=/home/user/bin/ATI_DRV/vendors
export LD_LIBRARY_PATH=/home/user/bin/ATI_DRV/catalyst-17.30:${LD_LIBRARY_PATH}
[user@localhost ~]$ ls /home/user/bin/ATI_DRV/catalyst-17.30
libamdocl12cl32.so libamdocl12cl64.so libamdocl32.so libamdocl64.so
[user@localhost ~]$ ls /home/user/bin/ATI_DRV/vendors
amdocl32.icd amdocl64.icd
[user@localhost ~]$ cat /home/user/bin/ATI_DRV/vendors/amdocl64.icd
libamdocl64.so
Expected:
OpenCL is capable of generating binaries for gfx900 and gfx901
Actual:
Offline compilation is not working: clGetPlatformIDs() fails with error CL_PLATFORM_NOT_FOUND_KHR (1001)
Notes:
The same procedure works without issues with files extracted from 15.9, 15.12, 16.50 drivers.
Test #2:
Environment: ASUS Crosshair V Formula-Z Motherboard, AMD FX-8350 CPU, AMD R9 290 GPU, CentOS 7.3, AMDAPPSDK-3.0
Installed and running driver amdgpu-pro 17.30 (ROCm components are not installed)
Expected:
OpenCL is capable of generating binaries for gfx900 and gfx901
Actual:
Offline compilation is capable of generating binaries for the following families only: Hawaii, Tahiti, Pitcairn, Capeverde, Oland, Bonaire, Spectre, Spooky, Kalindi, Hainan, Iceland, Tonga, Mullins, Fiji, Carrizo, Ellesmere, Stoney.
Neither gfx900 not gfx901 is present in the list.
Test #3:
Environment: Same as test #2, plus: Removed AMDAPPSDK-3.0
Installed ROCm components according to https://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-CentOS-Install-Uninstall.aspx
Expected:
OpenCL is capable of generating binaries for gfx900 and gfx901
Actual:
Same as test #2