GithubHelp home page GithubHelp logo

zinurist / gl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eduble/gl

0.0 1.0 0.0 14 KB

OpenGL headless on linux (EGL)

License: BSD 3-Clause "New" or "Revised" License

Python 99.39% Makefile 0.61%

gl's Introduction

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:

gl's People

Contributors

eduble avatar zinurist avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.