| ARG RELEASE |
| ARG LAUNCHPAD_BUILD_ARCH |
| LABEL org.opencontainers.image.ref.name=ubuntu |
| LABEL org.opencontainers.image.version=24.04 |
| ADD file:1ae27d2ef4369361104b699712f3897141e394785df5d193d67b44626f57eb87 in / |
| CMD ["/bin/bash"] |
| ARG BASE_IMAGE=ubuntu:24.04 |
| ARG PYTHON_VERSION=3.12 |
| ARG PYTORCH_VERSION=2.10.0 |
| ARG TORCHVISION_VERSION=0.25.0 |
| ARG TORCHAUDIO_VERSION=2.10.0 |
| ARG TRITON_VERSION=3.6.0 |
| ARG APEX_VERSION=1.10.0 |
| ARG ROCM_VERSION=7.2 |
| ARG AMDGPU_VERSION=7.2.70200 |
| ARG UBUNTU_VERSION=24.04 |
| ARG PYTORCH_WHEEL_INDEX |
| LABEL org.opencontainers.image.ref.name=rocm/pytorch:rocm7.2_ubuntu24.04_py3.12_pytorch_release_2.10.0 |
| ENV DEBIAN_FRONTEND=noninteractive |
| RUN |11 BASE_IMAGE=ubuntu:24.04 PYTHON_VERSION=3.12 PYTORCH_VERSION=2.10.0 TORCHVISION_VERSION=0.25.0 TORCHAUDIO_VERSION=2.10.0 TRITON_VERSION=3.6.0 APEX_VERSION=1.10.0 ROCM_VERSION=7.2 AMDGPU_VERSION=7.2.70200 UBUNTU_VERSION=24.04 PYTORCH_WHEEL_INDEX= /bin/sh -c echo "tzdata tzdata/Areas select Etc" | debconf-set-selections && echo "tzdata tzdata/Zones/Etc select UTC" | debconf-set-selections # buildkit |
| RUN |11 BASE_IMAGE=ubuntu:24.04 PYTHON_VERSION=3.12 PYTORCH_VERSION=2.10.0 TORCHVISION_VERSION=0.25.0 TORCHAUDIO_VERSION=2.10.0 TRITON_VERSION=3.6.0 APEX_VERSION=1.10.0 ROCM_VERSION=7.2 AMDGPU_VERSION=7.2.70200 UBUNTU_VERSION=24.04 PYTORCH_WHEEL_INDEX= /bin/sh -c apt update && apt install -y wget software-properties-common curl rsync dialog git # buildkit |
| ENV PATH=/opt/rocm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| ENV LD_LIBRARY_PATH=/opt/rocm/lib |
| RUN |11 BASE_IMAGE=ubuntu:24.04 PYTHON_VERSION=3.12 PYTORCH_VERSION=2.10.0 TORCHVISION_VERSION=0.25.0 TORCHAUDIO_VERSION=2.10.0 TRITON_VERSION=3.6.0 APEX_VERSION=1.10.0 ROCM_VERSION=7.2 AMDGPU_VERSION=7.2.70200 UBUNTU_VERSION=24.04 PYTORCH_WHEEL_INDEX= /bin/sh -c add-apt-repository ppa:deadsnakes/ppa && apt update && apt install -y python${PYTHON_VERSION} python3-pip python3-venv && if [ "${PYTHON_VERSION}" = "3.8" ] || [ "${PYTHON_VERSION}" = "3.9" ] || [ "${PYTHON_VERSION}" = "3.10" ] || [ "${PYTHON_VERSION}" = "3.11" ]; then apt install -y --no-install-recommends python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-distutils python${PYTHON_VERSION}-venv; else apt install -y --no-install-recommends python${PYTHON_VERSION}-dev python${PYTHON_VERSION}-venv; fi && apt clean && rm -rf /var/lib/apt/lists/* # buildkit |
| RUN |11 BASE_IMAGE=ubuntu:24.04 PYTHON_VERSION=3.12 PYTORCH_VERSION=2.10.0 TORCHVISION_VERSION=0.25.0 TORCHAUDIO_VERSION=2.10.0 TRITON_VERSION=3.6.0 APEX_VERSION=1.10.0 ROCM_VERSION=7.2 AMDGPU_VERSION=7.2.70200 UBUNTU_VERSION=24.04 PYTORCH_WHEEL_INDEX= /bin/sh -c python${PYTHON_VERSION} -m venv /opt/venv && . /opt/venv/bin/activate && /opt/venv/bin/python -m pip install --upgrade pip && /opt/venv/bin/python -m pip install --upgrade setuptools && /opt/venv/bin/python -m pip install hypothesis scipy ninja # buildkit |
| ENV PATH=/opt/venv/bin:/opt/rocm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| RUN |11 BASE_IMAGE=ubuntu:24.04 PYTHON_VERSION=3.12 PYTORCH_VERSION=2.10.0 TORCHVISION_VERSION=0.25.0 TORCHAUDIO_VERSION=2.10.0 TRITON_VERSION=3.6.0 APEX_VERSION=1.10.0 ROCM_VERSION=7.2 AMDGPU_VERSION=7.2.70200 UBUNTU_VERSION=24.04 PYTORCH_WHEEL_INDEX= /bin/sh -c cd /tmp && if [ "$PYTHON_VERSION" = "3.12" ]; then wget https://repo.radeon.com/amdgpu-install/${ROCM_VERSION}/ubuntu/noble/amdgpu-install_${AMDGPU_VERSION}-1_all.deb; else wget https://repo.radeon.com/amdgpu-install/${ROCM_VERSION}/ubuntu/jammy/amdgpu-install_${AMDGPU_VERSION}-1_all.deb; fi && apt install -y ./*.deb && amdgpu-install --usecase=rocm -y && rm -f ./*.deb && apt clean && rm -rf /var/lib/apt/lists/* # buildkit |
| RUN |11 BASE_IMAGE=ubuntu:24.04 PYTHON_VERSION=3.12 PYTORCH_VERSION=2.10.0 TORCHVISION_VERSION=0.25.0 TORCHAUDIO_VERSION=2.10.0 TRITON_VERSION=3.6.0 APEX_VERSION=1.10.0 ROCM_VERSION=7.2 AMDGPU_VERSION=7.2.70200 UBUNTU_VERSION=24.04 PYTORCH_WHEEL_INDEX= /bin/sh -c set -e && WHEEL_INDEX="${PYTORCH_WHEEL_INDEX:-https://repo.radeon.com/rocm/manylinux/rocm-rel-${ROCM_VERSION}/}" && echo "Installing PyTorch ROCm from $WHEEL_INDEX for Python $PYTHON_VERSION" && if [ "$PYTHON_VERSION" != "3.10" ] && [ "$PYTHON_VERSION" != "3.12" ]; then echo "Unsupported Python version: $PYTHON_VERSION (only 3.10 and 3.12 supported for PyTorch wheels)"; exit 1; fi && pip install --find-links "${WHEEL_INDEX}" --prefer-binary "torch~=${PYTORCH_VERSION}" "torchvision~=${TORCHVISION_VERSION}" "torchaudio~=${TORCHAUDIO_VERSION}" "triton~=${TRITON_VERSION}" && pip install --find-links "${WHEEL_INDEX}" --prefer-binary "apex~=${APEX_VERSION}" 2>/dev/null || true && for pkg in torch torchvision torchaudio triton apex; do pip show "$pkg" >/dev/null 2>&1 || { echo "ERROR: Package $pkg not installed"; exit 1; }; done # buildkit |
| RUN |11 BASE_IMAGE=ubuntu:24.04 PYTHON_VERSION=3.12 PYTORCH_VERSION=2.10.0 TORCHVISION_VERSION=0.25.0 TORCHAUDIO_VERSION=2.10.0 TRITON_VERSION=3.6.0 APEX_VERSION=1.10.0 ROCM_VERSION=7.2 AMDGPU_VERSION=7.2.70200 UBUNTU_VERSION=24.04 PYTORCH_WHEEL_INDEX= /bin/sh -c git clone https://github.com/ROCm/pytorch-micro-benchmarking /var/lib/jenkins/pytorch-micro-benchmarking && ln -sf /usr/bin/python3 /usr/bin/python # buildkit |
| WORKDIR /workspace |
| RUN /bin/sh -c apt-get update && apt-get install -y --no-install-recommends libsndfile1 ffmpeg portaudio19-dev && rm -rf /var/lib/apt/lists/* # buildkit |
| RUN /bin/sh -c git clone --depth 1 https://github.com/RVC-Boss/GPT-SoVITS.git /workspace/GPT-SoVITS # buildkit |
| WORKDIR /workspace/GPT-SoVITS |
| RUN /bin/sh -c pip install --no-cache-dir onnxruntime && pip install --no-cache-dir $(python -c "reqs = open('requirements.txt').readlines(); skip = {'torch', 'torchaudio', 'torchvision', 'onnxruntime'}; filtered = [r.strip().split(';')[0] for r in reqs if r.strip() and not r.startswith('#') and not r.startswith('--')]; print(' '.join(r for r in filtered if not any(r.lower().startswith(s) for s in skip)))") && pip install --no-cache-dir soundfile # buildkit |
| RUN /bin/sh -c pip install --no-cache-dir huggingface_hub && python -c "from huggingface_hub import hf_hub_download; import zipfile, os; path = hf_hub_download('XXXXRT/GPT-SoVITS-Pretrained', 'pretrained_models.zip', local_dir='/tmp/dl'); z = zipfile.ZipFile(path); z.extractall('GPT_SoVITS/'); z.close(); os.remove(path); print('Pretrained models extracted')" # buildkit |
| RUN /bin/sh -c python -c "from huggingface_hub import hf_hub_download; import zipfile, os; path = hf_hub_download('XXXXRT/GPT-SoVITS-Pretrained', 'G2PWModel.zip', local_dir='/tmp/dl'); z = zipfile.ZipFile(path); z.extractall('GPT_SoVITS/text/'); z.close(); os.remove(path); print('G2PW model extracted')" # buildkit |
| RUN /bin/sh -c python -c "from huggingface_hub import hf_hub_download; import zipfile, sys, os; path = hf_hub_download('XXXXRT/GPT-SoVITS-Pretrained', 'nltk_data.zip', local_dir='/tmp/dl'); z = zipfile.ZipFile(path); z.extractall(sys.prefix); z.close(); os.remove(path); print('NLTK data extracted')" # buildkit |
| RUN /bin/sh -c python -c "from huggingface_hub import hf_hub_download; import tarfile, os; import pyopenjtalk; path = hf_hub_download('XXXXRT/GPT-SoVITS-Pretrained', 'open_jtalk_dic_utf_8-1.11.tar.gz', local_dir='/tmp/dl'); t = tarfile.open(path, 'r:gz'); t.extractall(os.path.dirname(pyopenjtalk.__file__)); t.close(); os.remove(path); print('Open JTalk dictionary extracted')" # buildkit |
| RUN /bin/sh -c python -c "from huggingface_hub import hf_hub_download; hf_hub_download('lj1995/GPT-SoVITS', 'gsv-v4-pretrained/s2Gv4.pth', local_dir='GPT_SoVITS/pretrained_models'); hf_hub_download('lj1995/GPT-SoVITS', 'gsv-v4-pretrained/vocoder.pth', local_dir='GPT_SoVITS/pretrained_models'); print('v4 models downloaded')" # buildkit |
| RUN /bin/sh -c rm -rf /tmp/dl /root/.cache/huggingface # buildkit |
| RUN /bin/sh -c mkdir -p /workspace/GPT-SoVITS/references # buildkit |
| ENV PYTHONPATH=/workspace/GPT-SoVITS |
| COPY tts_infer.yaml /workspace/GPT-SoVITS/GPT_SoVITS/configs/tts_infer.yaml # buildkit |
| COPY patches/fix_torchaudio_rocm.py /workspace/GPT-SoVITS/fix_torchaudio_rocm.py # buildkit |
| COPY start.py /workspace/GPT-SoVITS/start.py # buildkit |
| EXPOSE [9880/tcp] |
| CMD ["python" "start.py"] |