
题主用的是BW1000机器理论上其它卡型也能支持容器准备目前最新的镜像是dtk26.04# 拉取镜像 docker pull harbor.sourcefind.cn:5443/dcu/admin/base/pytorch:2.9.0-ubuntu22.04-dtk26.04-py3.10 # 创建容器 docker run -d -t -v ~:/data -v /opt/hyhal:/opt/hyhal:ro --workdir /data/ --privileged --shm-size32G --device/dev/kfd --device/dev/dri/ --networkhost --device /dev/mkfd --group-add video --name wan_infer harbor.sourcefind.cn:5443/dcu/admin/base/pytorch:2.9.0-ubuntu22.04-dtk26.04 -py3.10 # 进入容器 docker exec -it wan_infer bash环境准备# 运行wan_dancer的相关命令 git clone https://github.com/Wan-Video/Wan-Dancer.git cd /path/to/Wan-Dancer # 没有创建虚拟环境隔离依赖因为镜像中已经有了torch/flash版本按照自己的需求来吧 pip install -e . --no-deps pip install https://download.sourcefind.cn:65024/file/4/flash_attn/DAS1.8/flash_attn-2.8.3das.opt1.dtk2604.torch290-cp310-cp310-manylinux_2_28_x86_64.whl pip install moviepy loguru librosa modelscope controlnet-aux0.0.7 ftfy pynvml pycountry distvae pip install diffusers0.34.0 yunchang0.5.0 transformers4.55.2 xfuser0.4.0 numpy1.25.0 pycountry运行脚本先修改文件/usr/local/lib/python3.10/dist-packages/xfuser/envs.py 第 45 行xfusers会对基础环境做一些检查为了跑通暂时绕过该检查原代码要求cuda 11.3改前CUDA_VERSION: lambda: version.parse(torch.version.cuda),改后CUDA_VERSION: lambda: version.parse(torch.version.cuda or 99.0.0),修改运行脚本如下主要是针对卡数和平台设备做了特定说明不需要严格按照官方设置8卡运行推理时间会更久一些gen_video_global.shgen_video_local.sh同理修改# Activate your venv, and run the script in the project root dir seed0 image_pathgen_video/ref_image/3001.jpg prompt_pathgen_video/prompt/kpop_global.txt music_pathgen_video/music/KPopDance.WAV output_folderoutputs/global_video/ timestamp$(date %Y%m%d_%H%M%S_%N) num_inference_steps48 cfg_scale5 main_process_ip${MASTER_ADDR:-localhost} main_process_port${MASTER_PORT:-8899} machine_rank${RANK:-0} num_machines${WORLD_SIZE:-1} gpu_count2 num_processes$((num_machines * gpu_count)) HIP_VISIBLE_DEVICES6,7 torchrun \ --nproc_per_node${gpu_count} \ --master_addr${main_process_ip} \ --master_port${main_process_port} \ --nnodes${num_machines} \ --node_rank${machine_rank} \ gen_video/gen_video_global.py \ --seed $seed \ --image_path $image_path \ --prompt_path $prompt_path \ --music_path $music_path \ --output_folder $output_folder \ --timestamp ${timestamp} \ --num_inference_steps $num_inference_steps \ --cfg_scale $cfg_scale