feat: deteccion de GPU NVIDIA y aceleracion automatica (#16)
Co-authored-by: Hermes Agent <hermes@d0a1.es>
This commit was merged in pull request #16.
This commit is contained in:
1 parent
6f052cf738
commit
fbf567f942
4 files changed
+72
-4
No files matched your search
+16
-1
@@ -83,6 +83,19 @@ Ok "RAM: $TotalRamGb GB"
|
||||
# --- Tumbar deploy previo (antes de detectar puertos) -----------------------
|
||||
cmd /c docker rm -f d0a1-hermes-ollama '>' NUL '2>&1'
|
||||
|
||||
# --- GPU NVIDIA? (si hay, Ollama la usa y va 5-10x mas rapido) ---------------
|
||||
$HasGpu = $false
|
||||
if (Get-Command nvidia-smi -ErrorAction SilentlyContinue) {
|
||||
$GpuInfo = & nvidia-smi --query-gpu=name,memory.total --format=csv,noheader 2>$null
|
||||
if ($LASTEXITCODE -eq 0 -and $GpuInfo) {
|
||||
$HasGpu = $true
|
||||
$GpuName = ($GpuInfo -split ',')[0].Trim()
|
||||
Info "GPU NVIDIA detectada: $GpuName (aceleracion activada)"
|
||||
}
|
||||
}
|
||||
if (-not $HasGpu) {
|
||||
Warn 'Sin GPU NVIDIA: modo CPU (~10-20 tokens/s). Con una GPU NVIDIA va 5-10x mas rapido.'
|
||||
}
|
||||
# --- Auto-detect Ollama port ------------------------------------------------
|
||||
$OllamaPort = Find-FreePort 11434
|
||||
|
||||
@@ -101,7 +114,9 @@ Write-Host ''
|
||||
Warn '[1/3] Arrancando Ollama (IA local)...'
|
||||
$running = docker ps --format '{{.Names}}' | Select-String -Quiet 'd0a1-hermes-ollama'
|
||||
if (-not $running) {
|
||||
docker run -d --name d0a1-hermes-ollama --memory 6g `
|
||||
$GpuArgs = @()
|
||||
if ($HasGpu) { $GpuArgs = @('--gpus', 'all') }
|
||||
docker run -d --name d0a1-hermes-ollama --memory 6g @GpuArgs `
|
||||
-p "${OllamaPort}:11434" `
|
||||
-v d0a1_hermes_ollama:/root/.ollama `
|
||||
-e OLLAMA_HOST=0.0.0.0 `
|
||||
|
||||
Reference in new issue
Block a user