Check for Run-Time Issues failed on GPU but successed on CPU(cudaErrorIllegalInstruction)
Show older comments
When I use GPU coder to convert MATLAB source code, I get an error when I choose GPU to run the MEX file in Check for Run-Time Issues, but it runs successfully if I choose to test on the CPU. The error log is as follows.
Error using TABU_ALNS (line 5655)
Error generated while running CUDA-enabled program: [715,cudaErrorIllegalInstruction] an illegal instruction was encountered
Error in MainScript (line 89)
[BestSolution_M1, Best_obj] = TABU_ALNS(Order_inf,SN_nu,SN_rand,SBR_REL,R_qi_range,q_B,c_B,C_UNIT,t_ib,Tabu_PARA,ALNS_PARA);
It seems that there is a problem of using illegal instructions, but I don't know how to further locate the error, or what causes the file to run on the CPU but not on the GPU?
All suggestions are appreciated
5 Comments
Chao Luo
on 9 Apr 2025
Hi Shi,
It is hard to tell the issue from this error message. If you want the function TABU_ALNS to run on CPU, you can add coder.inline('never') inside the function and remove ahh coder.gpu.kernelfun and coder.gpu.kernel statememts if there are any.
We can investigate more if you can provide us the reproduction and your system info, like OS and GPU info.
Chao Luo
on 10 Apr 2025
Hi Shi,
We'd be happy to help identify the issue if we have your code. Just from the error and system info, we cannot tell what is wrong.
Shi
on 11 Apr 2025
Chao Luo
on 11 Apr 2025
Hi Shi,
We cannot identify the issue with only the entry-point function. Can you call customer support to create a case with all the code and reproduction steps? You can ask the customer support to escalate to dev team directly.
Answers (0)
Categories
Find more on Kernel Creation from MATLAB Code in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
