Program execution crashing in Profiler Works fine when call directly

Was using the Profiler to optimize my CUDA program (works great, the Profiler, that is), then started modifying the code to use OpenGL interops to display the stuff I was calculating. There’s a command line option I use to control whether the output is displayed to an OpenGL window, or it is simply computed and left on the card. It’s been a couple weeks since I’ve used the profiler since I’ve just been trying to get the interop to work correctly. Finally have that done, and it works with command line parameters either way.

However, when I now attempt to run the profiler I get an error and the profiler gives up. Here’s the output:

=== Start profiling for session ‘Session1’ ===
Start program ‘U:/Code/CUDA/C/bin/win32/Release/VideoProcessor.exe -filename=C:/Run_005/test.raw -format=3’ run #1
Program run #1 failed, exit code: -1073740777
Error in program execution.

I put a printf right after the main() declaration in my program, and I don’t even get that, so the program is essentially crashing before a single thing is done (haven’t even queried a card or started parsing command line parameters!).

I Googled the (rather large) error code and couldn’t find a thing. Don’t even know where to begin since it never actually runs a single line of code and the code runs from the command line.

Could this have anything to do with the OpenGL stuff? Again, I’m not actually doing an OpenGL call when I attempt to profile because the command line parameter tells it not to do so. However, it may attempt to link at run time and bomb there. Anyone else run into this trying to profile with OpenGL stuff? Many thanks for any suggestions.

Alright, it looks like you can’t use the Profiler when you dynamically link to GL stuff. I haven’t isolated the ones in particular that caused the problems, but it’s one or more of the following:

#include <GL/glew.h>
#include <GL/glut.h>
#include <cuda_gl_interop.h>
#include <cutil_gl_inline.h>

I created a new #define as the control in a #ifdef-#end block where I placed the above commands (along with the associated calls in the source code), and when I compile such that these includes aren’t included (pun intended), the program runs fine, and it will Profile correctly.

A little bit of a bummer. Looks like I’ll have to optimize all my code outside a running OpenGL environment, then try to verify that it didn’t break when I put it back in.

Still curious if others have tried this and gotten to Profiler to work.