Is there any efficient way to debug the kernel function of CUDA?
-
20-01-2021 - |
题
is there any good way the debug the kernel function when programming on GPU?
The way I use is using printf(...)
or copy the result back to CPU and then look on them.
I find it is too time-consuming to debug.
I appreciate your advice. Thank you.
解决方案
If you're on Windows, be sure to try NVIDIA Parallel Nsight (official debug tool from Nvidia)
其他提示
What about using a debugger?
If you are on windows you can use the VisualStudio Debugger . If you are on linux (better) you can use cuda-gdb.
The typical way to create a proper kernel is:
first implement the straightforward algorithm for the cpu only. then start with the simplest possible way of creating your kernel, upload/download data and compare the result of this first simple kernel to the results of the correct cpu kernel.
Then start add complexity and create new version of the kernel.