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

Relax PyOpenGL version requirement to support OSMesa for offscreen rendering #295

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

javierganan99
Copy link

@javierganan99 javierganan99 commented Sep 14, 2024

Solves #293. This PR relaxes the PyOpenGL version dependency, enabling compatibility with OSMesa for offscreen rendering. Testing was conducted on Python versions 3.10 through 3.12, across both Ubuntu (22.04 and 24.04) and Fedora, using PyOpenGL 3.1.7.

Steps to enable OSMesa-based offscreen rendering:

Install OSMesa ang GLU libraries:

Debian-based distributions (e.g., Ubuntu, Debian):

apt-get install libosmesa6-dev libglu1-mesa

Red Hat-based distributions (e.g., Fedora, RHEL, CentOS, AlmaLinux, Rocky Linux):

dnf -y install mesa-libGL mesa-libOSMesa-devel mesa-libGLU

Once the appropriate packages are installed, set the environment variable PYOPENGL_PLATFORM=osmesa either in your shell or within your Python script:

import os
os.environ["PYOPENGL_PLATFORM"] = "osmesa"
import pyrender
# Your rendering code here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant