GPU Setup¶
gpu_setup
¶
GPU detection and selection for the installation process.
Extracted from install.py step 6b to keep the orchestrator clean
and make the GPU selection logic independently testable.
detect_and_select_gpu(platform, deps, log, *, cuda_override='')
¶
Detect GPU hardware and return the appropriate cuda tag.
Evaluates the following in order:
- Manual override — if cuda_override is provided, use it as-is.
- macOS — returns
None(Apple Silicon uses MPS, no tag needed). - NVIDIA CUDA — queries the driver via
nvidia-smi, maps tocu130orcu128. - AMD GPU — returns
rocm71(Linux) ordirectml(Windows). - No GPU — asks the user to confirm CPU-only, returns
"cpu"or raises :class:InstallerFatalErrorif declined.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
platform
|
Platform
|
The current platform instance. |
required |
deps
|
DependenciesConfig
|
Loaded dependencies config (for supported CUDA tags). |
required |
log
|
InstallerLogger
|
The installer logger. |
required |
cuda_override
|
str
|
Manual CUDA tag (e.g. |
''
|
Returns:
| Type | Description |
|---|---|
str | None
|
A cuda tag string ( |
str | None
|
|
Raises:
| Type | Description |
|---|---|
InstallerFatalError
|
If no GPU is found and the user declines CPU-only installation. |