windows-miner: always add the MSVC lib dir for nvcc, AMD worker runs from proto-opencl, keep-awake constant
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
2edb977128
commit
9d2700e31e
1 changed files with 7 additions and 5 deletions
|
|
@ -115,7 +115,9 @@ if ($haveCl) {
|
|||
$libFirst = if ($env:LIB) { ($env:LIB -split ';')[0] } else { 'EMPTY' }
|
||||
$incFirst = if ($env:INCLUDE) { ($env:INCLUDE -split ';')[0] } else { 'EMPTY' }
|
||||
Log "MSVC environment: cl at $((Get-Command cl.exe).Source); LIB starts with $libFirst; INCLUDE starts with $incFirst"
|
||||
if (-not $env:LIB) { Log 'LIB is empty: nvcc link steps will fail (LNK1104); trying the fallback'; [void](Set-LibFallback) }
|
||||
# Always add the newest MSVC lib dir and the Windows Kits dirs in front of LIB: a vcvars import can leave LIB without
|
||||
# the MSVC lib directory (seen on the project lead's PC: LIB started with ucrt and nvcc's link failed on LIBCMT.lib).
|
||||
[void](Set-LibFallback); Log ('LIB now starts with ' + (($env:LIB -split ';')[0]))
|
||||
}
|
||||
$haveNvcc = [bool](Get-Command nvcc.exe -ErrorAction SilentlyContinue)
|
||||
$openclSdk = $null
|
||||
|
|
@ -237,7 +239,7 @@ function Start-Miner($v, $inst) {
|
|||
else { $margs += @('--worker-args', ('"--vendor ' + $amdVendor.Replace(' ', '_') + '"')) }
|
||||
}
|
||||
Set-Content -Path $inst.log -Value "igneum-mine-test $($inst.label) $machine $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss') node $nodeUrl run $($inst.runId) start $($inst.starts)"
|
||||
$inst.proc = Start-Process -FilePath $miner -ArgumentList $margs -WorkingDirectory $root -RedirectStandardOutput $inst.log -RedirectStandardError $inst.err -NoNewWindow -PassThru
|
||||
$inst.proc = Start-Process -FilePath $miner -ArgumentList $margs -WorkingDirectory $(if ($v.name -eq 'amd') { Join-Path $root 'proto-opencl' } else { $root }) -RedirectStandardOutput $inst.log -RedirectStandardError $inst.err -NoNewWindow -PassThru
|
||||
$inst.startedAt = Get-Date
|
||||
Log "$($inst.label) started (pid $($inst.proc.Id)): `"$miner`" $($margs -join ' ') -> $($inst.log)"
|
||||
}
|
||||
|
|
@ -311,7 +313,7 @@ try {
|
|||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
public static extern uint SetThreadExecutionState(uint esFlags);
|
||||
'@
|
||||
[void]$keepAwake::SetThreadExecutionState([uint32]0x80000000 -bor [uint32]0x00000001) # ES_CONTINUOUS | ES_SYSTEM_REQUIRED
|
||||
[void]$keepAwake::SetThreadExecutionState([uint32]2147483648 -bor [uint32]0x00000001) # ES_CONTINUOUS | ES_SYSTEM_REQUIRED
|
||||
Log 'keeping the PC awake while mining'
|
||||
} catch { Log "could not set the keep-awake state: $_ (set Sleep to Never for the night)"; $keepAwake = $null }
|
||||
$lastAwake = Get-Date
|
||||
|
|
@ -325,7 +327,7 @@ try {
|
|||
while (-not $stop) {
|
||||
Start-Sleep -Milliseconds 1000
|
||||
if ($keepAwake -and ((Get-Date) - $lastAwake).TotalSeconds -ge 60) {
|
||||
[void]$keepAwake::SetThreadExecutionState([uint32]0x80000000 -bor [uint32]0x00000001)
|
||||
[void]$keepAwake::SetThreadExecutionState([uint32]2147483648 -bor [uint32]0x00000001)
|
||||
$lastAwake = Get-Date
|
||||
}
|
||||
while ([Console]::KeyAvailable) {
|
||||
|
|
@ -367,7 +369,7 @@ try {
|
|||
}
|
||||
} finally {
|
||||
[Console]::TreatControlCAsInput = $false
|
||||
if ($keepAwake) { [void]$keepAwake::SetThreadExecutionState([uint32]0x80000000); Log 'released the keep-awake state' } # ES_CONTINUOUS alone clears it
|
||||
if ($keepAwake) { [void]$keepAwake::SetThreadExecutionState([uint32]2147483648); Log 'released the keep-awake state' } # ES_CONTINUOUS alone clears it
|
||||
Log 'stopping the miners and workers'
|
||||
Stop-All
|
||||
Start-Sleep -Seconds 2
|
||||
|
|
|
|||
Loading…
Reference in a new issue