# CryptoLeaks GPU rental pilot: read-only Windows hardware pre-check. # No installation, administrator access, network call, or wallet access. # Review cryptoleaks-gpu-report.json before uploading it to CryptoLeaks. $ErrorActionPreference = 'Stop' function Safe-Cim([string]$ClassName) { try { @(Get-CimInstance -ClassName $ClassName -ErrorAction Stop) } catch { @() } } $computer = @(Safe-Cim 'Win32_ComputerSystem') | Select-Object -First 1 $operatingSystem = @(Safe-Cim 'Win32_OperatingSystem') | Select-Object -First 1 $ramMiB = if ($computer) { [int64][math]::Floor([double]$computer.TotalPhysicalMemory / 1MB) } else { 0 } $ssdGB = 0 try { $disks = @(Get-PhysicalDisk -ErrorAction Stop) foreach ($disk in $disks) { if ($disk.MediaType -eq 'SSD' -or $disk.BusType -eq 'NVMe') { $size = [int64][math]::Floor([double]$disk.Size / 1e9) if ($size -gt $ssdGB) { $ssdGB = $size } } } } catch { $ssdGB = 0 } $gpus = @() $nvidia = Get-Command 'nvidia-smi.exe' -ErrorAction SilentlyContinue if (-not $nvidia -and (Test-Path "$env:WINDIR\System32\nvidia-smi.exe")) { $nvidia = "$env:WINDIR\System32\nvidia-smi.exe" } if ($nvidia) { try { $lines = @(& $nvidia --query-gpu=name,memory.total,driver_version --format=csv,noheader,nounits 2>$null) foreach ($line in $lines) { $parts = @($line -split ',' | ForEach-Object { $_.Trim() }) if ($parts.Count -eq 3 -and $parts[1] -match '^\d+$') { $gpus += @{ model = $parts[0].Substring(0, [math]::Min(120, $parts[0].Length)); vram_mib = [int]$parts[1]; driver = $parts[2].Substring(0, [math]::Min(40, $parts[2].Length)) } } } } catch { $gpus = @() } } if ($gpus.Count -eq 0) { foreach ($card in @(Safe-Cim 'Win32_VideoController')) { if ([string]$card.Name -match 'NVIDIA') { $name = [string]$card.Name $driver = [string]$card.DriverVersion $gpus += @{ model = $name.Substring(0, [math]::Min(120, $name.Length)); vram_mib = 0; driver = $driver.Substring(0, [math]::Min(40, $driver.Length)) } } } } $report = @{ schema = 'cryptoleaks-gpu-rental-precheck-v1' generated_at = (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ') os_id = 'windows' os_version = if ($operatingSystem) { [string]$operatingSystem.Version } else { '' } native_linux = $false ram_mib = $ramMiB ssd_gb = $ssdGB gpus = @($gpus) network_speed_tested = $false } $destination = Join-Path (Get-Location) 'cryptoleaks-gpu-report.json' $json = $report | ConvertTo-Json -Depth 5 [IO.File]::WriteAllText($destination, $json + [Environment]::NewLine, [Text.UTF8Encoding]::new($false)) Write-Host "Report saved: $destination" Write-Host 'Review the report before uploading it. No information was sent by this script.' Write-Host 'Windows hardware may qualify for the pilot, but the compute platform currently requires native Linux for hosting.'