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
Metadata
Release files for EGLKeepalive 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| eglkeepalive-1.0.1.tar.gz | 14.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| eglkeepalive-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.7 kB
Release files / eglkeepalive-1.0.1.tar.gz
| Download URL | eglkeepalive-1.0.1.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
23b0b7fa1b0509af6a8f104f9935b8f0031284659a88443d3e6b01664ff7dc79
|
|
BLAKE2b-256 checksum How to use checksums |
2c6f63533ef8f644a3512e9c676f32ceec5c286ba3537a1e20cdc8293f9e6020
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / eglkeepalive-1.0.1-py3-none-any.whl
| Download URL | eglkeepalive-1.0.1-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
db2ccbaa565ef68373e757ffda21ba7e0765b9b9ff6969a52af3dde18c44674c
|
|
BLAKE2b-256 checksum How to use checksums |
1540004a224915b4f9e28b941594bc3dde441067783a6e339a428d149cb57cc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|