Injection library causing crashes

Hello, I’ve been trying to run nsight systems (as well as nsight graphics) for the past few hours, and everytime it’ll always fail to connect to an opengl binary.

If I don’t put LD_PRELOAD environment variable, the binary runs but nsight just won’t connect to it.

If I put the LD_PRELOAD environment variable to point to the libToolsInjectionProxy64.so shared library, my opengl app crashes (that is: it fails to launch opengl), and glxgears (the test program that you can sudo apt-get install) fails to launch too.

What exactly needs to be done to make this work?

Thanks in advance

(note: I’ve also tried multiple versions of the graphics profiler nvidia put out that was ‘sunsetted’ by nsight).

(p.p.s I also have to wonder, what’s the difference between nsight systems and the nsight graphics profiler? The latter seems to have a fancier looking UI? What’s going on?)

There are three developer tools intended to be used in concert.

Nsight Systems is a low-overhead profiler that you can use to analyze your application’s behavior across all CPUs and GPUs. If you had a performance issue, you would start with this tool to find the problem areas. Once you have found your issue, you may want to use a different tool (deeper analysis, more overhead) to resolve it.If you find an issue with a particular CUDA kernel, use Nsight Compute (shipping in CUDA 9.2 toolkit) to debug/optimize that CUDA kernel. If you find an issue with a particular graphics shader, use Nsight Graphics to debug/optimize that shader.

Are you calling dlopen directly on libGL or libEGL? We currently only support direct calls into the library, rather than through another library. If you are, I’d like to work on getting a reproducer from you and get this fixed.

Thanks for getting back to me so quickly. I am using libGlew to access the OpenGL functions, and from a quick google it seems like it’s using glXGetProcAddress/wglGetProcAddress/aglGetProcAddress

Snippet from stackoverflow:

GLEW does this for you, it doesn't dlopen libGL, it uses glXGetProcAddress/wglGetProcAddress/aglGetProcAddress to get GL function pointers from the driver, and it's cross platform.

So basically if I replace glew with libGL, it would work? Perhaps that’s why glxgears work?

Yes, that is correct. If you use libGL directly, you should be fine. We are hoping to get this limitation fixed in the next version.