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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23b0b7fa1b0509af6a8f104f9935b8f0031284659a88443d3e6b01664ff7dc79
|
|
| MD5 |
ab56a616bd5dd2d3445f9872e6959118
|
|
| BLAKE2b-256 |
2c6f63533ef8f644a3512e9c676f32ceec5c286ba3537a1e20cdc8293f9e6020
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db2ccbaa565ef68373e757ffda21ba7e0765b9b9ff6969a52af3dde18c44674c
|
|
| MD5 |
c56d2825bb7ab5e6d92faf9dc1d904b6
|
|
| BLAKE2b-256 |
1540004a224915b4f9e28b941594bc3dde441067783a6e339a428d149cb57cc8
|