enthought / enthought/mayavi

OffScreen Rendering

Open
#145 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

Hi, I was searching on Google about this, but there are different opinions.
What's the best way to get OffScreen rendering? I want to avoid the pop out window when producing many images from Mayavi

If I use

```
# The offscreen Engine.
from mayavi.api import OffScreenEngine
# Create the MayaVi offscreen engine and start it.
e = OffScreenEngine()
# Starting the engine registers the engine with the registry and
# notifies others that the engine is ready.
e.start()
# Create a new scene.
win = e.new_scene()
```

I usually get an error:

```
The program 'python' received an X Window System error.
This probably reflects a bug in the program.
The error was 'GLXBadContextTag'.
(Details: serial 81 error_code 173 request_code 155 minor_code 5)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
```

The same error is produced if I try:

```
mlab.options.offscreen = True
```

before doing the usual Mayavi scripting.

A different approach would be using `xpra`. I started a display (xpra -start :30, for example) and
I executed my script in that display, but I only get black images. I was thinking that it could be a problem with OpenGL. And the same behaviour is when I use

```
xvfb-run --server-args="-screen 0 1024x768x24" python my_script.py
```

which is in the documentation.

Regards,
David

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.