glGenBuffers() call failing over remote display

I am testing some CUDA code, running on a remote Linux machine and displaying back to my desktop macintosh. The code is the basic_interop.cu example from the book CUDA By Example, by Sanders et al. When my code calls glGenBuffers(), it exits with the following error. Other GPU code from the book has been working fine, but then again, none of them call glGenBuffers(). Can anyone help me figure out why this is occurring? Thanks!

Xlib: extension “NV-GLX” missing on display “edge83:13.0”.
X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 150 (GLX)
Minor opcode of failed request: 187 ()
Serial number of failed request: 34
Current serial number in output stream: 34

Here is the body of main up until the fatal error:

int main( int argc, char **argv ) {
cudaDeviceProp prop;
int dev;

memset( &prop, 0, sizeof( cudaDeviceProp ) );
prop.major = 1;
prop.minor = 0;
HANDLE_ERROR( cudaChooseDevice( &dev, &prop ) );

// tell CUDA which dev we will be using for graphic interop
// from the programming guide:  Interoperability with OpenGL
//     requires that the CUDA device be specified by
//     cudaGLSetGLDevice() before any other runtime calls.

HANDLE_ERROR( cudaGLSetGLDevice( dev ) );

// these GLUT calls need to be made before the other OpenGL
// calls, else we get a seg fault
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA );
glutInitWindowSize( DIM, DIM );
glutCreateWindow( "bitmap" );

