My apologies for this delayed reply. I'll check the binary and get back to shortly. Meanwhile, it would be helpful if you can share your setup details and relevant host-side code. Btw, do you see the same error if you use clBuildProgram instead of separate compile and link?
Thanks for you reply. My GPU card is AMD FirePro V3900. The OpenCL version
is 1.2. "cl_khr_spir" is supported. Actually, I first used clBuildProgram.
It crashed with the same message. Then I changed to clCompileProgram and
clLinkProgram. I found it actually crashed at clLinkProgram. The host side
code is as follows:
test1.bc", std::ios_base::in |
FDebugPrintf("cannot open file: %s", "
size_t stBinary = ifs.tellg();
char* pData = new char[stBinary];
clProgram = clCreateProgramWithBinary(openCLApp.context, 1, &openCLApp.device,
(const size_t) &stBinary, (const unsigned char*) &pData, NULL, &status);
status = clCompileProgram(clProgram, 1, &openCLApp.device, "-x spir", 0,
NULL, NULL, NULL, NULL);
clProgram = clLinkProgram(openCLApp.context, 0, 0, 0, 1, &clProgram, NULL,
//status = clBuildProgram(clProgram, 1, &openCLApp.device, "-x spir
-cl-std=CL1.2 -cl-opt-disable", NULL, NULL);
Thank you very much.
I was able to build your binary code successfully using one of our SDK samples (AMD APP SDK\3.0\samples\opencl\cl\1.x\SimpleSPIR). I just replaced existing SPIR file (MatrixTranspose_SPIR.fe.bc) with your binary file and the code worked fine (got error CL_INVALID_KERNEL_NAME which is expected). Could you please check that sample and share your findings?
Thank you for your suggestion. I tried to replace the
"MatrixTranspose_SPIR.fe.bc" with "test1.bc" (the binary file I uploaded)
in simpleSPIR project. It still crashed with the same error message. I
attached the screen shot.
If I replace "test1.bc" with "MatrixTranspose_SPIR.fe.bc" in my host code.
It can be built successfully.
My GPU card is AMD Firepro V3900. Following is the driver version which
supports OpenCL 1.2 and spir. I am wondering whether this is a special
issue only associated with this GPU card on some particular OpenCL C
statements. I think this is the latest driver for this GPU card. Is that
Yes, 15.201.2401 is the latest driver available for FirePro V3900.
Today I tried with this driver on a FirePro V5900 card (as I couldn't manage the FirePro V3900 card here) and it still worked fine. Last time, I checked it on two Radeon cards with two different drivers.
At this moment, I'm not sure whether the issue is specific to your card (or setup) or something else. I'll check with the concerned team. Also, I'll try to manage a FirePro V3900 card. Please share your clinfo output and system details.
If you've other cards, you may check the same to see whether you still observe the error or not. Btw, is it working if you build the binary for CPU device?
Sorry for my late reply. This week I was busy with other emergent tasks. As
what you suggested, I tried to build the binary code on CPU device. It
worked fine. I just bought another AMD GPU card, Radeon R9 390. After I
install the new GPU card on my PC, I will build the binary code and let you
know the results.
I tried to build the binary code (test1.bc) in the SimpleSPIR project in
SDK by replacing "MatrixTranspose_SPIR.fe.bc" with "test1.bc".
CLBuildProgram crashes with the same error msg. If I replace
"test1.bc" with "MatrixTranspose_SPIR.fe.bc" in my project, it worked
fine. CLBuildProgram can build successfully. So I guess my setting should
If you can find FirePro V3900 GPU card, please try to build "test1.bc" on
it. It seems this crash only happens with this piece of code and FirePro
V3900. If you have any findings, please let me know.
Yes. Could you please send me the binary file?
I already sent you the binary files. Please find the attached files (test1_1.bc.zip, test1_2.bc.zip) from my previous reply.
Sorry for my late reply. I got the binary files (test1_1.bc and test1_2.bc)
and tried to build them in simpleSPIR project. Both of them worked fine.
But when I tried to build them in my project, crash still happened. I don't
know the reason. Do you have any clue about this?
Sorry for this delayed reply. I was on vacation so couldn't check the project.
It seems that build option "-cl-opt-disable" (or "-O0") might be the reason. Could you please remove the build option "-cl-opt-disable" (shown below) and check?
status = clBuildProgram(clProgram, 1, &openCLApp.device, "-x spir -cl-std=CL1.2 -cl-opt-disable", NULL, NULL);