Error when compiling sample

Finally got it to compile on Visual studio 2017 but now the program shows the following error when compiling the sample

Error: [ComputeCpp:RT0100] Failed to build program (<Build log for program 0000019225E52060 device 0 (size 121):
Error: HSAIL doesn’t support OpenCL extension spir.
An invalid binary was detected.
Error: BRIG code generation failed.


ComputeCpp SYCL C++2.vcxproj -> C:\Users\PontiacGTX\source\repos\ComputeCpp SYCL C++2\x64\Debug\ComputeCpp SYCL C++2.exe

I have found this on AMD forums

Hi again,

Assuming, the device you are using is an AMD GPU, this error means that your graphics card’s OpenCL drivers do not support SPIR.

SPIR is an intermediate representation language that enables the creation and distribution of device-independent binaries within the OpenCL stack, which means that SYCL code cannot be compiled for a device which does not provide SPIR support, which is usually enabled by the cl_khr_spir extension.

Option 1
In this case, you may want to opt for an older AMD GPU driver but I cannot guarantee this would work, since I have not tried any of the AMD drivers on Windows.

Option 2
Modify your code to run on either the CPU or Host device using cpu_selector or host_selector when initializing your queue.

Could you also run computecpp_info which is located in the bin/ folder of where ComputeCpp is installed on your machine ? This will output some more information about your platforms and devices.


1 Like

More on this topic, and specifically about AMD GPU drivers for Windows, have a read through the following links:

#1 by @Meteorhead


I will try installing an old driver version which probably will work, do you know where would be located the files for SPIR in AMD drivers? would it belong to some opencl dll?

clinfo shows the support for

Version: OpenCL 2.0 AMD-APP (2841.5)
Extensions: cl_khr_fp64 cl_amd_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_gl_sharing cl_khr_gl_depth_images cl_amd_device_attribute_query cl_amd_vec3 cl_amd_printf cl_amd_media_ops cl_amd_media_ops2 cl_amd_popcnt cl_khr_d3d10_sharing cl_khr_d3d11_sharing cl_khr_dx9_media_sharing cl_khr_image2d_from_buffer cl_khr_spir cl_khr_subgroups cl_khr_gl_event cl_khr_depth_images cl_khr_mipmap_image cl_khr_mipmap_image_writes cl_amd_liquid_flash cl_amd_planar_yuv

either way AMD dropped the support on latest drivers

AMD seems that dropped opencl entirely since AMD APP SDK3.0 they went with amd’s ROCm and HIP(and they dont seem to want to port hip/rocm to windows)