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

Problem: Headless rendering with nvidia and using libOpenGL.so #27

Closed
tasptz opened this issue Jul 13, 2019 · 1 comment
Closed

Problem: Headless rendering with nvidia and using libOpenGL.so #27

tasptz opened this issue Jul 13, 2019 · 1 comment

Comments

@tasptz
Copy link

tasptz commented Jul 13, 2019

How can I make pyopengl use libOpenGL.so and not libGL.so.
For detailed explanation see Pro Tip: Linking OpenGL for Server-Side Rendering.

To use glX and OpenGL today, you should link against libOpenGL.so as well as libGLX.so. The first contains the OpenGL symbols, the latter the GLX symbols. If you want to use EGL context management instead, link against libOpenGL.so and libEGL.so.

I used lsof -p <pid> and for sure the python process loaded libGL.so and thus the EGL-OpenGL context was not working.

@tasptz
Copy link
Author

tasptz commented Jul 13, 2019

diff --git a/OpenGL/platform/egl.py b/OpenGL/platform/egl.py
index 8a92d018..d52f9157 100644
--- a/OpenGL/platform/egl.py
+++ b/OpenGL/platform/egl.py
@@ -33,7 +33,7 @@ class EGLPlatform( baseplatform.BasePlatform ):
         try:
             return ctypesloader.loadLibrary(
                 ctypes.cdll,
-                'GL', 
+                'OpenGL',
                 mode=ctypes.RTLD_GLOBAL 
             )
         except OSError:```

This seems to resolve the problem, but is probably not a universal solution.

mcfletch added a commit that referenced this issue Dec 30, 2019
Apparently the advice that we should use libOpenGL really isn't
universally applicable. Ubuntu 18.04 *does* seem to have it, though
that might be because of an installed package. Ubuntu 19.10 does
*not* have libOpenGL by default.
mcfletch added a commit that referenced this issue Jan 4, 2020
* 3e9791f Bump release to 3.1.5
* d06c1ac NUMPY Register intc and uintc as handled scalar types
* 38edb04 WIN FIX GL entry points are NULL on windows initially
* 57b7706 TESTS Run accelerate tests from base tox as well
* 60aec44 BUILD Update cython source with current release
* c26398b TESTS Switch to pytest.mark for skipping numpy handler when not available
* 6ec398d TESTS Switch to assertRaises
* 581d240 TESTS Don't print glget calls, compressed image api call revert
* 8cf737d API More support for using short-string types for convenience
* 1b7c3c3 API In ctypes arrays allow for numpy style short-string type specifiers
* eb9a6b4 FIX Work around weird numpy scalar behaviour (0-dimension arrays)
* d625f8b TESTS reason cannot be passed as a keyword argument in pytest.skip
* f12403b WGL FIX Set the resstyle for getCurrentDC in the wrapper
* 143ecbc GITHUB #7 Use b-strings instead of as_8_bit
* 44a89fe GITIGNORE Ignore .pyd files for Windows develop builds
* a52215f TESTS Fix usage of glCompressedTexImage2D in test_core
* 2f401a0 EGL Allow eglGetDeviceQueryString without display, use to display drm name
* c4cd5d0 BUILD Back out adding python3.8 to the build matrix
* 447fbfa BUILD Continue trying to get sdl to compile
* bdb957b BUILD Add libsdl1.2-dev to get the sld-config utility
* dccbbb6 BUILD Revert attempts to use arm64 (pygame doesn't build) but add python 3.8
* 907ec4a BUILD Experiment with testing on arm64 (loosely related to GH #29)
* 637caf4 TESTS Remove flaky test in favour of more robust one below it
* 144ce85 EGL DEMO Further refactoring of os_egl setup
* a07c956 EGL DEMO Allow for null values in EGL debug table formatting
* 9f115ff EGL Explicitly export EGLError from the EGL namespace
* c58c9c4 EGL Move code to debug, rely on EGLError for display, debug configs
* 93d6f66 EGL DEMO PPM writing and tabular format of configs in EGL debug module
* 9640630 FIX Fix latebind __bool__ definition as __nonzero__ isn't available
* 8628ce1 EGL Allow ErrorCheckers to specify GLError sub-classes, use for EGLError
* 1f1cda4 FORMAT Black formatting for os_egl demo/test script
* 0ed754b FIX for #27 to work on machines where libOpenGL is not present
* 589d3ca EGL Make `eglGetPlatformDisplay` an alternate with `eglGetPlatformDisplayEXT`
* e04bee4 FIX Add on for the fix to #6 to make force_extension functions bool() work
* 2487c21 EGL DEMO Try to create script to query the egl device enumerations
* 41e6f57 EGL DEMO Explicitly delete the DISPLAY environment variable to force offline operation
* 4a40d2b TESTS Ignore the output of osmesa and egl tests
* 3c81386 EGL DEMO Attempt to get an offscreen (pbuffer) render wrapper working
* 8f8d3e8 FIX #27 Load libOpenGL instead of libGL for egl platform
* 4f9cb46 DOCS Add pyrender as a sample source
* d401885 FIX GH #12 Include pxd files in the source-code release
* ca2cbbe DEMO Attempt to recreate github #33 without success
* ce8c5d5 DOCS Update comment to note that we're next to the main checkout now
* f85d8ce DOCS Update tartley projects to github urls, provide first-line links on gh and bb
* e81584a DOCS Skip generation of .xhtml redirect stubs
* 5f206da DEMO provide a running version of code in bug report in #34
* bf3fe7c FIX Explicitly add nonzero methods for base latebind classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants