What's the best way to do off-screen rendering with GPU acceleration

hi, i would like to use OpenGL for off screen rendering (i.e. no windows are opened) with GPU acceleration. which library shall I use and any example of how to use it?

i am looking for something like osmesa but with GPU acceleration

You can use pbuffer to create offscreen rendering context.

thank you! do you have an example for that?

i tried pbuffer, but it can only work on a local machine, i.e. i cannot start the job from another computer using ssh. i want to dispatch a job to run on several computers. is there a way to do this with pbuffer?

Hmmm…
For me, the best way is to use the extension GL_EXT_framebuffer_object.

http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt

http://download.nvidia.com/developer/presentations/2005/GDC/OpenGL_Day/OpenGL_FrameBuffer_Object.pdf

Originally posted by xdf103:
i cannot start the job from another computer using ssh.
To have hardware acceleration you need a X server with GLX. Even if the window is not displayed (hidden etc.).
So in this case you need to export DISPLAY={ip of distant server}:0.0 for your GL application to work. See xhost documentation to have the proper rights. You can test with running xterm from a distant machine, and when you get the xterm window show up on the machine which will run OpenGL commands, the setup is ok.

hmm messy, but should work. That is the price to pay for hardware acceleration, it is tyied to the videocard.

thanks! below is what i did:

  1. login to remote server using ssh
  2. export DISPLAY=:0.0
  3. use xhost to add local server to remote server and remote server to local server
  4. run the program

i still got the error “could not connect to x server”.

for the DISPLAY, i tried both {local ip}:0.0 and {remote ip}:0.0. neither works.

did i miss anything?

Originally posted by hseb:
[b] Hmmm…
For me, the best way is to use the extension GL_EXT_framebuffer_object.

http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt

http://download.nvidia.com/developer/presentations/2005/GDC/OpenGL_Day/OpenGL_FrameBuffer_Object.pdf [/b]
actually i am using framebuffer object too, but i use pbuffer to create an off screen rendering context. is there a way to create the rendering context without creating either a display window or pbuffer?

ok. I hate pBuffer… too heavy interface… :wink:

So with FBO, you can attach a texture with the size you want(same res as the screen rendering context if you want) then render inside it what you want. After, this texture can be used as a normal texture.

A simple and nice tutorial :

http://www.gamedev.net/reference/programming/features/fbo101/

hope it will help you…

Originally posted by xdf103:
i still got the error “could not connect to x server”.
Maybe there is no X server running on distant machine ? Do you have physical access to it ? You can try with a basic X program such as xterm or xlogo, and check the GL-related stuff later.

I can’t test at the moment, but searching “run X display env xhost” without quotes in a search engine can help.
This looks pretty good :
http://scv.bu.edu/Graphics/xstuff.html#XAPPLICATION

You may try ‘ssh -X remote-machine’ or ‘ssh -X your-username@remote-machine’ to login. This sets up your environment and connections under normal circumstances. I prefer this over the older ssh/rsh/xhost+/export business.

-SFR

thanks all for the replies! i finally got the thing to work after disabling x server access control on the remote server.

as for pbuffer, i don’t like pbuffer either. in fact, i only used pbuffer to create an active rendering context and all the processing are done using FBO. as most of the work involves rendering into some texture objects with different dimensions, FBO is more appropriate. is there a way to create a off screen rendering context without using pbuffer?

Originally posted by SFRuckus:
You may try ‘ssh -X remote-machine’ or ‘ssh -X your-username@remote-machine’ to login. This sets up your environment and connections under normal circumstances.
-SFR

…given the ssh service is configured to allow X11 forwarding. Check [or ask your admin to check] if /etc/ssh/sshd_config [or wherever is your sshd_config file] has the following settings:

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

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