-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add initial GPU support #4
Open
edurenye
wants to merge
18
commits into
rhasspy:master
Choose a base branch
from
edurenye:gpu
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ca9b235
Add initial GPU support
edurenye 791d982
Add support for both GPU and NONGPU Dockerfiles
edurenye 6e3df97
Add docker compose and instructions
edurenye 8ec83a4
Make whisper use cuda
edurenye 9266560
Update Dockerfiles and add Vosk
edurenye 35dec67
Create __main__.py
baudneo 4e4cf67
Create process.py
baudneo fa8f78f
Update docker-compose.gpu.yml
baudneo daf6cc5
Remove volumes, they can be added by extended docker compose files
edurenye 8373e86
Fixes from rebases
edurenye 4947222
Fixes from rebases
edurenye ba983fa
Fixes from rebases
edurenye 485b071
Use YAML anchores, all commented services, and add whisper-cpp
edurenye fed7880
Simplify everything using BASE image args
edurenye 8467f3f
Simplify everything using BASE image args
edurenye cd4f206
Add default values and use env for runtime
edurenye e6854b1
Go back to two files for piper and updated piper gpu
edurenye 53bb566
Add microwakeword option
edurenye File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
version: '3' | ||
### YAML Anchors ### | ||
x-common: &common | ||
restart: unless-stopped | ||
|
||
#### | ||
services: | ||
wyoming-piper: | ||
build: | ||
context: ./piper/ | ||
ports: | ||
- "10200:10200" | ||
command: [ "--voice", "en_US-lessac-medium" ] | ||
<<: [ *common ] | ||
|
||
wyoming-whisper: | ||
build: | ||
context: ./whisper/ | ||
ports: | ||
- "10300:10300" | ||
command: [ "--model", "tiny-int8", "--language", "en" ] | ||
<<: [ *common ] | ||
|
||
# wyoming-whispercpp: | ||
# build: | ||
# context: ./whisper-cpp/ | ||
# ports: | ||
# - "10300:10300" | ||
# command: [ "--model", "tiny-int8", "--language", "en" ] | ||
# <<: [ *common ] | ||
|
||
wyoming-openwakeword: | ||
build: | ||
context: ./openwakeword/ | ||
ports: | ||
- "10400:10400" | ||
command: [ "--preload-model", "ok_nabu" ] | ||
<<: [ *common ] | ||
|
||
# wyoming-porcupine: | ||
# build: | ||
# context: ./porcupine1/ | ||
# ports: | ||
# - "10400:10400" | ||
# <<: [ *common ] | ||
|
||
# wyoming-snowboy: | ||
# build: | ||
# context: ./snowboy/ | ||
# ports: | ||
# - "10400:10400" | ||
# <<: [ *common ] | ||
|
||
# wyoming-vosk: | ||
# build: | ||
# context: ./vosk/ | ||
# ports: | ||
# - "10400:10400" | ||
# <<: [ *common ] | ||
|
||
# wyoming-microwakeword: | ||
# build: | ||
# context: ./microwakeword/ | ||
# ports: | ||
# - "10400:10400" | ||
# <<: [ *common ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
version: '3' | ||
### YAML Anchors ### | ||
x-gpu: &gpu | ||
build: | ||
args: | ||
- BASE=nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04 | ||
runtime: nvidia | ||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: nvidia | ||
count: all | ||
capabilities: ["compute", "utility", "graphics"] | ||
|
||
#### | ||
services: | ||
wyoming-piper: | ||
extends: | ||
file: docker-compose.base.yml | ||
service: wyoming-piper | ||
<<: [ *gpu ] | ||
build: | ||
dockerfile: GPU.Dockerfile | ||
args: | ||
- BASE=nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu20.04 | ||
- EXTRA_DEPENDENCIES=onnxruntime-gpu | ||
- RUN_SCRIPT=run-gpu.sh | ||
volumes: | ||
- ./piper/__main__.py:/usr/local/lib/python3.8/dist-packages/wyoming_piper/__main__.py | ||
- ./piper/process.py:/usr/local/lib/python3.8/dist-packages/wyoming_piper/process.py | ||
|
||
wyoming-whisper: | ||
extends: | ||
file: docker-compose.base.yml | ||
service: wyoming-whisper | ||
<<: [ *gpu ] | ||
command: [ "--model", "tiny-int8", "--language", "en", "--device", "cuda" ] | ||
|
||
# wyoming-whispercpp: | ||
# extends: | ||
# file: docker-compose.base.yml | ||
# service: wyoming-whispercpp | ||
# <<: [ *gpu ] | ||
# command: [ "--model", "tiny-int8", "--language", "en", "--device", "cuda" ] | ||
|
||
wyoming-openwakeword: | ||
extends: | ||
file: docker-compose.base.yml | ||
service: wyoming-openwakeword | ||
<<: [ *gpu ] | ||
|
||
# wyoming-porcupine: | ||
# extends: | ||
# file: docker-compose.base.yml | ||
# service: wyoming-porcupine | ||
# <<: [ *gpu ] | ||
|
||
# wyoming-snowboy: | ||
# extends: | ||
# file: docker-compose.base.yml | ||
# service: wyoming-snowboy | ||
# <<: [ *gpu ] | ||
|
||
# wyoming-vosk: | ||
# extends: | ||
# file: docker-compose.base.yml | ||
# service: wyoming-vosk | ||
# <<: [ *gpu ] | ||
|
||
# wyoming-microwakeword: | ||
# extends: | ||
# file: docker-compose.base.yml | ||
# service: wyoming-microwakeword | ||
# <<: [ *gpu ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
FROM debian:bookworm-slim | ||
ARG BASE=debian:bookworm-slim | ||
FROM $BASE | ||
|
||
ARG TARGETARCH | ||
ARG TARGETVARIANT | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
FROM debian:bookworm-slim | ||
ARG BASE=debian:bookworm-slim | ||
FROM $BASE | ||
|
||
ARG TARGETARCH | ||
ARG TARGETVARIANT | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
ARG BASE=debian:bookworm-slim | ||
FROM $BASE | ||
|
||
ARG EXTRA_DEPENDENCIES | ||
ARG RUN_SCRIPT='run-nongpu.sh' | ||
ARG TARGETARCH | ||
ARG TARGETVARIANT | ||
|
||
# Install Piper | ||
WORKDIR /usr/src | ||
ARG WYOMING_PIPER_VERSION='1.5.0' | ||
ARG BINARY_PIPER_VERSION='1.2.0' | ||
|
||
RUN \ | ||
apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
wget \ | ||
curl \ | ||
python3 \ | ||
python3-pip \ | ||
\ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN \ | ||
pip3 install --no-cache-dir -U \ | ||
setuptools \ | ||
wheel \ | ||
$EXTRA_DEPENDENCIES \ | ||
\ | ||
&& wget https://github.com/rhasspy/piper-phonemize/releases/download/v1.1.0/piper_phonemize-1.1.0-cp39-cp39-manylinux_2_28_x86_64.whl \ | ||
\ | ||
&& mv piper_phonemize-1.1.0-cp39-cp39-manylinux_2_28_x86_64.whl piper_phonemize-1.1.0-py3-none-any.whl \ | ||
\ | ||
&& pip3 install --no-cache-dir --force-reinstall --no-deps \ | ||
"piper-tts==${BINARY_PIPER_VERSION}" \ | ||
\ | ||
&& pip3 install --no-cache-dir --force-reinstall --no-deps \ | ||
piper_phonemize-1.1.0-py3-none-any.whl \ | ||
\ | ||
&& pip3 install --no-cache-dir \ | ||
"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 | ||
|
||
WORKDIR / | ||
COPY $RUN_SCRIPT ./ | ||
ENV RUN_SCRIPT_ENV="/${RUN_SCRIPT}" | ||
|
||
EXPOSE 10200 | ||
|
||
ENTRYPOINT ["bash", "-c", "exec $RUN_SCRIPT_ENV \"${@}\"", "--"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we reference documentation on how to setup docker for gpu? (I can of course add it in a seperate pr)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good idea!