但!社區(qū)第一天就炸出 200+ Issue:
? CUDA 版本地獄
? 25 GB 鏡像下載失敗
? AMD 顯卡直接 Segmentation fault
? WSL2 掛載目錄 0x80070005

于是有了這篇「熱血又硬核」的安裝與避坑指南——一篇就夠,復(fù)制粘貼即可跑通


2. 30 秒速覽:讀完你能帶走什么

  1. 官方 & 社區(qū)鏡像一鍵腳本(x86_64 + ARM 雙架構(gòu))
  2. CUDA 12.4 / 11.8 雙棧并存方案
  3. WSL2 + Ubuntu 22.04 最佳實(shí)踐
  4. macOS Apple Silicon 打通 Rosetta + Metal
  5. 15 個(gè)高頻報(bào)錯(cuò)逐行拆解
  6. Python API 最小可運(yùn)行示例
  7. 免費(fèi)申請(qǐng) Cloud TPU / GPU 的隱藏通道

3. 安裝前檢查清單(TL;DR)

檢查項(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 鏡像,建議代理

4. 官方資源索引

? 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


5. 路線(xiàn)選擇:裸機(jī) vs Docker vs Cloud

場(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

6. 裸機(jī)安裝(Ubuntu 22.04 示例)

6.1 系統(tǒng)級(jí)依賴(lài)

sudo apt update && sudo apt install -y \
  build-essential git wget curl ca-certificates \
  python3.11 python3.11-venv python3-pip

6.2 CUDA 12.4 雙棧并存(兼容 11.8)

# 下載官方 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 版本。

6.3 創(chuàng)建虛擬環(huán)境

python3.11 -m venv ~/venv-genie3
source ~/venv-genie3/bin/activate
pip install -U pip wheel

6.4 安裝核心包

pip install "genie3[torch]" \
  --extra-index-url https://pypi.nvidia.com

坑 1:國(guó)內(nèi)用戶(hù)請(qǐng)將 pypi.nvidia.com 換成 清華鏡像

6.5 驗(yàn)證 GPU 可見(jiàn)

python - < < 'PY'
import torch, genie3
print("Torch:", torch.__version__)
print("CUDA:", torch.cuda.is_available())
print("GPU:", torch.cuda.get_device_name(0))
PY

7. Docker 鏡像(最推薦)

7.1 一行命令啟動(dòng)官方鏡像

# 官方鏡像
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

7.2 本地開(kāi)發(fā)鏡像(含調(diào)試工具)

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

7.3 docker-compose.yml(懶人福音)

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

8. Cloud 路線(xiàn):白嫖 300 美元 GPU 配額

8.1 Google Cloud(最穩(wěn))

  1. 打開(kāi) Google Cloud 控制臺(tái)
  2. 新建項(xiàng)目 → 激活 Vertex AI API
  3. 表單申請(qǐng) A100 80GB 配額(5 分鐘通過(guò))
  4. 啟動(dòng) Vertex Workbench:
    ? 鏡像選 “

deepmind-genie3\:latest”
? 機(jī)器類(lèi)型 a2-ultragpu-1g
? 磁盤(pán) 150 GB
5. SSH 進(jìn)入后直接 docker run 即可

8.2 AWS G5 競(jìng)價(jià)實(shí)例(最便宜)

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'

9. 15 個(gè)高頻報(bào)錯(cuò) & 逐行拆解

報(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è)

10. Python API 5 分鐘上手

10.1 安裝 Jupyter(可選)

pip install notebook ipywidgets
jupyter notebook --ip=0.0.0.0 --port=8080 --allow-root

10.2 Hello Genie 3(文字 → 3D)

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 漫游。

10.3 草圖 → 3D

from genie3 import Sketch
sketch = Sketch.load("cat_on_moon.png")
world = client.generate(sketch, add_animals=["cat"], time_of_day="night")

10.4 語(yǔ)音 → 3D(Whisper 鏈?zhǔn)剑?/h3>
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

11. Unity / Unreal 實(shí)時(shí)鏈路

11.1 Unity 插件(預(yù)覽)

倉(cāng)庫(kù)名:google-deepmind/genie3-unity

git clone <該倉(cāng)庫(kù)>

雙擊 Genie3.unitypackage,拖拽 Genie3Streamer 預(yù)制體到場(chǎng)景,填寫(xiě) API Key,Play。

11.2 Unreal Engine 5.4

插件已上架 Epic 官方商城,搜索 “Genie3”,支持 Lumen + Nanite。


12. 進(jìn)階:微調(diào)專(zhuān)屬「世界模型」

12.1 數(shù)據(jù)集結(jié)構(gòu)

dataset/
├── scene_0001/
│ ├── prompt.json
│ ├── mesh.glb
│ └── metadata.yaml

12.2 LoRA 微調(diào) 1 小時(shí)

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

13. 性能優(yōu)化:30 FPS 不是夢(mèng)

優(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

14. FAQ 快問(wèn)快答

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


15. 彩蛋:把 3D 世界嵌進(jìn) Notion

社區(qū)貢獻(xiàn)的 Notion 第三方嵌入:倉(cāng)庫(kù) genie3-notion-embed,復(fù)制 < iframe src="http://localhost:7001/embed?scene=xxx" / > > 即可在 Notion 實(shí)時(shí)旋轉(zhuǎn)你的世界。


16. 結(jié)語(yǔ):歡迎來(lái)到「人人都是 3D 導(dǎo)演」的時(shí)代

2022 年,Stable Diffusion 讓 2D 平民化。
2025 年,Genie 3 讓 3D 平民化。

今天,你只需一杯咖啡的時(shí)間,就能把腦海里的奇思妙想變成可漫游、可觸摸、可二次開(kāi)發(fā)的 3D 宇宙。
所以,還等什么?復(fù)制粘貼上面的命令,跑起來(lái)吧!

愿你的顯卡永遠(yuǎn)風(fēng)冷,顯存永不溢出。
Happy Genie-ing!

上一篇:

Google DeepMind發(fā)布 Genie 3:5分鐘快速接入API教程(Python/Node/Unity)

下一篇:

多模態(tài) Prompt Engineering 技術(shù)深度 2025:文生圖/視頻提示詞設(shè)計(jì) 7 大實(shí)戰(zhàn)黃金法則
#你可能也喜歡這些API文章!

我們有何不同?

API服務(wù)商零注冊(cè)

多API并行試用

數(shù)據(jù)驅(qū)動(dòng)選型,提升決策效率

查看全部API→
??

熱門(mén)場(chǎng)景實(shí)測(cè),選對(duì)API

#AI文本生成大模型API

對(duì)比大模型API的內(nèi)容創(chuàng)意新穎性、情感共鳴力、商業(yè)轉(zhuǎn)化潛力

25個(gè)渠道
一鍵對(duì)比試用API 限時(shí)免費(fèi)

#AI深度推理大模型API

對(duì)比大模型API的邏輯推理準(zhǔn)確性、分析深度、可視化建議合理性

10個(gè)渠道
一鍵對(duì)比試用API 限時(shí)免費(fèi)