stackgl / headless-gl

🎃 Windowless WebGL for node.js
1.76k stars 170 forks source link

Is it possible to assign a specific graphics card? #198

Closed jt0dd closed 4 years ago

jt0dd commented 4 years ago

I want to use clustering to assign different GPUs to different instances of headless gl called in different threads. Is this possible in any way shape or form?

jt0dd commented 4 years ago

I looked through the standard: https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2 and found no mention of hardware selection.

dhritzkiv commented 4 years ago

Unfortunately, as of right now, there is no way. The closest parameter is powerPreference but it isn't implemented by this library, and is only a hint (you don't get fine-grained control over GPUs directly).

The reason it isn't implemented by this library is that we are using an older version of Angle, and even then, it comes with platform- and device-specific caveats. For example, on Windows, depending on the graphics card, the card's control panel defines which card is used for which process (it's not even as granular as per-thread).

Furthermore, this library likely isn't fully compatible with Node's worker threads (see #151, #182).