All Projects → eduble → gl

eduble / gl

Licence: BSD-3-Clause license
OpenGL headless on linux (EGL)

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to gl

ux-dx
The core for UX Components and UX Animate
Stars: ✭ 13 (-40.91%)
Mutual labels:  egl
Perlin-Noise-3D-Voxel-Generator
Voxel generator based on perlin 3d noise | Python OpenGL
Stars: ✭ 22 (+0%)
Mutual labels:  pyopengl
python-opengl-tutorial
Python opengl-tutorial base on PyOpenGL.
Stars: ✭ 118 (+436.36%)
Mutual labels:  pyopengl
Pigs-In-A-Blanket
A Piglet/ShaccCg Wrapper Library for OpenGL ES 2.0 Support on the Vita
Stars: ✭ 37 (+68.18%)
Mutual labels:  egl
Caincamera
CainCamera is an Android Project to learn about development of beauty camera, image and short video
Stars: ✭ 2,397 (+10795.45%)
Mutual labels:  egl
Glad
Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.
Stars: ✭ 2,296 (+10336.36%)
Mutual labels:  egl
Glew
The OpenGL Extension Wrangler Library
Stars: ✭ 1,953 (+8777.27%)
Mutual labels:  egl
rpi-opengl-without-x
Raspberry Pi OpenGL ES 2 without an X server (using EGL)
Stars: ✭ 120 (+445.45%)
Mutual labels:  egl
polyred
📺 3D Graphics in Go.
Stars: ✭ 31 (+40.91%)
Mutual labels:  egl
eglfs
🚀 EGL fullscreen platform plugin
Stars: ✭ 21 (-4.55%)
Mutual labels:  egl

May 31 2021: I wrote this repository in hope it could be useful for anyone else, but this was a very temporary project for me. I am no longer working on this subject and have no time to maintain it. So this repository is now archived.

OpenGL headless on linux (EGL): sample program

This repository contains a sample python program which runs GPU computations (OpenGL) in headless mode (no display).

The program initializes an OpenGL context using EGL (and, optionally, GBM). It will connect to kernel DRM interface file at /dev/dri/<something>.

Then, to test if it works, it calls very basic OpenGL drawing functions to draw a blue rectangle, and writes a ppm image file.

Requirements

OS libs

In any case, you need appropriate GPU drivers, with libGL and libEGL. If you use a recent Nvidia driver, this will probably be enough. Otherwise (intel integrated GPU for example), the program will try load libgbm.

For example on an ubuntu OS with a mesa-compatible GPU, the following should work:

$ apt install libgl1-mesa-dri libegl1-mesa libgbm1

python libs

You need PyOpenGL and numpy:

$ pip install wheel
$ pip install pyopengl numpy

On my machine, I also had to fix file [python_dir]/site-packages/OpenGL/raw/EGL/_types.py, by applying this modification. It may be already fixed in your pyopengl distribution when you read this.

For more optimized transfers between PyOpenGL and numpy, do:

$ pip install Cython
$ pip install PyOpenGL_accelerate

How to run

To run the program, just type

$ ./main.py

Links

The code is mostly based on the following sample codes and documentation:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].