|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| $ErrorActionPreference = "Stop"
|
|
|
| Write-Host "==================================================" -ForegroundColor Magenta
|
| Write-Host " FusionNet β AMD ROCm / HIP SDK Setup (Windows) " -ForegroundColor Magenta
|
| Write-Host "==================================================" -ForegroundColor Magenta
|
|
|
| Write-Host @"
|
|
|
| NOTE: ROCm on Windows uses AMD's HIP SDK.
|
| Ensure you have installed:
|
| 1. AMD Radeon Software (latest)
|
| 2. AMD HIP SDK from:
|
| https://www.amd.com/en/developer/resources/rocm-hub/hip-sdk.html
|
|
|
| PyTorch ROCm wheels are Linux-only from pytorch.org.
|
| On Windows, we install the CUDA-compatible wheel and rely on
|
| the HIP SDK's CUDA compatibility layer (hipcc / HIPRT).
|
|
|
| For full ROCm support on Windows, WSL2 (Ubuntu 22.04) is recommended:
|
| wsl --install -d Ubuntu-22.04
|
| Then run scripts/setup_rocm.sh inside WSL2.
|
|
|
| "@ -ForegroundColor Yellow
|
|
|
|
|
| if (-not (Get-Command python -ErrorAction SilentlyContinue)) {
|
| Write-Error "Python not found. Install Python 3.10+ from https://python.org and add it to PATH."
|
| exit 1
|
| }
|
| $pyVersion = python --version
|
| Write-Host "Python : $pyVersion" -ForegroundColor Green
|
|
|
|
|
| Write-Host "`nUpgrading pip..." -ForegroundColor Yellow
|
| python -m pip install --upgrade pip
|
|
|
|
|
| $hipPath = "C:\Program Files\AMD\ROCm"
|
| $hipFound = Test-Path $hipPath
|
| if ($hipFound) {
|
| Write-Host "HIP SDK detected at: $hipPath" -ForegroundColor Green
|
| } else {
|
| Write-Host "HIP SDK not found at default path ($hipPath)." -ForegroundColor Yellow
|
| Write-Host "Proceeding with CPU-compatible install. GPU acceleration may not work." -ForegroundColor Yellow
|
| }
|
|
|
|
|
|
|
|
|
|
|
| Write-Host "`nInstalling PyTorch (CPU build β ROCm wheels are Linux-only)..." -ForegroundColor Yellow
|
| pip install torch torchvision torchaudio
|
|
|
|
|
| Write-Host "`nInstalling project dependencies..." -ForegroundColor Yellow
|
| pip install -r "$PSScriptRoot\..\requirements.txt"
|
|
|
|
|
| Write-Host "`nInstalling fusionnet-client dependencies..." -ForegroundColor Yellow
|
| pip install -r "$PSScriptRoot\..\fusionnet-client\requirements.txt"
|
|
|
|
|
| Write-Host "`n--------------------------------------------------" -ForegroundColor Magenta
|
| Write-Host " Environment Verification" -ForegroundColor Magenta
|
| Write-Host "--------------------------------------------------" -ForegroundColor Magenta
|
|
|
| python -c @"
|
| import torch
|
| is_rocm = getattr(torch.version, 'hip', None) is not None
|
| print(f'PyTorch : {torch.__version__}')
|
| print(f'ROCm/HIP : {is_rocm}')
|
| print(f'CUDA API : {torch.cuda.is_available()}')
|
| if torch.cuda.is_available():
|
| p = torch.cuda.get_device_properties(0)
|
| print(f'GPU : {p.name} ({p.total_memory / 1024**3:.1f} GB)')
|
| else:
|
| print('INFO : Running on CPU. For AMD GPU on Windows use WSL2 + setup_rocm.sh')
|
| "@
|
|
|
| Write-Host "`n[OK] Setup complete." -ForegroundColor Green
|
| Write-Host ""
|
| Write-Host " For AMD GPU acceleration on Windows, use WSL2:" -ForegroundColor Cyan
|
| Write-Host " wsl --install -d Ubuntu-22.04" -ForegroundColor White
|
| Write-Host " # Then inside WSL2:" -ForegroundColor White
|
| Write-Host " bash scripts/setup_rocm.sh" -ForegroundColor White
|
| Write-Host ""
|
| Write-Host " To run on CPU (works now):" -ForegroundColor Cyan
|
| Write-Host " cd fusionnet-client" -ForegroundColor White
|
| Write-Host " python main.py --client-id 0 --num-clients 4" -ForegroundColor White
|
|
|