Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.
C++
tools/windows/enable_large_pages.ps1: grant "Lock pages in memory" to the current account (#2185)
Niko12212f335a5eab3d
diff --git a/docs/DETAILS.md b/docs/DETAILS.mdindex 1c570419a..968ba5867 100644--- a/docs/DETAILS.md+++ b/docs/DETAILS.md@@ -521,7 +521,7 @@ In the task's properties set both of these (the defaults are the opposite):(Both were changed at once, so the isolated effect of each is not measured.) If the model still startsslowly, the engine prints a hint under its `loaded ... GiB at ...` line naming this cause.-**Large pages need a new logon (#1412).** Granting "Lock pages in memory" (`secpol.msc`, User Rights Assignment) to the account that runs the engine takes effect at the next logon: Windows puts the privilege in the access token when the session starts, so log off and on (or reboot) after granting it. Until then the startup log still says the large pages were refused.+**Large pages need a new logon (#1412).** Granting "Lock pages in memory" (`secpol.msc`, User Rights Assignment) to the account that runs the engine takes effect at the next logon: Windows puts the privilege in the access token when the session starts, so log off and on (or reboot) after granting it. Until then the startup log still says the large pages were refused. `tools\windows\enable_large_pages.ps1` (run as Administrator) grants it to the current account with `secedit`.### Chat in the terminal (optional)diff --git a/tools/windows/enable_large_pages.ps1 b/tools/windows/enable_large_pages.ps1new file mode 100644index 000000000..046d2d836--- /dev/null+++ b/tools/windows/enable_large_pages.ps1@@ -0,0 +1,89 @@+<#+.SYNOPSIS+ Enables the 'Lock pages in memory' privilege (SeLockMemoryPrivilege) on Windows.+.DESCRIPTION+ Strata keeps the experts the GPU does not hold in a host memory arena. With SeLockMemoryPrivilege+ granted, Windows lets it allocate that arena in 2 MB large pages (MEM_LARGE_PAGES); without it the+ engine says at start that the large pages were refused and uses 4 KB pages (docs/DETAILS.md, #1412).+ The same can be done by hand with secpol.msc (User Rights Assignment, "Lock pages in memory").++ NOTE: Windows applies security token privilege changes ONLY after sign-out/sign-in or reboot.+#>++[CmdletBinding()]+param (+ [string]$AccountName = $env:USERNAME+)++function Test-IsAdmin {+ $currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())+ return $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)+}++if (-not (Test-IsAdmin)) {+ Write-Host "[!] This script must be run as Administrator." -ForegroundColor Yellow+ Write-Host " Right-click PowerShell -> 'Run as Administrator', then run:"+ Write-Host " .\tools\windows\enable_large_pages.ps1"+ Write-Host ""+ Write-Host " GUI Alternative:"+ Write-Host " 1. Press Win + R, type 'secpol.msc' and press Enter."+ Write-Host " 2. Navigate to: Security Settings -> Local Policies -> User Rights Assignment"+ Write-Host " 3. Double-click 'Lock pages in memory'."+ Write-Host " 4. Click 'Add User or Group...', add '$AccountName', and click OK."+ Write-Host " 5. Sign out of Windows and sign back in."+ exit 1+}++Write-Host "=== Configuring 'Lock pages in memory' (SeLockMemoryPrivilege) for $AccountName ===" -ForegroundColor Cyan++$tempInf = [System.IO.Path]::GetTempFileName()+$tempSdb = [System.IO.Path]::ChangeExtension($tempInf, ".sdb")++try {+ Write-Host "1. Exporting current security policy..."+ secedit /export /cfg $tempInf | Out-Null++ $content = Get-Content $tempInf -Raw+ $userSid = (New-Object System.Security.Principal.NTAccount($AccountName)).Translate([System.Security.Principal.SecurityIdentifier]).Value++ if ($content -match "SeLockMemoryPrivilege\s*=\s*(.*)") {+ $currentList = $matches[1].Trim()+ if ($currentList -match [regex]::Escape($userSid) -or $currentList -match [regex]::Escape($AccountName)) {+ Write-Host "[OK] $AccountName already possesses SeLockMemoryPrivilege." -ForegroundColor Green+ Write-Host " If 'whoami /priv' still shows it as missing, please SIGN OUT and sign back in to refresh your token."+ return+ }+ $newList = "$currentList,*$userSid"+ $content = $content -replace "SeLockMemoryPrivilege\s*=.*", "SeLockMemoryPrivilege = $newList"+ } else {+ # Section [Privilege Rights]+ if ($content -match "\[Privilege Rights\]") {+ $content = $content -replace "\[Privilege Rights\]", "[Privilege Rights]`r`nSeLockMemoryPrivilege = *$userSid"+ } else {+ $content += "`r`n[Privilege Rights]`r`nSeLockMemoryPrivilege = *$userSid`r`n"+ }+ }++ Set-Content -Path $tempInf -Value $content -Encoding ASCII++ Write-Host "2. Importing updated policy database..."+ secedit /import /db $tempSdb /cfg $tempInf | Out-Null++ Write-Host "3. Applying updated policy to Windows system..."+ secedit /configure /db $tempSdb /cfg $tempInf /areas USER_RIGHTS | Out-Null # only the user rights, nothing else of the exported policy++ Write-Host ""+ Write-Host "[SUCCESS] SeLockMemoryPrivilege has been granted to $AccountName ($userSid)!" -ForegroundColor Green+ Write-Host "==========================================================================" -ForegroundColor Cyan+ Write-Host "IMPORTANT: You MUST sign out of Windows and sign back in (or restart)" -ForegroundColor Yellow+ Write-Host " for the new privilege to take effect on your user session." -ForegroundColor Yellow+ Write-Host "==========================================================================" -ForegroundColor Cyan+}+catch {+ Write-Host "[ERROR] Failed to configure privilege automatically: $_" -ForegroundColor Red+ Write-Host "Please use the GUI steps via secpol.msc outlined above."+}+finally {+ if (Test-Path $tempInf) { Remove-Item $tempInf -Force -ErrorAction SilentlyContinue }+ if (Test-Path $tempSdb) { Remove-Item $tempSdb -Force -ErrorAction SilentlyContinue }+}