Skip to content

Latest commit

 

History

History
115 lines (79 loc) · 3.12 KB

File metadata and controls

115 lines (79 loc) · 3.12 KB

Visual Studio 2025 + CUDA 12.8 - Incompatibilidade

Problema

O CUDA 12.8 não suporta Visual Studio 2025. Apenas versões 2017-2022 são oficialmente suportadas.

Erro típico

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.8\include\crt/host_config.h(170): 
fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! 
Only the versions between 2017 and 2022 (inclusive) are supported!

Este erro ocorre quando o ExLlamaV3 Python package tenta compilar suas extensões CUDA em runtime (JIT compilation).

Impacto no ExLlamaSharp

✅ Servidor funciona normalmente - O ExLlamaSharp Server usa backend nativo C++ (compilado previamente), não depende do ExLlamaV3 Python.

⚠️ ExLlamaV3 Python não compila - O package exllamav3 do PyPI falha ao compilar extensões CUDA.

Soluções

Opção 1: Usar backend nativo C++ ✅ (Implementado)

O instalador agora é tolerante a falhas do ExLlamaV3:

Install.ps1
# PyTorch: ✅ Instalado
# ExLlamaV3: ⚠️ Aviso se falhar (não é crítico)
# Servidor: ✅ Funciona com backend nativo

Vantagens:

  • Sem alterações necessárias
  • Servidor funciona normalmente
  • Backend nativo é mais rápido

Opção 2: Instalar VS 2022 (Build Tools)

Se você precisar do ExLlamaV3 Python por algum motivo:

# Baixar VS 2022 Build Tools
winget install Microsoft.VisualStudio.2022.BuildTools

# Ou instalar VS 2022 Community
winget install Microsoft.VisualStudio.2022.Community

Nota: CUDA 12.8 ainda pode não reconhecer VS 2022 como "suportado" dependendo da versão exata.

Opção 3: Usar flag -allow-unsupported-compiler

Para forçar compilação com VS 2025 (não recomendado):

import os
os.environ['TORCH_CUDA_ARCH_LIST'] = '8.9'  # Sua GPU
os.environ['NVCC_FLAGS'] = '-allow-unsupported-compiler'

# Então importar exllamav3
from exllamav3 import Model

Avisos:

  • Pode causar falhas em runtime
  • Comportamento indefinido
  • Use por sua conta e risco

Configuração do Instalador

O Install.ps1 atualizado:

# PyTorch (obrigatório) - sempre instalado
& pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128

# ExLlamaV3 (opcional) - não falha se der erro
& pip install exllamav3 2>&1 | Out-Null
if ($LASTEXITCODE -ne 0) {
    Write-Warning "ExLlamaV3 não instalado (servidor usa backend nativo C++)"
}

Verificação

Para verificar se o backend nativo está funcionando:

# Iniciar servidor
Start-Service ExLlamaSharp

# Verificar health
Invoke-WebRequest http://localhost:14563/health

# Verificar logs
Get-Content "C:\Program Files\ExLlamaSharp\logs\*.log" -Tail 50

Você deve ver algo como:

Using inference engine ExLlamaV3WorkerEngine (kind=Worker)
Native DLL loaded: exllamasharp_native.dll

Conclusão

✅ ExLlamaSharp funciona perfeitamente com VS 2025
⚠️ ExLlamaV3 Python package não compila (mas não é necessário)
🚀 Backend nativo C++ é mais rápido e confiável

O problema do VS 2025 é irrelevante para o ExLlamaSharp porque usamos nosso próprio backend nativo compilado.