I saw in the documentation that is it possible to have callbacks for NVTX functions.
The documentation states that you need to set the NVTX environment variables appropriately like this:
/* Set env so CUPTI-based profiling library loads on first nvtx call. */
char *inj32_path = "/path/to/32-bit/version/of/cupti/based/profiling/library";
char *inj64_path = "/path/to/64-bit/version/of/cupti/based/profiling/library";
setenv("NVTX_INJECTION32_PATH", inj32_path, 1);
setenv("NVTX_INJECTION64_PATH", inj64_path, 1);
What is this path supposed to point to? Im not sure.
When I try to cast CUpti_CallbackData (like below), i also get an identifier undefined error.
nvtxMarkA_params *params = ((nvtxMarkA_params*)(cbdata->functionParams)); // error: identifier "nvtxMarkA_params" is undefined
What is this path supposed to point to? Im not sure.
NVTX_INJECTION32/64_PATH should point to libcupti.so which should be located at /extras/CUPTI/lib64 if you are using CUPTI APIs directly in your target application
OR
NVTX_INJECTION32/64_PATH should point to the library or the framework that you have built based on CUPTI
When I try to cast CUpti_CallbackData (like below), I also get an identifier undefined error.
To use NVTX callbacks you need to include a bunch of headers to resolve the undefined error
#include “cupti.h” // CUPTI header #include “nvtx3/nvToolsExt.h” // Standard NVTX header #include “generated_nvtx_meta.h” // Includes definition of the callbacks structure to use for NVTX
Please let us know if this resolves your error/doubt
CUPTI team is planning to add a sample to show NVTX usage using CUPTI in future release.
Thanks.