Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running pyvista on headless machine with Centos OS #521

Closed
chen112p opened this issue Oct 25, 2021 · 1 comment
Closed

running pyvista on headless machine with Centos OS #521

chen112p opened this issue Oct 25, 2021 · 1 comment

Comments

@chen112p
Copy link

Hello, I understand this topic has been discussed few times. Wondering if anyone made it work on a headless virtual machine with Centos OS. All I am trying to do is to load existing vtk files and put them together as a gif animation.
I have installed Xvfb
image
and mesa-libGL. Also, created a shell script to config Xvfb
image

But still when running the python script, it tells me 'could not find a decent visual'
image

I have checked that there is a xvfb process running in the background:
image

Can you tell what i missed and where i did wrong here?

Thanks!

Junting

Originally posted by @chen112p in #190 (comment)

@chen112p chen112p changed the title running pyvista on headless machine using Centos running pyvista on headless machine withCentos OS Oct 25, 2021
@chen112p chen112p changed the title running pyvista on headless machine withCentos OS running pyvista on headless machine with Centos OS Oct 25, 2021
@redoules
Copy link

redoules commented Mar 15, 2022

Hello,
Xvfg seems to be unmaintained.
I've got some good results with XDummy.

First I made sure OpenGL is installed with xdummy

yum install mesa-libGL mesa-dri-drivers xorg-x11-drv-dummy xserver-xorg-video-dummy

I then created a config file for XDummy (dummy-1920x1080.conf)

Section "Monitor"
  Identifier "Monitor0"
  HorizSync 28.0-80.0
  VertRefresh 48.0-75.0
  Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection

Section "Device"
  Identifier "Card0"
  Driver "dummy"
  VideoRam 256000
EndSection

Section "Screen"
  DefaultDepth 24
  Identifier "Screen0"
  Device "Card0"
  Monitor "Monitor0"
  SubSection "Display"
    Depth 24
    Modes "1920x1080_60.00"
  EndSubSection
EndSection

I then started Xdummy on the server

sudo X :99 -config dummy-1920x1080.conf

Once the server started, make sure you export the environnement variables

export DISPLAY=:99
export MESA_GL_VERSION_OVERRIDE=3.2

After than I managed to run a python program that was using VTK
python headless.py

Note that for pyvista, you might need to export some additionnal env variables

export PYVISTA_OFF_SCREEN=true
export PYVISTA_USE_IPYVTK=true

Useful links for reference :
https://stackoverflow.com/questions/8545291/opengl-glx-extension-not-supported
https://stackoverflow.com/questions/27407774/get-supported-glsl-versions
https://docs.mesa3d.org/envvars.html
https://github.com/gcaufield/MonkeyContainer/blob/master/dummy-1920x1080.conf
https://vtk.org/pipermail/vtkusers/2018-April/101556.html

@pyvista pyvista locked and limited conversation to collaborators May 15, 2022
@tkoyama010 tkoyama010 converted this issue into a discussion May 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants