Files
loc_az_hci/infrastructure/drivers/install-qat-drivers.ps1
defiQUG c39465c2bd
Some checks failed
Test / test (push) Has been cancelled
Initial commit: loc_az_hci (smom-dbis-138 excluded via .gitignore)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 09:04:46 -08:00

138 lines
6.0 KiB
PowerShell

# Install Intel QAT 8970 Drivers and OpenSSL Engine
# Supports: Intel QAT 8970 PCIe card
param(
[string]$QatLibPath = "",
[string]$OpenSSLEnginePath = "",
[switch]$InstallOpenSSLEngine = $true,
[switch]$Force = $false
)
$ErrorActionPreference = "Stop"
Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "Intel QAT Driver Installation" -ForegroundColor Cyan
Write-Host "=========================================" -ForegroundColor Cyan
# Check if running as Administrator
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "This script requires Administrator privileges." -ForegroundColor Red
exit 1
}
# Detect Intel QAT card
Write-Host "`nDetecting Intel QAT card..." -ForegroundColor Yellow
$qatDevices = Get-PnpDevice | Where-Object {
$_.FriendlyName -like "*QAT*" -or
$_.FriendlyName -like "*QuickAssist*" -or
$_.FriendlyName -like "*8970*"
}
if ($qatDevices.Count -eq 0) {
Write-Host "No Intel QAT devices detected." -ForegroundColor Yellow
Write-Host "This may be normal if:" -ForegroundColor Yellow
Write-Host " - QAT card is not installed" -ForegroundColor White
Write-Host " - Running on Linux (use 'lspci | grep -i qat' to check)" -ForegroundColor White
Write-Host " - Drivers need to be installed" -ForegroundColor White
}
else {
Write-Host "Found $($qatDevices.Count) QAT device(s):" -ForegroundColor Green
foreach ($device in $qatDevices) {
Write-Host " - $($device.FriendlyName): Status $($device.Status)" -ForegroundColor White
}
}
# Download qatlib if not provided
if ([string]::IsNullOrEmpty($QatLibPath)) {
Write-Host "`nIntel QAT driver information:" -ForegroundColor Yellow
Write-Host "Download qatlib from Intel Download Center" -ForegroundColor Yellow
Write-Host "URL: https://www.intel.com/content/www/us/en/download-center/home.html" -ForegroundColor Yellow
Write-Host "Search for: 'Intel QuickAssist Technology Software for Linux'" -ForegroundColor Yellow
$tempPath = "$env:TEMP\qatlib.exe"
Write-Host "`nPlease download QAT driver and save to: $tempPath" -ForegroundColor Yellow
Write-Host "Or press Ctrl+C to skip Windows driver install (Linux installation will be documented)" -ForegroundColor Yellow
Read-Host "Press Enter after downloading"
if (Test-Path $tempPath) {
$QatLibPath = $tempPath
}
}
# Install Windows qatlib if provided
if (-not [string]::IsNullOrEmpty($QatLibPath) -and (Test-Path $QatLibPath)) {
Write-Host "`nInstalling Intel QAT driver (qatlib)..." -ForegroundColor Yellow
try {
$process = Start-Process -FilePath $QatLibPath -ArgumentList "/S /v/qn" -Wait -PassThru -NoNewWindow
if ($process.ExitCode -eq 0 -or $process.ExitCode -eq 3010) {
Write-Host "Intel QAT driver installed successfully." -ForegroundColor Green
}
else {
Write-Host "Installation completed with exit code: $($process.ExitCode)" -ForegroundColor Yellow
}
}
catch {
Write-Host "Error installing QAT driver: $_" -ForegroundColor Red
}
}
# Install OpenSSL QAT Engine
if ($InstallOpenSSLEngine) {
Write-Host "`n=========================================" -ForegroundColor Cyan
Write-Host "OpenSSL QAT Engine Installation" -ForegroundColor Cyan
Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "`nOpenSSL QAT Engine installation:" -ForegroundColor Yellow
Write-Host "The OpenSSL QAT engine is typically bundled with qatlib." -ForegroundColor White
Write-Host "`nFor Linux installation:" -ForegroundColor Cyan
Write-Host "1. Build qatlib from source (includes OpenSSL engine)" -ForegroundColor White
Write-Host "2. Configure OpenSSL to use QAT engine" -ForegroundColor White
Write-Host "3. Test QAT acceleration" -ForegroundColor White
Write-Host "`nExample Linux installation:" -ForegroundColor Yellow
Write-Host " # Download and extract qatlib" -ForegroundColor White
Write-Host " tar -xzf qat*.tar.gz" -ForegroundColor White
Write-Host " cd qat*" -ForegroundColor White
Write-Host " ./configure" -ForegroundColor White
Write-Host " make && make install" -ForegroundColor White
Write-Host "`nFor detailed OpenSSL QAT configuration, see:" -ForegroundColor Yellow
Write-Host " infrastructure/crypto/configure-openssl-qat.ps1" -ForegroundColor White
}
# Verify installation
Write-Host "`nVerifying QAT installation..." -ForegroundColor Yellow
Start-Sleep -Seconds 5
# Check QAT service status (Linux)
Write-Host "`nTo verify QAT on Linux:" -ForegroundColor Yellow
Write-Host " qat_service status" -ForegroundColor White
Write-Host " lsmod | grep qat" -ForegroundColor White
Write-Host " openssl speed -engine qat -elapsed -async_jobs 36 rsa2048" -ForegroundColor White
# Check Windows QAT status
$updatedQatDevices = Get-PnpDevice | Where-Object {
$_.FriendlyName -like "*QAT*" -or
$_.FriendlyName -like "*QuickAssist*"
}
if ($updatedQatDevices.Count -gt 0) {
Write-Host "`nDetected QAT devices:" -ForegroundColor Green
foreach ($device in $updatedQatDevices) {
Write-Host " $($device.FriendlyName): $($device.Status)" -ForegroundColor White
}
}
Write-Host "`n=========================================" -ForegroundColor Cyan
Write-Host "Intel QAT Driver Installation Complete" -ForegroundColor Cyan
Write-Host "=========================================" -ForegroundColor Cyan
Write-Host "`nNext Steps:" -ForegroundColor Yellow
Write-Host "1. Configure OpenSSL QAT engine (see configure-openssl-qat.ps1)" -ForegroundColor White
Write-Host "2. Configure IPsec/IKEv2 QAT integration (see setup-ipsec-qat.ps1)" -ForegroundColor White
Write-Host "3. Test QAT acceleration (see test-qat-acceleration.ps1)" -ForegroundColor White
Write-Host "4. Verify QAT performance improvements" -ForegroundColor White