OpenGL interoperability

Hi all… I am trying to execute a sample program given in CUDA Programming guide for OpenGL interoperability with CUDA. I compiled the program with

nvcc -lGL -lglut -lGLEW -lGLU

I attached the program here. Its compiled successfully with out errors. But it giving Segmentation fault (core dumped) whenever i tried to execute it. Can any one please tell why its giving segmentation fault ? Do i have any mistakes in program ? (2.45 KB)


It’s glGenBuffers() that’s crashing. You’ll need to create a window before allocating the handles. Try adding glutCreateWindow(“test”); after glutInitWindowPosition(0, 0);


Thanks you very much. Its working now.