Skip to main content

Python function

set_virtual_device_count

set_virtual_device_count()

max.driver.set_virtual_device_count(count: int) → None

source

Sets the number of virtual devices for device creation.

When count is greater than 0, Device::create() will return VirtualDevice instances instead of real hardware devices for GPU APIs, and Device::numberOfDevices() will return this count. This allows creating devices for GPU configurations that don’t match the current hardware.

Parameters:

count (int) – The number of virtual devices. Set to 0 to disable virtual device mode.