CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > ParaView

Using offscreen rendering

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 23, 2012, 08:53
Default Using offscreen rendering
  #1
JPW
New Member
 
James Walker
Join Date: Jul 2012
Posts: 6
Rep Power: 4
JPW is on a distinguished road
I have create some scripts for producing images and animations of data rendered in ParaView. I run these scripts in pvbatch, but a window opens in the top left when the script is ran, and closes at the end.

How can I achieve total off-screen rendering?

I have also used the flag --use-offscreen-rendering, but I still get the same result.

The help for --use-offscreen-rendering says :"This option only works with software rendering or mangled mesa on Unix". I am using Red Hat Linux. How can I enable this?


Thanks for any help
James
JPW is offline   Reply With Quote

Old   July 24, 2012, 15:07
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi James,

OK, here there are (at least) two possibilities:
  1. You might have to install the "mesa utils" system package. This one I can't confirm myself before the end of this week.
  2. You might need to build your own version of ParaView!
    If you were using OpenFOAM, it should or would be as simple as using the right options in makeParaView... if not, then again only at the end of this week would I be able to look deeper into this.
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 25, 2012, 04:19
Default
  #3
JPW
New Member
 
James Walker
Join Date: Jul 2012
Posts: 6
Rep Power: 4
JPW is on a distinguished road
Hi Bruno,

if you could let me know the results that would be great!

At the moment I am using Xvfb (X virtual framebuffer) so that nothing is shown to the screen.


Thanks
James
JPW is offline   Reply With Quote

Old   July 30, 2012, 17:02
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi James,

OK, the test machine (virtual in fact) was an Ubuntu 11.10 x86_64. The test script I used was this:
Code:
from paraview.simple import *
cone = Cone(Resolution=32)
cone.Center = [1, 2, 3]
shrinkFilter = Shrink(cone)
shrinkFilter.UpdatePipeline()
Show(shrinkFilter)
Render()
WriteImage('test2.png')
The command line, directly from ParaView's "bin" folder was:
Code:
./pvbatch --use-offscreen-rendering
With or without the command "Render()", it still opens an X window, but nothing is rendered inside that window. This might be because of the mesa drivers that I had installed on the test system.

As for RHEL, it looks like you need to install the package "mesa-libOSMesa" (and maybe "mesa-libOSMesa-devel" as well). The "OSMesa" stands for:
Quote:
Originally Posted by http://www.xfree86.org/4.8.0/DRI8.html#16
OSMesa (Off-Screen Mesa) is an interface and driver for rendering 3D images into a user-allocated block of memory rather than an on-screen window.
Last but not least, you can also try this:
Quote:
Originally Posted by preichl View Post
Setting the environment variable via the command below worked for me.

export LIBGL_ALWAYS_INDIRECT=y
With this option, the window was only opened very briefly!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 11, 2014, 10:07
Default
  #5
Member
 
Join Date: Mar 2009
Posts: 72
Rep Power: 8
aerogt3 is on a distinguished road
I have a cluster on which I am trying to run, but keep getting the following errors:

Quote:
ERROR: In /depot/ParaView-v4.1.0-src/VTK/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx, line 531
vtkXOpenGLRenderWindow (0x3497320): bad X server connection. DISPLAY=:0. Aborting.
I am able to run a python script which writes images using pvbatch. I am able to do so by manually launching pvbatch on one of the cluster nodes, and the images are properly written and the --use-offscreen-rendering flag seems to work as intended (the cluster has no graphics cards anywhere.)

However, as soon as I run on multiple nodes via submit script, I get the above errors. Here are the relevant parts of my submit script:

Quote:
module load openmpi/1.6.5

/usr/mpi/gcc/openmpi-1.6.5/bin/mpiexec -n 128 /opt/paraview/4.1.m/bin/pvbatch --mpi --use-offscreen-rendering script.py script_args
aerogt3 is offline   Reply With Quote

Old   August 17, 2014, 11:56
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings aerogt3,

Only today did I finally managed to give a quick look into this.
Quote:
Originally Posted by aerogt3 View Post
I am able to run a python script which writes images using pvbatch. I am able to do so by manually launching pvbatch on one of the cluster nodes, and the images are properly written and the --use-offscreen-rendering flag seems to work as intended (the cluster has no graphics cards anywhere.)
According to my searches online and the test I made on my machine, it seems that we are able to use the "offscreen" option when there is a valid setting in "DISPLAY". In other words, if you run the following commands on your local machine or on the target node:
Code:
pvbatch --use-offscreen-rendering test.py
unset DISPLAY
pvbatch --use-offscreen-rendering test.py
The first command will work just fine, without any windows appearing, but the second command will give the same complaint.

Therefore, either you used "ssh -X" or a VNC connection to access the cluster node, so that there was a valid display ready to be used for off-screen rendering.

The solution seems to be to build ParaView with OSMesa: http://www.paraview.org/Wiki/Setting...OSMesa_support - which means OSMesa will then have to be installed on all cluster nodes and the same ParaView build will also have to be installed on them.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rendering your CFD results - general discussion cfdnewbie Main CFD Forum 47 May 8, 2015 10:12
CFX problem in ubuntu (linux) Vigneshramaero CFX 0 July 13, 2012 10:22
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 01:52
Paraview rendering quality spurwonofjp OpenFOAM 2 May 25, 2010 13:16
Volume rendering in paraview33 aunola OpenFOAM Paraview & paraFoam 0 October 4, 2008 15:35


All times are GMT -4. The time now is 01:44.