glBindBuffer    = (PFNGLBINDBUFFERARBPROC)GET_PROC_ADDRESS("glBindBuffer");
glDeleteBuffers = (PFNGLDELETEBUFFERSARBPROC)GET_PROC_ADDRESS("glDeleteBuffe

rs");
glGenBuffers = (PFNGLGENBUFFERSARBPROC)GET_PROC_ADDRESS(“glGenBuffers”);
glBufferData = (PFNGLBUFFERDATAARBPROC)GET_PROC_ADDRESS(“glBufferData”);

// the first three are standard OpenGL, the 4th is the CUDA reg 
// of the bitmap these calls exist starting in OpenGL 1.5
glGenBuffers( 1, &bufferObj );  // <------ ERROR OCCURS RIGHT HERE  ************

Can you check if the function pointers you got are non null ?

Can you then check (since you seem to have an nvidia card) that your nvidia drivers are properly installed, with

glxinfo

and

cat /proc/driver/nvidia/version

Also, ensure you have: Load “glx” in your /etx/X11/xorg.conf file.

Then post the results back.

Can you check if the function pointers you got are non null ?
Can you then check (since you seem to have an nvidia card) that your nvidia drivers are properly installed, with
glxinfo
and
cat /proc/driver/nvidia/version
Also, ensure you have: Load “glx” in your /etx/X11/xorg.conf file.
Then post the results back.

Dang, this forum does not seem to email you when you get a reply. Anyhow, thanks for the reply.
Here are my answers:

  1. The function pointers are non-NULL. I also tried simply not creating and assigning those variables and calling glGenBuffers() directly, and get the same results.
  2. Important note here: I am running on a remote machine and displaying back to my Mac via GLX. The code runs fine on my Mac as written, but not in this “display back” mode. glxinfo looks reasonable to me – it’s a long output, so do you want me to post part of it?
  3. rcook@edge83 (chapter08): cat /proc/driver/nvidia/version
    cat: /proc/driver/nvidia/version: No such file or directory
    Due to system administration issues, the OpenGL driver is in /usr/nvidia/lib64 and we use LD_LIBRARY_PATH to point to it. The driver
    But please note that other OpenGL codes run fine, as long as they do not call glGenBuffers().
    The code I’m using is a simplification of the chapter08 code from CUDA by Example.
    I do get a warning about NV-GLX extension, but again, other OpenGL code seems to work fine despite this, and for sure, glGenBuffers should not cause my code to exit without returning, right?

rcook@edge83 (chapter08): glxinfo
name of display: edge83:14.0
Xlib: extension “NV-GLX” missing on display “edge83:14.0”.
display: edge83:14 screen: 0
direct rendering: No
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_SGIX_fbconfig, GLX_SGIS_multisample, GLX_ARB_multisample,
GLX_EXT_visual_info, GLX_EXT_import_context
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
client glx extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_SGI_video_sync,
GLX_NV_swap_group, GLX_NV_video_out, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGI_swap_control, GLX_EXT_swap_control, GLX_ARB_create_context,
GLX_ARB_create_context_profile, GLX_NV_float_buffer,
GLX_ARB_fbconfig_float, GLX_EXT_fbconfig_packed_float,
GLX_EXT_texture_from_pixmap, GLX_EXT_framebuffer_sRGB,
GLX_NV_present_video, GLX_NV_copy_image, GLX_NV_multisample_coverage,
GLX_NV_video_capture, GLX_EXT_create_context_es2_profile,
GLX_ARB_create_context_robustness
GLX version: 1.2
GLX extensions:
GLX_SGIX_fbconfig, GLX_ARB_multisample, GLX_EXT_visual_info,
GLX_EXT_import_context, GLX_ARB_get_proc_address
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Radeon HD 4870 OpenGL Engine
OpenGL version string: 1.4 (2.1 ATI-1.6.24)
OpenGL extensions:
GL_ARB_transpose_matrix, GL_ARB_vertex_program, GL_ARB_window_pos,
GL_EXT_multi_draw_arrays, GL_EXT_rescale_normal,
GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_NV_texgen_reflection,
GL_NV_light_max_exponent, GL_SGIS_generate_mipmap, GL_ARB_imaging,
GL_ARB_point_parameters, GL_ARB_texture_env_crossbar,
GL_ARB_texture_border_clamp, GL_ARB_multitexture, GL_ARB_texture_env_add,
GL_ARB_texture_cube_map, GL_ARB_texture_env_dot3, GL_ARB_multisample,
GL_ARB_texture_env_combine, GL_ARB_texture_compression,
GL_ARB_texture_mirrored_repeat, GL_ARB_shadow, GL_ARB_depth_texture,
GL_ARB_fragment_program, GL_ARB_fragment_program_shadow,
GL_ARB_occlusion_query, GL_ARB_point_sprite,
GL_ARB_texture_non_power_of_two, GL_ARB_draw_buffers,
GL_EXT_framebuffer_object, GL_EXT_texture_env_add, GL_EXT_blend_color,
GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_texture_lod_bias,
GL_EXT_abgr, GL_EXT_bgra, GL_EXT_stencil_wrap,
GL_EXT_texture_filter_anisotropic, GL_EXT_separate_specular_color,
GL_EXT_secondary_color, GL_EXT_blend_func_separate, GL_EXT_shadow_funcs,
GL_EXT_stencil_two_side, GL_EXT_texture_compression_s3tc,
GL_EXT_texture_mirror_clamp, GL_NV_blend_square, GL_NV_fog_distance,
GL_ATI_texture_mirror_once, GL_SGIS_texture_lod

Not sure if I understood well.
Your glxinfo reports strange things for me (nvidia card, and ati card ??). Maybe is it due to the remote display ?

Other question: I’ve thought that glx isn’t supported on Mac. Maybe I’m wrong ?

Sorry for not beeing able to help you more at this time.

PS: did you tried direct rendering (without a remote server) ? Since I think that it’s “necessary” to have direct rendering to use accelerated opengl functionalities under Linux.

Well, then, let’s take the mac out of it. The problem also occurs when displaying over GLX to my Linux laptop. The error number is different, but it’s the same behavior, that is, an exit on glGenBuffers(). There is no console on the remote machine unfortunately – it’s the backend of a 200 node visualization cluster.

rcook@edge83 (chapter08): ./a.out
X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 128 (GLX)
Minor opcode of failed request: 187 ()
Serial number of failed request: 38
Current serial number in output stream: 38

Here is the output from glxinfo displaying to that machine:

name of display: edge83:18.0
display: edge83:18 screen: 0
direct rendering: No
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control,
GLX_EXT_swap_control, GLX_EXT_texture_from_pixmap, GLX_ARB_create_context,
GLX_ARB_create_context_profile, GLX_ARB_multisample, GLX_NV_float_buffer,
GLX_ARB_fbconfig_float, GLX_EXT_framebuffer_sRGB
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
client glx extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_SGI_video_sync,
GLX_NV_swap_group, GLX_NV_video_out, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGI_swap_control, GLX_EXT_swap_control, GLX_ARB_create_context,
GLX_ARB_create_context_profile, GLX_NV_float_buffer,
GLX_ARB_fbconfig_float, GLX_EXT_fbconfig_packed_float,
GLX_EXT_texture_from_pixmap, GLX_EXT_framebuffer_sRGB,
GLX_NV_present_video, GLX_NV_copy_image, GLX_NV_multisample_coverage,
GLX_NV_video_capture, GLX_EXT_create_context_es2_profile,
GLX_ARB_create_context_robustness
GLX version: 1.4
GLX extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control,
GLX_EXT_swap_control, GLX_EXT_texture_from_pixmap, GLX_ARB_create_context,
GLX_ARB_create_context_profile, GLX_ARB_multisample, GLX_NV_float_buffer,
GLX_ARB_fbconfig_float, GLX_EXT_framebuffer_sRGB,
GLX_ARB_get_proc_address
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro NVS 135M/PCI/SSE2
OpenGL version string: 3.2.0 NVIDIA 195.36.24
OpenGL extensions:
GL_ARB_color_buffer_float, GL_ARB_compatibility,
GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, GL_ARB_depth_texture,
GL_ARB_draw_buffers, GL_ARB_fragment_coord_conventions,
GL_ARB_fragment_program, GL_ARB_fragment_program_shadow,
GL_ARB_fragment_shader, GL_ARB_framebuffer_object,
GL_ARB_framebuffer_sRGB, GL_ARB_half_float_vertex, GL_ARB_imaging,
GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_point_parameters,
GL_ARB_point_sprite, GL_ARB_provoking_vertex, GL_ARB_shading_language_100,
GL_ARB_shadow, GL_ARB_texture_border_clamp, GL_ARB_texture_compression,
GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map,
GL_ARB_texture_env_add, GL_ARB_texture_env_combine,
GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3,
GL_ARB_texture_float, GL_ARB_texture_mirrored_repeat,
GL_ARB_texture_non_power_of_two, GL_ARB_texture_rectangle,
GL_ARB_texture_rg, GL_ARB_vertex_program, GL_ARB_window_pos,
GL_ATI_draw_buffers, GL_ATI_texture_float, GL_ATI_texture_mirror_once,
GL_S3_s3tc, GL_EXT_texture_env_add, GL_EXT_abgr, GL_EXT_bgra,
GL_EXT_blend_color, GL_EXT_blend_func_separate, GL_EXT_blend_minmax,
GL_EXT_blend_subtract, GL_EXT_Cg_shader, GL_EXT_draw_range_elements,
GL_EXT_fog_coord, GL_EXTX_framebuffer_mixed_formats,
GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB,
GL_EXT_gpu_program_parameters, GL_EXT_multi_draw_arrays,
GL_EXT_packed_float, GL_EXT_packed_pixels, GL_EXT_provoking_vertex,
GL_EXT_rescale_normal, GL_EXT_secondary_color,
GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, GL_EXT_stencil_wrap,
GL_EXT_texture3D, GL_EXT_texture_array, GL_EXT_texture_compression_latc,
GL_EXT_texture_compression_rgtc, GL_EXT_texture_compression_s3tc,
GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod,
GL_EXT_texture_lod_bias, GL_EXT_texture_mirror_clamp,
GL_EXT_texture_object, GL_EXT_texture_shared_exponent,
GL_EXT_texture_sRGB, GL_EXT_texture_swizzle, GL_EXT_timer_query,
GL_EXT_vertex_array, GL_EXT_vertex_array_bgra, GL_IBM_rasterpos_clip,
GL_IBM_texture_mirrored_repeat, GL_KTX_buffer_region, GL_NV_blend_square,
GL_NV_copy_depth_to_color, GL_NV_depth_clamp, GL_NV_float_buffer,
GL_NV_fog_distance, GL_NV_fragment_program, GL_NV_fragment_program_option,
GL_NV_fragment_program2, GL_NV_geometry_shader4, GL_NV_gpu_program4,
GL_NV_light_max_exponent, GL_NV_multisample_coverage,
GL_NV_multisample_filter_hint, GL_NV_packed_depth_stencil,
GL_NV_parameter_buffer_object2, GL_NV_register_combiners,
GL_NV_texgen_reflection, GL_NV_texture_compression_vtc,
GL_NV_texture_env_combine4, GL_NV_texture_expand_normal,
GL_NV_texture_rectangle, GL_NV_texture_shader, GL_NV_texture_shader2,
GL_NV_texture_shader3, GL_NV_vertex_program1_1, GL_NV_vertex_program2,
GL_NV_vertex_program2_option, GL_NV_vertex_program3,
GL_NVX_gpu_memory_info, GL_SGIS_generate_mipmap, GL_SGIS_texture_lod,
GL_SGIX_depth_texture, GL_SGIX_shadow, GL_SUN_slice_accum

The thing that annoys me is that glxinfo reports there is no direct rendering.

Can you post pertinent lines of your xorg.conf file (mainly the module section and driver section).

There’s no direct rendering because I’m displaying back to my linux desktop, of course. By definition GLX is indirect rendering, no? Which xorg.conf file do you want me to post? I assume you want the one on my desktop?

Sorry, I can’t help you more… If you’re sure everything works fine without remote display and gen buffers failed on remote displays then it seems you’re tring to do something not allowed. Sorry again.

Why do you say it’s not allowed? Is glGenBuffers not supported by GLX? I never said everything works fine without remote display. I’m thinking this is a “hard problem” and I’ll move it to the advanced forum. :slight_smile: BTW, how’s the weather in France? :slight_smile:

I have moved this to the “advanced forum”, here: http://www.opengl.org/discussion_boards/…amp;#Post287915