✅ 能跑:
❌ 不适合:
| 方案 | 框架 | 是否推荐 | 说明 |
|---|---|---|---|
| ✅ DirectML | PyTorch / ONNX | ⭐⭐⭐⭐ | Windows 最稳 |
| ✅ ROCm (Linux) | PyTorch | ⭐⭐⭐ | 折腾但原生 |
| ✅ ONNX Runtime | 多框架 | ⭐⭐⭐⭐ | 通用、稳定 |
| ⚠️ CUDA | ❌ | 不支持 | RX580 不支持 |
python -m venv ai
ai\Scripts\activatepip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install onnxruntime-directml或直接:
pip install torch-directmlimport torch
import torch_directml
dml = torch_directml.device()
x = torch.randn(3,3).to(dml)
print(x)ollama run llama3git clone https://github.com/ggerganov/llama.cpp编译时启用:
-DGGML_OPENCL=ON或 Windows 预编译版直接用
pip install onnxruntime-directml启动参数:
--use-directml✅ RX580 8G 可跑:
⚠️ 注意:
sudo apt install rocm
export HSA_OVERRIDE_GFX_VERSION=8.0.3
pip install torch rocm| 任务 | 表现 |
|---|---|
| LLaMA 7B q4 | 15–25 tokens/s |
| SD1.5 512 | 2–4 it/s |
| 推理 CV | 可用 |
✅ Windows + DirectML + Ollama / llama.cpp
✅ SD 用 ComfyUI + DirectML
如果你告诉我:
我可以直接给你一套 一键部署命令。