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

calculate_virtual_device_count

calculate_virtual_device_count()

max.driver.calculate_virtual_device_count(*device_spec_lists)

source

Calculates the minimum virtual device count needed for the given device specs.

Parameters:

*device_spec_lists (list[DeviceSpec]) – One or more lists of DeviceSpec objects (for example, main devices and draft devices).

Returns:

The minimum number of virtual devices needed (max GPU ID + 1), or 1 if no GPUs.

Return type:

int