
REST API命名规范的终极指南:清晰度和一致性的最佳实践
“一句话、一张草图、甚至一句哼唱,十秒后即可在浏览器里实时漫游一个带物理碰撞、昼夜循环、PBR 材质的 3D 世界,而且还能一键导出到 Unity / Unreal。”
这不是官方放出的炫技 Demo,而是 已经 Apache-2.0 开源、免费商用 的正式 SDK。
但!社区第一天就炸出 200+ Issue:
• CUDA 版本地狱
• 25 GB 镜像下载失败
• AMD 显卡直接 Segmentation fault
• WSL2 挂载目录 0x80070005
…
于是有了这篇「热血又硬核」的安装与避坑指南——一篇就够,复制粘贴即可跑通。
检查项 | 最低 | 推荐 | 备注 |
---|---|---|---|
GPU | RTX 3060 12 GB | RTX 4090 24 GB | FP8 推理 30 FPS+ |
CUDA | 11.8 | 12.4 | 向下兼容 |
驱动 | 535.x | 550.x | Linux ≥ 535.54.03 |
Docker | 24.0 | 26.1 | 需 NVIDIA Container Toolkit |
磁盘 | 60 GB | 120 GB | 镜像 + 缓存 |
网络 | 20 Mbps | 100 Mbps | 25 GB 镜像,建议代理 |
• GitHub 主仓库:搜索 “google-deepmind / genie3”
• 官方文档:DeepMind 官网 → Products → Genie 3 → Docs
• Docker Hub 认证镜像:Docker Hub 搜索 “deepmind/genie3”
• Hugging Face 权重:搜索 “deepmind/genie3-2b / 7b / 20b”
• Colab 体验:GitHub 仓库内 notebooks/quickstart.ipynb
• Discord 实时答疑:DeepMind 官方 Discord 频道 #genie3
场景 | 优点 | 缺点 | 本文章节 |
---|---|---|---|
裸机 pip install | 最新 commit 即刻用 | CUDA 地狱 | §6 |
Docker 本地 | 一次搞定,可复现 | 镜像大 | §7 |
Cloud TPU / GPU | 免硬件,送 300 美元 | 配额靠抢 | §8 |
sudo apt update && sudo apt install -y \
build-essential git wget curl ca-certificates \
python3.11 python3.11-venv python3-pip
# 下载官方 runfile
wget https://developer.download.nvidia.com/compute/cuda/12.4.0/local_installers/cuda_12.4.0_550.54.15_linux.run
sudo sh cuda_12.4.0_550.54.15_linux.run --toolkit --samples --override
# 写入环境变量
echo 'export PATH=/usr/local/cuda-12.4/bin:$PATH' > > ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64:$LD_LIBRARY_PATH' > > ~/.bashrc
source ~/.bashrc
技巧:用
update-alternatives
一键切换 CUDA 版本。
python3.11 -m venv ~/venv-genie3
source ~/venv-genie3/bin/activate
pip install -U pip wheel
pip install "genie3[torch]" \
--extra-index-url https://pypi.nvidia.com
坑 1:国内用户请将
pypi.nvidia.com
换成 清华镜像。
python - < < 'PY'
import torch, genie3
print("Torch:", torch.__version__)
print("CUDA:", torch.cuda.is_available())
print("GPU:", torch.cuda.get_device_name(0))
PY
# 官方镜像
docker run --rm -it --gpus all \
-p 8080:8080 \
-v $(pwd)/data:/data \
deepmind/genie3:2025.08-cuda12.4
# 国内镜像(阿里云同步)
docker run --rm -it --gpus all \
registry.cn-hangzhou.aliyuncs.com/deepmind/genie3:2025.08-cuda12.4
Dockerfile.dev
FROM deepmind/genie3:2025.08-cuda12.4
RUN apt update && apt install -y vim gdb python3.11-dbg
COPY requirements-dev.txt /tmp/
RUN pip install -r /tmp/requirements-dev.txt
WORKDIR /workspace
构建并挂载源码:
docker build -t genie3:dev -f Dockerfile.dev .
docker run -it --gpus all \
-v $(pwd):/workspace \
-p 8080:8080 -p 5678:5678 \
genie3:dev
version: "3.9"
services:
genie3:
image: deepmind/genie3:2025.08-cuda12.4
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
ports:
- "8080:8080"
volumes:
- ./data:/data
- ./outputs:/workspace/outputs
stdin_open: true
tty: true
一键启动:
docker compose up --build
deepmind-genie3\:latest”
• 机器类型 a2-ultragpu-1g
• 磁盘 150 GB
5. SSH 进入后直接 docker run
即可
aws ec2 run-instances \
--image-id ami-0genie3cuda12 \
--instance-type g5.xlarge \
--key-name mykey \
--user-data '#!/bin/bash
docker run -d --gpus all -p 80:8080 deepmind/genie3:2025.08-cuda12.4'
报错 | 根因 | 解决 |
---|---|---|
CUDA error: no kernel image | 驱动 < 535 | 升级驱动 |
libcuda.so.1 not found | 缺 nvidia runtime | 安装 nvidia-container-toolkit |
GLIBC_2.38 not found | Ubuntu 20.04 | 升级 22.04 |
No space left on device | /tmp 过小 | export TMPDIR=/data/tmp |
wandb Network error | 国内网络 | export WANDB_MODE=offline |
illegal instruction | 老 CPU | export GENIE3_CPU=generic |
ModuleNotFoundError: genie3 | pip 冲突 | 重装并清缓存 |
ImportError: worldgen | 版本不匹配 | 对齐版本号 |
Torch not compiled with CUDA | CPU 版 torch | 重新安装 GPU 版 |
x509 certificate unknown | 公司代理 | 指定 CA 证书 |
docker unknown server OS | Win 旧版 | 升级 Docker Desktop |
nvidia-container-cli mount error | WSL2 挂载 | wsl --shutdown |
UnicodeDecodeError | 中文路径 | 换英文目录 |
NCCL error | 多卡通讯 | export NCCL_P2P_DISABLE=1 |
Segmentation fault | 内存条故障 | memtester 检测 |
pip install notebook ipywidgets
jupyter notebook --ip=0.0.0.0 --port=8080 --allow-root
from genie3 import GenieClient, TextPrompt
client = GenieClient(api_key="YOUR_API_KEY") # 在 Hugging Face 账户设置页生成
prompt = TextPrompt(
text="漂浮在云端的未来图书馆,玻璃穹顶,极光流动",
style="cyberpunk",
render_size=(1920, 1080),
physics=True,
seed=42
)
world = client.generate(prompt, timeout=300) # 5 分钟
world.save_glb("/outputs/library.glb") # 导出 Blender
world.launch_player(port=7001) # 浏览器实时漫游
浏览器打开 localhost:7001
即可 WASD 漫游。
from genie3 import Sketch
sketch = Sketch.load("cat_on_moon.png")
world = client.generate(sketch, add_animals=["cat"], time_of_day="night")
pip install openai-whisper
python - < < 'PY'
import whisper, genie3
audio = whisper.load_audio("idea.m4a")
text = whisper.transcribe(audio)["text"]
world = genie3.TextPrompt(text).generate()
PY
仓库名:google-deepmind/genie3-unity
git clone <该仓库>
双击 Genie3.unitypackage
,拖拽 Genie3Streamer
预制体到场景,填写 API Key,Play。
插件已上架 Epic 官方商城,搜索 “Genie3”,支持 Lumen + Nanite。
dataset/
├── scene_0001/
│ ├── prompt.json
│ ├── mesh.glb
│ └── metadata.yaml
pip install peft accelerate
torchrun --nproc_per_node=2 \
-m genie3.train \
--model_name_or_path deepmind/genie3-7b \
--dataset_dir ./my_dataset \
--output_dir ./checkpoints \
--lora_rank 64 \
--num_epochs 3
优化项 | 收益 | 命令 |
---|---|---|
FP8 推理 | +60 % | export GENIE3_PRECISION=fp8 |
TensorRT | +40 % | pip install tensorrt |
Xformers | +15 % | pip install xformers |
NCCL 关闭 P2P | 避免多卡 hang | export NCCL_P2P_DISABLE=1 |
WSL2 内存上限 | 避免 OOM | .wslconfig 设 memory=32GB |
Q1:无 NVIDIA GPU 能跑吗?
→ CPU 版 1 FPS,或用 Colab 免费 T4。
Q2:原生 Windows 支持?
→ 2025.08 暂不支持,WSL2 100 % 兼容。
Q3:商用收费?
→ Apache-2.0,免费商用,需保留版权。
Q4:如何卸载?
→ docker rmi <镜像 >
或 pip uninstall genie3
。
社区贡献的 Notion 第三方嵌入:仓库 genie3-notion-embed
,复制 < iframe src="http://localhost:7001/embed?scene=xxx" / > >
即可在 Notion 实时旋转你的世界。
2022 年,Stable Diffusion 让 2D 平民化。
2025 年,Genie 3 让 3D 平民化。
今天,你只需一杯咖啡的时间,就能把脑海里的奇思妙想变成可漫游、可触摸、可二次开发的 3D 宇宙。
所以,还等什么?复制粘贴上面的命令,跑起来吧!
愿你的显卡永远风冷,显存永不溢出。
Happy Genie-ing!