GPU Coder used, but got error: Error generated while running CUDA-enabled program: [700,cudaE​rrorIllega​lAddress]

20 views (last 30 days)
Tong Zhao
Tong Zhao on 14 Jun 2021
Commented: First on 7 Dec 2021
I'm using GPU coder to accelerate N-D interpolation function interpn().
Everything worked fine when my problem scale was small, i.e. interpolating in 1-D or 2-D dimensions. But when I throw a larger problem, of 5-D interpolation to it, MATLAB threw the following error message:
Error generated while running CUDA-enabled program: [700,cudaErrorIllegalAddress] an
illegal memory access was encountered. To generate additional debugging information,
enable the 'SafeBuild' GPU code generation option.
I followed the error message suggestion above and added the 'SafeBuild' GPU code generation option, and got the following error instead:
Error generated while running CUDA-enabled
program: [46,cudaErrorDevicesUnavailable] all
CUDA-capable devices are busy or unavailable
I know that when I wasn't using GPU Coder, the code still worked but kind of slow. But now when GPU coder is enabled, it is not working. I have NVIDIA RTX 2080ti with 11G memory. When I was using CPU to do the calculation, the problem took 1 hour and peak RAM use was around 40GB out of 64GB RAM. Could this error be because I ran out of GPU memory by establishing my problem too large? How can I tell if this is the case?
OK update: I rebooted my Windows PC, and ran the same program again, the following error showed instead:
Error generated while running CUDA-enabled
program: [2,cudaErrorMemoryAllocation] out of
I think this confirms that indeed my problem is causing GPU to run out of memory just to start the problem. Now I know the problem, is there any suggestions how to split the problem for interpn? Thanks!
First on 7 Dec 2021
hi may i know the solution ? i met same error of cuda out of memory but its quite weird. Same code can run cpu1+gtx980 but error above when i run on cpu2+gtx980 and cpu2 has more much more cores and memory than cpu1.

Sign in to comment.

Answers (0)




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!