fix(install.ps1): recreate venv with Python 3.12 after ROCm switch
Venv was created with 3.13 before GPU detection ran; switching $DetectedPython to 3.12 had no effect since $VenvPython still pointed to the 3.13 interpreter inside the already-created venv.
This commit is contained in:
parent
265a09a341
commit
643a797969
1 changed files with 10 additions and 0 deletions
10
install.ps1
10
install.ps1
|
|
@ -1338,6 +1338,16 @@ shell.Run cmd, 0, False
|
|||
if ($py312) {
|
||||
$DetectedPython = $py312
|
||||
substep "AMD GPU detected -- switching to Python 3.12 (ROCm wheels are cp312-only)" "Cyan"
|
||||
# Recreate the venv with Python 3.12 (it was just created with 3.13 above).
|
||||
if (Test-Path -LiteralPath $VenvDir) {
|
||||
Remove-Item -LiteralPath $VenvDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
step "venv" "creating Python 3.12 virtual environment"
|
||||
substep "$VenvDir"
|
||||
$venvExit = Invoke-InstallCommand { uv venv $VenvDir --python "$($DetectedPython.Path)" }
|
||||
if ($venvExit -ne 0) {
|
||||
return (Exit-InstallFailure "Failed to create Python 3.12 virtual environment (exit code $venvExit)" $venvExit)
|
||||
}
|
||||
} else {
|
||||
substep "AMD GPU detected but Python 3.12 not found -- ROCm GPU support requires Python 3.12" "Yellow"
|
||||
substep "Install Python 3.12 from python.org and re-run." "Yellow"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue