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_api

set_virtual_device_api()

max.driver.set_virtual_device_api(api: str) → None

source

Sets the target API for virtual devices in compile-only mode.

This specifies which GPU API (e.g., “cuda”, “hip”, “metal”) virtual devices will use for compilation. Must be called before creating virtual devices via set_virtual_device_count().

Parameters:

api (str) – The target API string (e.g., “cuda” for NVIDIA, “hip” for AMD, “metal” for Apple).