Hi,
I am new to Cuda profiling. I got an illegal memory access from my code and wanted to use the compute-sanitizer to find the source of the problem. I tried the following command (as admin):
compute-sanitizer --tool memcheck RayTracing.exe
But I get:
========= COMPUTE-SANITIZER
========= Error: Target application terminated before first instrumented API call
========= Tracking kernels launched by child processes requires the --target-processes all option.
I couldn’t find a solution among the topics in this forum that refered to that error.
I am on Windows 11, using the latest cuda 12.3 and Visual Studio.
This might very well be my fault, but the error message does not give me enough information to solve this.
I am happy to add more information if needed.
Thanks, can you please dump the output of command nvidia-smi and compute-sanitizer --version?
Also, can you double-check RayTracing.exe contains calls to the CUDA runtime API? Add a cudaFree(0); as the first line of your main function and verify whether or not the issue is addressed.
Adding cudaFree(0); does not change the output. What I did not mention previous is that before the error message appears in the console a warning window appears:
Microsoft Visual C++ Runtime Library
Debug Error!
Program: …
abort() has been called
Hi @aladram,
I figured it out.
As the error message says, memcheck did work until the application itself threw an error. Because of this error memcheck never reached a cuda function.
Turns out the problem was reading files using relative file paths. Visual Studio uses a different working directory compared to plain executing the app or running memcheck. That way I didn’t get any errors in Visual Studio, but the App crashed when using memcheck.