IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

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.