diff --git a/.vscode/settings.json b/.vscode/settings.json index 46ce693..c108b75 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,9 @@ { "cSpell.words": [ "CUDA", + "manylinux", "onnxruntime", + "phonemize", "setuptools", "zxvf" ] diff --git a/Dockerfile b/Dockerfile index 5fc6c35..ea74106 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,9 +15,7 @@ RUN \ wget \ curl \ python3 \ - python3-pip \ - \ - && rm -rf /var/lib/apt/lists/* + python3-pip RUN \ pip3 install --no-cache-dir -U \ @@ -40,21 +38,22 @@ RUN \ onnxruntime-gpu \ "wyoming-piper @ https://github.com/rhasspy/wyoming-piper/archive/refs/tags/v${WYOMING_PIPER_VERSION}.tar.gz" \ \ - && rm -r piper_phonemize-1.1.0-py3-none-any.whl \ - \ - && apt-get purge -y --auto-remove \ - build-essential \ - python3-dev \ - \ - && rm -rf /var/lib/apt/lists/* + && rm -r piper_phonemize-1.1.0-py3-none-any.whl -# Patch to enable CUDA in piper +# Clean up +RUN \ + rm -rf /var/lib/apt/lists/* \ + && rm /*.deb \ + && mkdir -p /share/piper + +# Patch to enable CUDA arguments for piper COPY patch/process.py /usr/local/lib/python3.10/dist-packages/wyoming_piper/ COPY patch/__main__.py /usr/local/lib/python3.10/dist-packages/wyoming_piper/ WORKDIR / COPY run.sh ./ +RUN chmod +x /run.sh EXPOSE 10200 -ENTRYPOINT ["bash", "-c", "exec /run.sh \"${@}\"", "--"] \ No newline at end of file +ENTRYPOINT ["bash", "/run.sh \"${@}\""] \ No newline at end of file diff --git a/run.sh b/run.sh index b8ceec6..e9592fc 100644 --- a/run.sh +++ b/run.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python3.10/dist-packages/nvidia/cudnn/lib/ +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python3.10/dist-packages/nvidia/cudnn/lib/:/usr/local/lib/python3.10/dist-packages/nvidia/cublas/lib:/usr/local/lib/python3.10/dist-packages/nvidia/curand/lib/:/usr/local/lib/python3.10/dist-packages/nvidia/cufft/lib/:/usr/local/lib/python3.10/dist-packages/nvidia/cuda_runtime/lib/:/usr/local/lib/python3.10/dist-packages/nvidia/cuda_nvrtc/lib/ python3 -m wyoming_piper \ - --piper '/usr/share/piper/piper' \ + --piper '/usr/local/bin/piper' \ --cuda \ --uri 'tcp://0.0.0.0:10200' \ --data-dir /data \