Remote execution of GLSL-Programs under Linux?

Hi,

I’m trying to write a program using shaders. For testing purposes I’ve written a small prog which only creates, compiles and links a simple shader. It works fine on my home PC and even at work.
But I can’t run the prog remote from home at work…
It seems that on remote execution the prog isn’t able to use the graphics hardware and thus can’t load the shaders.

My specs:
home: SuSe 11, x64, NV 9600 and gcc 4.x
work: Ubuntu, x86, NV FX5200 and gcc 2.9.5

My problem is, when I remote login with ssh -X (or -Y) glxinfo reports the specs of my home pc (on DISPLAY localhost:10.0). But I can’t set the env to i.e. :0.0 because that display isn’t active, of course. Also I can’t start a new X server on the remote machine because I’m not a sudoer.

Maybe it helps:
‘glewInit()’ succeeds, but
‘if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader)’ fails.
And the first malfunction is ‘glCreateShader(GL_VERTEX_SHADER)’ which returns 0 (but only on remote execution).
I encountered the same behaviour while I wasn’t in the video group.

So is there any possibility to run the shaders on the remote’s graphics card?

Best regards
Chris

The standard way to have X in remote can not use DRI, so can not take advantage of hardware acceleration.
Have a look at this instead :
http://www.virtualgl.org/

thanks, I’ll have a look at it but I guess I need to have root privileges on the remote machine?

Easiest thing you can do. From the client machine:

<sit down at server>
ssh -X clientmachine
<run opengl app on client>

The -X says to forward all X display protocol data (including any generated GLX protocol) from the client to the server’s X/Windows.

This will work for some GL apps but not others. The thing is that some apps require a direct rendering context (GLX is not direct rendering). Also, some/many of the newer OpenGL features have not had GLX protocol defined for them, so it is not possible to invoke them remotely. Worth a shot though.

Failing that, use VirtualGL or similar.

You can now get GLSL programs to work over remote display GLX to another machine if you get a recent driver from NVIDIA on both ends.

http://www.nvidia.com/object/linux_display_ia32_190.42.html
Added unofficial GLX protocol support (i.e., for GLX indirect rendering) for the following OpenGL extensions:

GL_ARB_geometry_shader4
GL_ARB_shader_objects
GL_ARB_texture_buffer_object
GL_ARB_vertex_buffer_object
GL_ARB_vertex_shader
GL_EXT_bindable_uniform
GL_EXT_compiled_vertex_array
GL_EXT_geometry_shader4
GL_EXT_gpu_shader4
GL_EXT_texture_buffer_object
GL_NV_geometry_program4
GL_NV_vertex_program
GL_NV_parameter_buffer_object
GL_NV_vertex_program4
GLX protocol for GL_EXT_vertex_array was also updated to incorporate rendering using GL_ARB_vertex_buffer_object. Use of these extensions with GLX indirect rendering requires the AllowUnofficialGLXProtocol X configuration option and the __GL_ALLOW_UNOFFICIAL_PROTOCOL environment variable.

I’ve tested the above driver and it works as vertex and fragment programs can be created and run on the remote graphics card.

However we need to push for GLX to be updated so this is official. If you know who to push let me know and perhaps we can do it together. They need to cover all the latest OpenGL in a timely manner, not every decade.

I’m getting tired of this untruth being spread. It seems each time someone asks about indirect OpenGL in Linux the same old untruth comes up again, be it here or on usenet or whereever. I wonder why. Maybe it’s because of nonituitive words, like “indirect DRI”. Maybe it’s just that some wrong information becomes firmly entrenched once it’s found it’s way into peoples brains. From Columbus and flatness of earth to the way and by whom and against whom witch trials were conducted.

Nevertheless:

The standard way to do remote X gives accelerated OpenGL in Linux. It uses DRI and is hardware accelerated and has been for years.
AFAIR there is no official GLX protocol for GLSL yet. Nvidia seems to have extensions for it though.

Philipp

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.