Skip to content

@graphty/graphty-element / index / AccelerationState

Type Alias: AccelerationState ​

AccelerationState = "probing" | "active" | "idle" | "unavailable" | "error" | "off"

Defined in: graphty-element/src/acceleration/types.ts:44

Where hardware acceleration stands, in one word.

Six states, because the honest reading of an unfinished probe is not one of the failures: without "probing" every page that ends up with a GPU first flashes a false "no GPU", and without "idle" a perfectly healthy accelerator with nothing to do is indistinguishable from a broken one.

  • "probing" -- the element is looking and the answer is not known yet. A consumer shows whatever it shows for a pending answer: not "GPU on", not "GPU unavailable".
  • "active" -- an accelerator is attached and work is on it right now.
  • "idle" -- an accelerator is attached and usable, and nothing is using it at the moment. This is the resting state of a working accelerator, not a degraded one: a graph below acceleration.minNodes, or a page where nothing has been run yet, sits here.
  • "unavailable" -- no accelerator could be attached. reason says why in a sentence a person can read, code says why in a string a switch can take.
  • "error" -- an accelerator was attached and then failed, device loss being the usual cause. The element continues on the CPU path having said so.
  • "off" -- acceleration is switched off by the consumer, so the element never looked.