Skip to main content

EGLKeepalive

Mini script using ModernGL to keep a GPU from entering D3cold, by nudging an EGL context every second. Useful if you have a Nvidia Optimus laptop and the delay of GPU activation is annoying.

Installing

Available on PyPI as EGLKeepalive

Recommended install using pipx:

$ pipx install EGLKeepalive

Example effect

Make use of the GLCONTEXT_DEVICE_INDEX environment variable on the command line, that overrides which graphics card / device that EGL chooses. Our Python code uses

gl = mgl.create_context(standalone = True, backend = "egl")

but with GLCONTEXT_DEVICE_INDEX=67 on the command line is equivalent to

gl = mgl.create_context(standalone = True, backend = "egl", device_index = 67)

so have a play with different GLCONTEXT_DEVICE_INDEX=123 to get it to work.

$ cat /sys/class/drm/card*/device/power_state
D3cold
D0
$ # lazy Nvidia GPU is fast asleep; power saving or something...

$ GLCONTEXT_DEVICE_INDEX=1 egl-keepalive &
$ # wakey wakey

$ cat /sys/class/drm/card*/device/power_state
D0
D0
$ # it's OpenGL time

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eglkeepalive-1.0.1.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eglkeepalive-1.0.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file eglkeepalive-1.0.1.tar.gz.

File metadata

  • Download URL: eglkeepalive-1.0.1.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for eglkeepalive-1.0.1.tar.gz
Algorithm Hash digest
SHA256 23b0b7fa1b0509af6a8f104f9935b8f0031284659a88443d3e6b01664ff7dc79
MD5 ab56a616bd5dd2d3445f9872e6959118
BLAKE2b-256 2c6f63533ef8f644a3512e9c676f32ceec5c286ba3537a1e20cdc8293f9e6020

See more details on using hashes here.

File details

Details for the file eglkeepalive-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: eglkeepalive-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for eglkeepalive-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db2ccbaa565ef68373e757ffda21ba7e0765b9b9ff6969a52af3dde18c44674c
MD5 c56d2825bb7ab5e6d92faf9dc1d904b6
BLAKE2b-256 1540004a224915b4f9e28b941594bc3dde441067783a6e339a428d149cb57cc8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page