
REST API命名規(guī)范的終極指南:清晰度和一致性的最佳實(shí)踐
但!社區(qū)第一天就炸出 200+ Issue:
? CUDA 版本地獄
? 25 GB 鏡像下載失敗
? AMD 顯卡直接 Segmentation fault
? WSL2 掛載目錄 0x80070005
…
于是有了這篇「熱血又硬核」的安裝與避坑指南——一篇就夠,復(fù)制粘貼即可跑通。
檢查項(xiàng) | 最低 | 推薦 | 備注 |
---|---|---|---|
GPU | RTX 3060 12 GB | RTX 4090 24 GB | FP8 推理 30 FPS+ |
CUDA | 11.8 | 12.4 | 向下兼容 |
驅(qū)動(dòng) | 535.x | 550.x | Linux ≥ 535.54.03 |
Docker | 24.0 | 26.1 | 需 NVIDIA Container Toolkit |
磁盤(pán) | 60 GB | 120 GB | 鏡像 + 緩存 |
網(wǎng)絡(luò) | 20 Mbps | 100 Mbps | 25 GB 鏡像,建議代理 |
? GitHub 主倉(cāng)庫(kù):搜索 “google-deepmind / genie3”
? 官方文檔:DeepMind 官網(wǎng) → Products → Genie 3 → Docs
? Docker Hub 認(rèn)證鏡像:Docker Hub 搜索 “deepmind/genie3”
? Hugging Face 權(quán)重:搜索 “deepmind/genie3-2b / 7b / 20b”
? Colab 體驗(yàn):GitHub 倉(cāng)庫(kù)內(nèi) notebooks/quickstart.ipynb
? Discord 實(shí)時(shí)答疑:DeepMind 官方 Discord 頻道 #genie3
場(chǎng)景 | 優(yōu)點(diǎn) | 缺點(diǎn) | 本文章節(jié) |
---|---|---|---|
裸機(jī) pip install | 最新 commit 即刻用 | CUDA 地獄 | §6 |
Docker 本地 | 一次搞定,可復(fù)現(xiàn) | 鏡像大 | §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
# 寫(xiě)入環(huán)境變量
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:國(guó)內(nèi)用戶(hù)請(qǐng)將
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
# 國(guó)內(nèi)鏡像(阿里云同步)
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
構(gòu)建并掛載源碼:
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
一鍵啟動(dòng):
docker compose up --build
deepmind-genie3\:latest”
? 機(jī)器類(lèi)型 a2-ultragpu-1g
? 磁盤(pán) 150 GB
5. SSH 進(jìn)入后直接 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'
報(bào)錯(cuò) | 根因 | 解決 |
---|---|---|
CUDA error: no kernel image | 驅(qū)動(dòng) < 535 | 升級(jí)驅(qū)動(dòng) |
libcuda.so.1 not found | 缺 nvidia runtime | 安裝 nvidia-container-toolkit |
GLIBC_2.38 not found | Ubuntu 20.04 | 升級(jí) 22.04 |
No space left on device | /tmp 過(guò)小 | export TMPDIR=/data/tmp |
wandb Network error | 國(guó)內(nèi)網(wǎng)絡(luò) | export WANDB_MODE=offline |
illegal instruction | 老 CPU | export GENIE3_CPU=generic |
ModuleNotFoundError: genie3 | pip 沖突 | 重裝并清緩存 |
ImportError: worldgen | 版本不匹配 | 對(duì)齊版本號(hào) |
Torch not compiled with CUDA | CPU 版 torch | 重新安裝 GPU 版 |
x509 certificate unknown | 公司代理 | 指定 CA 證書(shū) |
docker unknown server OS | Win 舊版 | 升級(jí) Docker Desktop |
nvidia-container-cli mount error | WSL2 掛載 | wsl --shutdown |
UnicodeDecodeError | 中文路徑 | 換英文目錄 |
NCCL error | 多卡通訊 | export NCCL_P2P_DISABLE=1 |
Segmentation fault | 內(nèi)存條故障 | memtester 檢測(cè) |
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 賬戶(hù)設(shè)置頁(yè)生成
prompt = TextPrompt(
text="漂浮在云端的未來(lái)圖書(shū)館,玻璃穹頂,極光流動(dòng)",
style="cyberpunk",
render_size=(1920, 1080),
physics=True,
seed=42
)
world = client.generate(prompt, timeout=300) # 5 分鐘
world.save_glb("/outputs/library.glb") # 導(dǎo)出 Blender
world.launch_player(port=7001) # 瀏覽器實(shí)時(shí)漫游
瀏覽器打開(kāi) 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
倉(cāng)庫(kù)名:google-deepmind/genie3-unity
git clone <該倉(cāng)庫(kù)>
雙擊 Genie3.unitypackage
,拖拽 Genie3Streamer
預(yù)制體到場(chǎng)景,填寫(xiě) 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
優(yōu)化項(xiàng) | 收益 | 命令 |
---|---|---|
FP8 推理 | +60 % | export GENIE3_PRECISION=fp8 |
TensorRT | +40 % | pip install tensorrt |
Xformers | +15 % | pip install xformers |
NCCL 關(guān)閉 P2P | 避免多卡 hang | export NCCL_P2P_DISABLE=1 |
WSL2 內(nèi)存上限 | 避免 OOM | .wslconfig 設(shè) memory=32GB |
Q1:無(wú) NVIDIA GPU 能跑嗎?
→ CPU 版 1 FPS,或用 Colab 免費(fèi) T4。
Q2:原生 Windows 支持?
→ 2025.08 暫不支持,WSL2 100 % 兼容。
Q3:商用收費(fèi)?
→ Apache-2.0,免費(fèi)商用,需保留版權(quán)。
Q4:如何卸載?
→ docker rmi <鏡像 >
或 pip uninstall genie3
。
社區(qū)貢獻(xiàn)的 Notion 第三方嵌入:倉(cāng)庫(kù) genie3-notion-embed
,復(fù)制 < iframe src="http://localhost:7001/embed?scene=xxx" / > >
即可在 Notion 實(shí)時(shí)旋轉(zhuǎn)你的世界。
2022 年,Stable Diffusion 讓 2D 平民化。
2025 年,Genie 3 讓 3D 平民化。
今天,你只需一杯咖啡的時(shí)間,就能把腦海里的奇思妙想變成可漫游、可觸摸、可二次開(kāi)發(fā)的 3D 宇宙。
所以,還等什么?復(fù)制粘貼上面的命令,跑起來(lái)吧!
愿你的顯卡永遠(yuǎn)風(fēng)冷,顯存永不溢出。
Happy Genie-ing!
REST API命名規(guī)范的終極指南:清晰度和一致性的最佳實(shí)踐
【豆包大模型】-Python調(diào)用豆包大模型API及文本轉(zhuǎn)語(yǔ)音TTS
免費(fèi)IP地址查詢(xún)API接口推薦
DeepSeek R1 × 飛書(shū)多維表格賦能教育領(lǐng)域
全面解讀:REST API與OpenAPI的區(qū)別、應(yīng)用及最佳實(shí)踐指南
5款強(qiáng)大且高效的API漏洞掃描工具推薦
Twitter (x) API 介紹:在線(xiàn)使用和集成指南
DeepSeek+ima:打造高效個(gè)人知識(shí)庫(kù),提升學(xué)習(xí)與工作效率
ComfyUI API是什么:深入探索ComfyUI的API接口與應(yīng)用
對(duì)比大模型API的內(nèi)容創(chuàng)意新穎性、情感共鳴力、商業(yè)轉(zhuǎn)化潛力
一鍵對(duì)比試用API 限時(shí)免費(fèi)