-
Notifications
You must be signed in to change notification settings - Fork 39
[WIP] Add initial GPU support #4
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
Open
edurenye
wants to merge
25
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
25 commits
Select commit
Hold shift + click to select a range
fa1839d
Add initial GPU support
edurenye cbd0720
Add support for both GPU and NONGPU Dockerfiles
edurenye 4c459ab
Add docker compose and instructions
edurenye f263f9f
Make whisper use cuda
edurenye 45371b5
Update Dockerfiles and add Vosk
edurenye f7be668
Create __main__.py
baudneo 66f46e5
Create process.py
baudneo 3c1c491
Update docker-compose.gpu.yml
baudneo 177bac4
Remove volumes, they can be added by extended docker compose files
edurenye 4eb1b22
Fixes from rebases
edurenye 0b10b34
Fixes from rebases
edurenye d7493da
Fixes from rebases
edurenye 559a75b
Use YAML anchores, all commented services, and add whisper-cpp
edurenye 3af9c6f
Simplify everything using BASE image args
edurenye 2f199f1
Simplify everything using BASE image args
edurenye 0dca0f2
Add default values and use env for runtime
edurenye 218e46e
Go back to two files for piper and updated piper gpu
edurenye ccd4ef4
Add microwakeword option
edurenye dd05208
chore: Add rhasspy-speech option
edurenye 4219109
chore: Update images and whisper version
edurenye 248ba46
Go back to openwakeword 1.8.2
edurenye e85cb95
Fix errors and warnings
edurenye efcfb5d
Remove runtime nvidia
edurenye 0c886e2
Fixes from the last rebase, and add speech-to-phrase
edurenye a8f07f2
Update CUDA image to Ubuntu 24.04
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 hidden or 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 hidden or 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,79 @@ | ||
| ### 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 ] | ||
|
|
||
| # speech-to-phrase: | ||
| # build: | ||
| # context: ./speech-to-phrase/ | ||
| # ports: | ||
| # - "10300:10300" | ||
| # <<: [ *common ] | ||
|
|
||
| # wyoming-vosk: | ||
| # build: | ||
| # context: ./vosk/ | ||
| # ports: | ||
| # - "10400:10400" | ||
| # <<: [ *common ] | ||
|
|
||
| # wyoming-microwakeword: | ||
| # build: | ||
| # context: ./microwakeword/ | ||
| # ports: | ||
| # - "10400:10400" | ||
| # <<: [ *common ] | ||
|
|
||
| # wyoming-rhasspy-speech: | ||
| # build: | ||
| # context: ./rhasspy-speech/ | ||
| # ports: | ||
| # - "10300:10300" | ||
| # <<: [ *common ] |
This file contains hidden or 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,84 @@ | ||
| ### YAML Anchors ### | ||
| x-gpu: &gpu | ||
| build: | ||
| args: | ||
| - BASE=nvidia/cuda:12.8.1-cudnn-runtime-ubuntu24.04 | ||
| 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: | ||
| - EXTRA_DEPENDENCIES=onnxruntime-gpu | ||
| - RUN_SCRIPT=run-gpu.sh | ||
| volumes: | ||
| - ./piper/__main__.py:/opt/venv/lib/python3.11/site-packages/wyoming_piper/__main__.py | ||
| - ./piper/process.py:/opt/venv/lib/python3.11/site-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 ] | ||
|
|
||
| # speech-to-phrase: | ||
| # extends: | ||
| # file: docker-compose.base.yml | ||
| # service: speech-to-phrase | ||
| # <<: [ *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 ] | ||
|
|
||
| # wyoming-rhasspy-speech: | ||
| # extends: | ||
| # file: docker-compose.base.yml | ||
| # service: wyoming-rhasspy-speech | ||
| # <<: [ *gpu ] |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 RUN_SCRIPT='run.sh' | ||
|
|
||
| ARG TARGETARCH | ||
| ARG TARGETVARIANT | ||
|
|
||
| # Install Piper | ||
| WORKDIR /usr/src | ||
| ARG WYOMING_PIPER_VERSION='1.6.3' | ||
| ARG WYOMING_VERSION='1.7.2' | ||
| ARG BINARY_PIPER_VERSION='1.2.0' | ||
| ENV PIP_BREAK_SYSTEM_PACKAGES=1 | ||
|
|
||
| RUN \ | ||
| apt-get update \ | ||
| && apt-get install -y --no-install-recommends \ | ||
| curl \ | ||
| python3 \ | ||
| python3-pip \ | ||
| python3-dev \ | ||
| build-essential \ | ||
| \ | ||
| && pip3 install --no-cache-dir -U \ | ||
| setuptools \ | ||
| wheel \ | ||
| && pip3 install --no-cache-dir \ | ||
| "wyoming-piper @ https://github.com/rhasspy/wyoming-piper/archive/refs/tags/v${WYOMING_PIPER_VERSION}.tar.gz" \ | ||
| \ | ||
| && pip3 install --no-cache-dir \ | ||
| "wyoming[http] @ https://github.com/OHF-voice/wyoming/archive/refs/tags/${WYOMING_VERSION}.tar.gz" \ | ||
| \ | ||
| && curl -L -s \ | ||
| "https://github.com/rhasspy/piper/releases/download/v${BINARY_PIPER_VERSION}/piper_${TARGETARCH}${TARGETVARIANT}.tar.gz" \ | ||
| | tar -zxvf - -C /usr/share \ | ||
| \ | ||
| && apt-get remove -y --purge \ | ||
| python3-dev \ | ||
| build-essential \ | ||
| && apt-get clean -y \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR / | ||
| COPY $RUN_SCRIPT ./ | ||
| ENV RUN_SCRIPT_ENV="/${RUN_SCRIPT}" | ||
|
|
||
| EXPOSE 10200 | ||
| EXPOSE 5000 | ||
|
|
||
| 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!