You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using NVTX from Julia, so I compile NVTX into a shared library as documented in https://github.com/NVIDIA/NVTX?tab=readme-ov-file#other-languages. This works fine on most platforms, but on Windows (where we build our binaries using MinGW compilers) NVTX segfaults during initialization. This reproduces in C, so doesn't look like a Julia issue. I'm using msys2 on Window 11, with the compilers from the mingw-w64-x86_64-toolchain package.
To simulate what we do in Julia, I'm using the following simple loader:
#include<stdio.h>#include<windows.h>typedefvoid (*NvtxInitializeFunc)(void*);
intmain() {
// Load the DLLHMODULEhLib=LoadLibraryA("nvToolsExt.dll");
if (hLib==NULL) {
fprintf(stderr, "Failed to load libnvToolsExt.dll. Error code: %lu\n", GetLastError());
return1;
}
// Get the function pointerNvtxInitializeFuncnvtxInitialize= (NvtxInitializeFunc)GetProcAddress(hLib, "nvtxInitialize");
if (nvtxInitialize==NULL) {
fprintf(stderr, "Failed to get nvtxInitialize function. Error code: %lu\n", GetLastError());
FreeLibrary(hLib);
return1;
}
// Call the function with NULL parameternvtxInitialize(NULL);
// Clean upFreeLibrary(hLib);
return0;
}
GDB reveals it indeed fails during initialization:
(gdb) bt
#0 0x00007ffcaa134a7e in ?? ()
#1 0x00007ffcaa131a0f in nvtxInitialize (reserved=0x0) at ./c/include/nvtx3/nvtxDetail/nvtxImplCore.h:317
#2 0x00007ff60c631508 in main () at loader.c:23
nvToolsExt.dll is deprecated as of NVTXv3. Work is in progress to create a replacement DLL for cross-language interoperability. We will keep you updated.
I'm using NVTX from Julia, so I compile NVTX into a shared library as documented in https://github.com/NVIDIA/NVTX?tab=readme-ov-file#other-languages. This works fine on most platforms, but on Windows (where we build our binaries using MinGW compilers) NVTX segfaults during initialization. This reproduces in C, so doesn't look like a Julia issue. I'm using msys2 on Window 11, with the compilers from the
mingw-w64-x86_64-toolchain
package.To generate
nvToolsExt.dll
, I do:To simulate what we do in Julia, I'm using the following simple loader:
$ cc -g loader.c -o loader && ./loader.exe zsh: segmentation fault ./loader.exe
GDB reveals it indeed fails during initialization:
x-ref JuliaGPU/NVTX.jl#37, also filed as NVIDIA bug 4262590.
The text was updated successfully, but these errors were encountered: