Can WriteImage/SaveScreentshot API run normally on Linux OS without GUI?

Dear ALL,
I meet several errors when run WriteImage/SaveScreentshot API on Linux OS without GUI. I want to hold the picture when rendering job is done. But my work operation system(centos 7.x) doesn’t install GUI. So I can’t use render() command in pvpython. Is there anyone knowing how to due with this situation? GUI is ordered not to be install cause I am using a public hpc workstation.
Thank you very much.

Youxin.

I’m not sure what you mean by “hold the picture” but you can still render and save screenshots as long as you have software-based rendering enabled on that workstation.

Try passing the --force-offscreen-rendering flag to pvpython

If that doesn’t work maybe you have to tell ParaView to use the software-based rendering like:
paraview-mesa pvpython --backend llvmpipe -- --force-offscreen-rendering script.py
or something like that. The extra -- is necessary.

Note that this is for PV5.7+, I think for earlier it would be:
pvpython --mesa-llvm --force-offscreen-rendering script.py

2 Likes

My suspicion is that you’re getting X-related errors since you don’t have an Xserver running on the HPC system. Where did you get the ParaView binaries from? If from paraview.org, try using the osmesa variant of the binaries – these are the binaries under the category “ParaView Server for Headless Machines”.

1 Like

Thank you, Utkarsh! With the “ParaView Server for Headless Machines” paraview project, I successfully run the render() api and save the screenshot finally.
Thank you a lot!

Youxin.

Hi, Theodore,
Thank you for your usefull help! Now I have figured out my problem by using the “ParaView Server for Headless Machines” paraview project.
You are really nice. Thank you very much!

Youxin.