Search code examples
cudansight

nsight VSE debugger error "code patching failed due to lack of code patching memory"


I am having a nsight debug error like following, when I was debugging a cuda kernel using nsight. I have no idea what that means. Looks like something to do with cuFFT. But can anyone give some pointers? Thanks.

enter image description here


Solution

  • As the error message reported by Nsight cleared indicated, the error is caused by Nsight having insufficient available memory on the device to interactively debug the code you are running. Quoting from the Nsight documentation:

    When the CUDA Memory Checker is enabled, it will consume extra memory on the GPU. If there is not enough patch RAM for the CUDA Debugger, it will give the following error:

    Internal debugger error occurred while attempting to launch "KernelName - CUmodule 0x04e67f10: code patching failed due to lack of code patching memory.
    

    If this happens, increase the patch RAM factor by going to Nsight > Options > CUDA > Code Patching Memory Factor.

    This is a multiplier of the kernel's instruction size, which is added to a base patch RAM size of 64k.

    Another option is to disable the shared or global memory checking, in order to use less patch RAM.

    The original poster noted that increasing the code patching memory factor from a ratio of 2 to 16 solved the problem.