Files
hwd32 58fdb03c30 docs: 初始装机指南
包含 6 章步骤 + 排错手册:
- 01 硬件与基础检查
- 02 Windows 装 Studio 驱动
- 03 WSL2 + CUDA 12.8
- 04 Ollama 装 LLM
- 05 PyTorch 验证(待补,依赖实机跑通)
- 06 ComfyUI 装出图(待补,依赖实机跑通)
- 90 排错手册
2026-06-14 12:08:38 +08:00

93 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 03 WSL2 + CUDA 12.8
## 目标
让 WSL2 Ubuntu 能用 5060 Ti 跑 CUDA 程序。
## ⚠️ 重要:WSL2 不要装 NVIDIA 驱动
WSL2 有个特殊机制——**Windows 装一次驱动,WSL2 共享用**。
| 位置 | 装什么 |
|------|------|
| Windows 11 | ✅ NVIDIA Studio 驱动(第二章装的) |
| WSL2 Ubuntu | ✅ **只装 CUDA Toolkit**(数学库) |
| WSL2 Ubuntu | ❌ **不装 NVIDIA 驱动**(会和 Windows 驱动打架黑屏) |
## 验证 WSL2 透传
**WSL2 Ubuntu 终端**
```bash
nvidia-smi
```
**应当看到**和 Windows 端一样的 5060 Ti(驱动版本号略不同没关系,KMD/UMD 一致即可)。
## 装 CUDA Toolkit 12.8
**WSL2 Ubuntu 终端**(一段一段粘贴跑):
### 1. 加 NVIDIA 官方 apt 仓库
```bash
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt update
```
### 2. 装 CUDA Toolkit(不装驱动)
```bash
sudo apt install -y cuda-toolkit-12-8
```
**等 3-5 分钟**(约 1.5 GB 下载)。
### 3. 加 PATH
```bash
echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
```
### 4. 验证
```bash
nvcc --version
```
**应当看到**
```
Cuda compilation tools, release 12.8, V12.8.93
```
## 装 Python 环境管理器
uv(比 conda 快 10 倍):
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.bashrc
uv --version
```
**应当看到** `uv 0.x.x`2026 年最新版)。
那个 `mkdir: cannot create directory '/home/xxx/.config/fish': Permission denied` 报错**无关**(你用 bash 不影响)。
## 准备模型目录(用 D 盘)
```bash
mkdir -p /mnt/d/ollama_models
mkdir -p /mnt/d/ComfyUI-models/checkpoints
mkdir -p /mnt/d/ComfyUI-models/vae
mkdir -p /mnt/d/ComfyUI-models/loras
mkdir -p /mnt/d/ComfyUI-models/controlnet
mkdir -p /mnt/d/llm-code
mkdir -p /mnt/d/img-code
ls -la /mnt/d/
```
`System Volume Information: Permission denied` 是 Windows 系统卷,**正常**,不管。
## 下一步
✅ 通过后 → [04 Ollama 装 LLM](./04-ollama-llm.md)