blendersynth.blender.devices

Blender device management.

class blendersynth.blender.devices.DeviceList(iterable=(), /)[source]
property names: List[str]

Return the names of all devices.

class blendersynth.blender.devices.Devices[source]

A manager for Blender rendering devices (CPU & GPU).

property available_gpus: DeviceList

Return list of all GPU devices.

property device_names: List[str]

Return a list of all device names.

property enabled_device_names: List[str]

Return a list of named devices that are enabled.

property enabled_gpus: DeviceList

Return list of available GPU devices.

set_by_name(name, use=True)[source]

Set use/not use based on a device name.

Parameters:
  • name (str) – Device name

  • use (bool) – Whether to use the device or not

set_device_usage(cpu=True, cuda=True, opencl=True, metal=True)[source]

Set/unset all devices of certain types to enabled.

Parameters:
  • cpu (bool) – Enable/disable CPU devices

  • cuda (bool) – Enable/disable CUDA devices

  • opencl (bool) – Enable/disable OpenCL devices

  • metal (bool) – Enable/disable Metal devices