From d1b167d7c77087a45b5492010fb88e8eefdba6ee Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sun, 24 Nov 2024 22:19:24 -0500 Subject: [PATCH 01/10] Update Dockerfile --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5fc6c35..0aae3f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,7 +54,8 @@ 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 From 373cf11824e411d3c2ca2e0ff9895391621410dc Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sun, 24 Nov 2024 22:19:27 -0500 Subject: [PATCH 02/10] Update run.sh --- run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.sh b/run.sh index b8ceec6..2202aef 100644 --- a/run.sh +++ b/run.sh @@ -2,7 +2,7 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python3.10/dist-packages/nvidia/cudnn/lib/ python3 -m wyoming_piper \ - --piper '/usr/share/piper/piper' \ + --piper 'piper' \ --cuda \ --uri 'tcp://0.0.0.0:10200' \ --data-dir /data \ From e7678af95106ce517c3bac9a9e50cbe44dfc9458 Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sun, 24 Nov 2024 22:31:28 -0500 Subject: [PATCH 03/10] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0aae3f9..1fb385b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ RUN \ build-essential \ python3-dev \ \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* /*.deb # Patch to enable CUDA in piper COPY patch/process.py /usr/local/lib/python3.10/dist-packages/wyoming_piper/ From e739bded2827bda19091b03836504a0eda041d23 Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sun, 24 Nov 2024 22:31:33 -0500 Subject: [PATCH 04/10] Update run.sh --- run.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/run.sh b/run.sh index 2202aef..d81a500 100644 --- a/run.sh +++ b/run.sh @@ -6,5 +6,4 @@ python3 -m wyoming_piper \ --cuda \ --uri 'tcp://0.0.0.0:10200' \ --data-dir /data \ - --data-dir /share/piper \ --download-dir /data "$@" From bc8689954ef7b6a775bc05b6d2d53f9fdea5dfc4 Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sun, 24 Nov 2024 22:55:46 -0500 Subject: [PATCH 05/10] Update settings.json --- .vscode/settings.json | 2 ++ 1 file changed, 2 insertions(+) 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" ] From 9e3ec5426a5273f84be7e2efabb6fd9bd71f0f04 Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sun, 24 Nov 2024 22:56:06 -0500 Subject: [PATCH 06/10] Fix LD_LIBRARY_PATH for CUDA libs --- Dockerfile | 8 +++++--- run.sh | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1fb385b..81b1c08 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,14 +41,16 @@ RUN \ "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 \ - \ + +RUN \ && apt-get purge -y --auto-remove \ build-essential \ python3-dev \ \ - && rm -rf /var/lib/apt/lists/* /*.deb + && rm -rf /var/lib/apt/lists/* /*.deb \ + && mkdir -p /share/piper -# Patch to enable CUDA in 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/ diff --git a/run.sh b/run.sh index d81a500..e9592fc 100644 --- a/run.sh +++ b/run.sh @@ -1,9 +1,10 @@ #!/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 'piper' \ + --piper '/usr/local/bin/piper' \ --cuda \ --uri 'tcp://0.0.0.0:10200' \ --data-dir /data \ + --data-dir /share/piper \ --download-dir /data "$@" From e8ce8740c9aa4a200b04b659e679111125cd6c6d Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sun, 24 Nov 2024 22:59:02 -0500 Subject: [PATCH 07/10] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 81b1c08..8887bbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,7 +40,7 @@ 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 \ + && rm -r piper_phonemize-1.1.0-py3-none-any.whl RUN \ && apt-get purge -y --auto-remove \ From 082315d4c798908bedb0c27096fc1e92446280d4 Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sun, 24 Nov 2024 23:02:33 -0500 Subject: [PATCH 08/10] Update Dockerfile --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8887bbb..0ed3216 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,8 +47,9 @@ RUN \ build-essential \ python3-dev \ \ - && rm -rf /var/lib/apt/lists/* /*.deb \ - && mkdir -p /share/piper + && rm -rf /var/lib/apt/lists/* \ + && rm /*.deb \ + && mkdir -p /share/piper && exit 0 # Patch to enable CUDA arguments for piper COPY patch/process.py /usr/local/lib/python3.10/dist-packages/wyoming_piper/ From 795b9f9efc1269a59b748fa41b250a137f0df39d Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sun, 24 Nov 2024 23:05:40 -0500 Subject: [PATCH 09/10] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0ed3216..2988e69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,13 +43,13 @@ RUN \ && rm -r piper_phonemize-1.1.0-py3-none-any.whl RUN \ - && apt-get purge -y --auto-remove \ + apt-get purge -y --auto-remove \ build-essential \ python3-dev \ \ && rm -rf /var/lib/apt/lists/* \ && rm /*.deb \ - && mkdir -p /share/piper && exit 0 + && mkdir -p /share/piper # Patch to enable CUDA arguments for piper COPY patch/process.py /usr/local/lib/python3.10/dist-packages/wyoming_piper/ From 43fb349173f21068e8a740049a4114fda0ee5fa8 Mon Sep 17 00:00:00 2001 From: Robert Dunmire III Date: Sun, 24 Nov 2024 23:08:35 -0500 Subject: [PATCH 10/10] Update Dockerfile --- Dockerfile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2988e69..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 \ @@ -42,12 +40,9 @@ RUN \ \ && rm -r piper_phonemize-1.1.0-py3-none-any.whl +# Clean up RUN \ - apt-get purge -y --auto-remove \ - build-essential \ - python3-dev \ - \ - && rm -rf /var/lib/apt/lists/* \ + rm -rf /var/lib/apt/lists/* \ && rm /*.deb \ && mkdir -p /share/piper