
Duix-Avatar 去 Docker Desktop 本地化完整复盘 Duix Avatar——真正开源的AI虚拟形象工具包支持离线视频生成和数字人类克隆背景与思路Duix-Avatar 由三个服务组成原本通过 Docker Desktop 运行。目标是完全摆脱 Docker Desktop直接用 WSL2 承载这三个服务。核心判断项目的视频合成核心全部编译成了.cpython-38-x86_64-linux-gnu.so只能在 Linux x86_64 Python 3.8 下运行Windows native 无法加载因此 WSL2 是唯一可行的本地化路径。三个服务说明【保姆级教程】Windows Podman 从零部署 Duix-Avatar 数字人项目【笔记】Podman Desktop 部署 开源数字人 HeyGem.ai【笔记】在 Podman MachineFedora 42中安装 NVIDIA Container Toolkit 使镜像能使用GPUWindows 开发环境部署指南WSL、Docker Desktop、Podman Desktop 部署顺序与存储路径迁移指南在WSL-podman-machine-default (Fedora Linux 42) 中安装 CUDA 13.0、cuDNN 9.14、Anaconda 2025.06、PyTorch 2.10用Podman Desktop创建自用的WSL-Fedora Linux子系统新在 podman-machine-default 中安装 CUDA、cuDNN、Anaconda、PyTorch 等并验证安装PyCharm 链接 Podman Desktop 的 podman-machine-default Linux 虚拟环境Podman Desktop现代轻量容器管理利器Podman与Docker来自 Podman Desktop 拉取完毕的镜像服务镜像端口职责duix-avatar-gen-videoguiji2025/duix.avatar8383lip-sync 视频合成核心duix-avatar-ttsguiji2025/fish-speech-ziming18180声音克隆 TTSduix-avatar-asrguiji2025/fun-asr10095语音识别ASR第一步确认镜像大小和磁盘空间podman image inspect guiji2025/duix.avatar --format {{.Size}} podman image inspect guiji2025/fish-speech-ziming --format {{.Size}} podman image inspect guiji2025/fun-asr --format {{.Size}} Get-PSDrive J # 确认目标盘剩余空间三个镜像合计约 64GB导出 tar 导入 vhdx 峰值需要约 130GB 空闲空间。第二步建立目录结构New-Item -ItemType Directory -Path J:\duix_export -Force New-Item -ItemType Directory -Path J:\wsl\duix-avatar -Force New-Item -ItemType Directory -Path J:\wsl\duix-fish -Force New-Item -ItemType Directory -Path J:\wsl\duix-asr -Force第三步逐个导出容器并导入 WSL2每次导出一个、验证后删除 tar 再导下一个节省磁盘峰值占用。duix-avatar最小先练手podman create --name tmp_avatar guiji2025/duix.avatar sleep 999 podman export tmp_avatar -o J:\duix_export\avatar.tar podman rm tmp_avatar wsl --import duix-avatar J:\wsl\duix-avatar J:\duix_export\avatar.tar --version 2 # 验证成功后删除 Remove-Item J:\duix_export\avatar.tarduix-asrpodman create --name tmp_asr guiji2025/fun-asr sleep 999 podman export tmp_asr -o J:\duix_export\asr.tar podman rm tmp_asr wsl --import duix-asr J:\wsl\duix-asr J:\duix_export\asr.tar --version 2 Remove-Item J:\duix_export\asr.tarduix-fish最大最后podman create --name tmp_fish guiji2025/fish-speech-ziming sleep 999 podman export tmp_fish -o J:\duix_export\fish.tar podman rm tmp_fish wsl --import duix-fish J:\wsl\duix-fish J:\duix_export\fish.tar --version 2 Remove-Item J:\duix_export\fish.tar第四步修复 GPU 直通三个发行版都要做容器镜像内/lib/x86_64-linux-gnu/里有大量空占位.so文件会干扰 WSL2 的 GPU 桥接库需要清除并重建软链。# 对 duix-avatar、duix-asr、duix-fish 各执行一次替换发行版名称 wsl -d duix-avatar -- bash -c find /lib/x86_64-linux-gnu/ -name libnvidia-*.so* -empty -delete find /lib/x86_64-linux-gnu/ -name libcuda*.so* -empty -delete find /lib/x86_64-linux-gnu/ -name libcudadebugger*.so* -empty -delete echo /usr/lib/wsl/lib /etc/ld.so.conf.d/wsl.conf ldconfig 2/dev/null rm /usr/bin/nvidia-smi 2/dev/null ln -s /usr/lib/wsl/lib/nvidia-smi /usr/bin/nvidia-smi nvidia-smi | head -5 验证标准能看到NVIDIA-SMI输出和 GPU 型号即成功。第五步建立数据目录软链客户端实际使用的数据目录是D:\heygem_data\注意不是 README 里写的duix_avatar_data要以客户端 asar 解包后的实际路径为准。# avatarface2face 数据目录 wsl -d duix-avatar -- bash -c rm -rf /code/data ln -s /mnt/d/heygem_data/face2face /code/data ls /code/data/ # fishvoice/data 目录 wsl -d duix-fish -- bash -c rm -rf /code/data ln -s /mnt/d/heygem_data/voice/data /code/data ls /code/data/origin_audio/ | tail -3 第六步修复 fish 服务的 ASR 主机名配置fish 服务内部通过 WebSocket 连接 ASR配置文件里主机名是 Docker 容器名duix-avatar-asr在 WSL2 环境中无法解析需要改为127.0.0.1。 f open(/code/config/config.py, r) content f.read() f.close() content content.replace(duix-avatar-asr, 127.0.0.1) f open(/code/config/config.py, w) f.write(content) f.close() print(done) | wsl -d duix-fish -- bash -c cat /tmp/fix_config.py python3 /tmp/fix_config.py # 验证 wsl -d duix-fish -- bash -c grep fun_asr_host /code/config/config.py期望输出fun_asr_host 127.0.0.1第七步设置环境变量wsl -d duix-avatar -- bash -c echo export PYTORCH_CUDA_ALLOC_CONFmax_split_size_mb:512 /root/.bashrc第八步写一键启动脚本fish 服务需要直接监听 18180WSL2 没有 Docker 的端口映射层不能用 8080。 # Duix Avatar 一键启动脚本WSL2 版无需 Docker Desktop Write-Host 启动 duix-asr (ASR服务 port:10095)... -ForegroundColor Cyan Start-Process wsl -ArgumentList -d duix-asr -- bash -c cd /workspace/FunASR/runtime sh /run.sh -WindowStyle Normal Start-Sleep 2 Write-Host 启动 duix-fish (TTS服务 port:18180)... -ForegroundColor Cyan Start-Process wsl -ArgumentList -d duix-fish -- bash -c cd /code /opt/conda/envs/python310/bin/python3 tools/api_server.py --listen 0.0.0.0:18180 -WindowStyle Normal Start-Sleep 2 Write-Host 启动 duix-avatar (视频合成服务 port:8383)... -ForegroundColor Cyan Start-Process wsl -ArgumentList -d duix-avatar -- bash -c export PYTORCH_CUDA_ALLOC_CONFmax_split_size_mb:512 cd /code python3 app_local.py -WindowStyle Normal Write-Host Write-Host 服务启动中等待约 30 秒后可打开客户端... -ForegroundColor Green Write-Host ASR: ws://127.0.0.1:10095 -ForegroundColor Gray Write-Host TTS: http://127.0.0.1:18180 -ForegroundColor Gray Write-Host Video: http://127.0.0.1:8383 -ForegroundColor Gray | Out-File -FilePath D:\Program\start-duix.ps1 -Encoding UTF8一键停止脚本 Write-Host 停止所有 Duix 服务... -ForegroundColor Yellow wsl -d duix-avatar -- bash -c pkill -f app_local.py 2/dev/null; echo done wsl -d duix-fish -- bash -c pkill -f api_server.py 2/dev/null; echo done wsl -d duix-asr -- bash -c pkill -f run_server.sh 2/dev/null; pkill -f funasr 2/dev/null; echo done wsl --terminate duix-avatar wsl --terminate duix-fish wsl --terminate duix-asr Write-Host 所有服务已停止 -ForegroundColor Green | Out-File -FilePath D:\Program\stop-duix.ps1 -Encoding UTF8踩坑记录坑原因解法nvidia-smi无输出镜像内有空占位.so覆盖了 WSL 桥接库删除空文件 软链到/usr/lib/wsl/lib/nvidia-smiTTS 返回 500NoneType has no attribute sendconfig.py里 ASR 主机名是 Docker 容器名duix-avatar-asr改为127.0.0.1TTS 端口 18180 不通WSL2 没有 Docker 的端口映射服务监听 8080 但客户端访问 18180直接让服务监听 18180file not exists软链指向了错误的数据目录duix_avatar_data客户端实际写入的是heygem_data重建软链指向heygem_dataSQLite 绑定错误train()失败返回false被当作voiceId写入数据库根因是以上几个问题逐一修复后自然解决最终验证Test-NetConnection -ComputerName 127.0.0.1 -Port 8383 # 视频合成 ✅ Test-NetConnection -ComputerName 127.0.0.1 -Port 18180 # TTS ✅ Test-NetConnection -ComputerName 127.0.0.1 -Port 10095 # ASR ✅GPU 合成期间sm 83%完全 GPU 推理速度与原 Docker 版本一致。