Closed ldouteau closed 8 months ago
Hi @ldouteau yes - it's related to X11 forwarding have you already had a look at https://vedo.embl.es/autodocs/content/vedo/vedo.html#running-on-a-server ?
From inside a python script you can also call:
import vedo
vedo.settings.start_xvfb()
# vedo.settings.initi_colab()
# ...
Hope this helps!
Hi Marco, Thanks for the answer & the reference to the docs, i missed it. It solves the issue i have with segfault at test collection. However, i'm still getting seg faults with the minimal example provided (screenshot of a cube). I tested both the python & bash versions. I get the following log, that is not very helpful. I tested that on Ubuntu 22.04 LTS with Python 3.10 & a fresh new virtual environment
/usr/bin/Xvfb
starting xvfb (can take a minute) ... xvfb started.
Aborted (core dumped)
Hi, does this script also crash?
import vtk
cone = vtk.vtkConeSource()
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(cone.GetOutputPort())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
ren = vtk.vtkRenderer()
ren.AddActor(actor)
renWin = vtk.vtkRenderWindow()
renWin.SetOffScreenRendering(True)
renWin.SetSize(500, 500)
renWin.AddRenderer(ren)
renWin.Render()
Hi Marco. Sorry for the late answer. Yes this script crashes too, with the following logs:
2024-03-12 11:57:47.543 ( 0.181s) [ 7F9ABA305000]vtkXOpenGLRenderWindow.:456 ERR| vtkXOpenGLRenderWindow (0x56447770bfc0): bad X server connection. DISPLAY=
Aborted (core dumped)
Hi, I' afraid then it's a problem with the server not starting.. unrelated to vedo. I would manually check on your server the individual steps in https://github.com/marcomusy/vedo/blob/9e68ef2a7ae7f3632067590319875fcf9fce9ebc/vedo/settings.py#L728
Ok, that's kind of what i expected when i tested your suggestion earlier today. As it's not critical for me i guess i won't investigate more on this. Thanks for your efficient support, as usual !
Hi,
I'm currently implementing some reg tests on an application that uses Vedo for visualization purposes. The test is very simple, just trying to make sure that my object gets created properly. I set up Vedo objects, call show (must not be very clever), that's it. Tests run properly on my laptop, both on Windows & WSL2. Using Python 3.11 & Pytest, Vedo 2024.5.1
When i tried to run CI on our Gitlab server, I got a segmentation fault at test collection. For some reason, upon collecting tests that include a
vedo.show
, Pytest segfaults immediately. After some testing, running the following piece of code on our sever (Ubuntu 22.04 LTS) generates a segfault, even though it takes a bit longer to get it. Thus my current workaround is to skip these reg tests when running CI.The logs I get are below. The visualization libraries (libGL) are installed on the server. As i don't get this failure in other platform i assume it's related to the absence of X11 forwarding or something (I know nothing about it sorry). I tried to track what happens in VTK, but couldn't find a better minimal example.
I understand that the procedure i followed has several caveats, from the reg test running show to the server not having display tools. Do you have any improvement to suggest ? I tried to turn off the interactivity of show, but that had no impact. More generally, do you have any suggestion for nice reg tests with Vedo ?
Sorry for the very unprecise question, and happy friday