Skip to content

Commit a6ce641

Browse files
committed
upload
0 parents  commit a6ce641

4 files changed

Lines changed: 105 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
data/
2+
compose.yaml

Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM debian:12
2+
3+
ARG WYOMING_FASTER_WHIPSER_VERSION=2.2.0
4+
ARG NVIDIA_DRIVER_VERSION=550.127.05
5+
6+
# install requirements
7+
RUN apt-get update \
8+
&& apt-get install -y --no-install-recommends python3-pip wget kmod \
9+
&& apt-get clean \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
# install nvidia linux drivers
13+
RUN cd /tmp \
14+
&& wget "https://de.download.nvidia.com/XFree86/Linux-x86_64/${NVIDIA_DRIVER_VERSION}/NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_VERSION}.run" \
15+
&& chmod +x NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_VERSION}.run \
16+
&& bash -c "./NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_VERSION}.run -s --no-kernel-module" \
17+
$$ rm NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_VERSION}.run
18+
19+
# install wyoming-faster-whisper and nvidia cuda libs
20+
RUN python3 -m pip install --no-cache-dir --break-system-packages "wyoming-faster-whisper @ https://github.com/rhasspy/wyoming-faster-whisper/archive/refs/tags/v${WYOMING_FASTER_WHIPSER_VERSION}.tar.gz" \
21+
&& python3 -m pip install --no-cache-dir --break-system-packages nvidia-cublas-cu12 nvidia-cudnn-cu12==9.*
22+
23+
EXPOSE 10300/tcp
24+
VOLUME [ "/data" ]
25+
26+
COPY run.sh /
27+
28+
ENTRYPOINT [ "/run.sh" ]

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# wyoming-faster-whisper-cuda
2+
3+
This takes the [wyoming-faster-whisper](https://github.com/rhasspy/wyoming-faster-whisper) and wraps it into an nvidia cuda supported container.
4+
5+
**Note** This is only supported on x86_64 systems, yet.
6+
7+
## Usage
8+
9+
### Prerequisits
10+
11+
1. nvidia cuda compatible gpu
12+
2. [nvidia linux drivers](https://www.nvidia.com/en-us/drivers/unix) installed on the host
13+
3. up and running [docker](https://docs.docker.com/engine/install) installation on the host
14+
15+
### Installation
16+
17+
1. download this repo
18+
19+
```shell
20+
$ git clone https://github.com/mib1185/wyoming-faster-whisper-cuda.git
21+
```
22+
23+
2. `compose.yaml` file
24+
25+
create a `compose.yaml` file, which:
26+
27+
- builds from the local `Dockerfile`
28+
- adds the needed parameters for `model` and `language` as command line parameter
29+
- (_optional_) enables `debug` logging via command line parameter
30+
- provides a `data` volume or directory
31+
- exposes the port `10300/tcp`
32+
- maps your nvidia gpu related devices into the container (_obtain with `ls -la /dev/nvidia*`_)
33+
- (_optional_) set `restart: always`
34+
35+
**example `compose.yaml` file**
36+
37+
```yaml
38+
name: wyoming
39+
services:
40+
faster-whisper-cuda:
41+
container_name: faster-whisper-cuda
42+
build: .
43+
command: "--model large --language de --debug"
44+
volumes:
45+
- ./data:/data
46+
ports:
47+
- 10300:10300/tcp
48+
devices:
49+
- /dev/nvidia-uvm:/dev/nvidia-uvm
50+
- /dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools
51+
- /dev/nvidia0:/dev/nvidia0
52+
- /dev/nvidiactl:/dev/nvidiactl
53+
restart: always
54+
```
55+
56+
3. start service
57+
58+
on first start, the docker image is build, which needs some time
59+
60+
```shell
61+
$ docker compose up -d
62+
```
63+
64+
4. check if service is running
65+
66+
```shell
67+
$ docker ps
68+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
69+
474e37a84326 wyoming-faster-whisper-cuda "/run.sh --model lar…" 3 minutes ago Up 3 minutes 0.0.0.0:10300->10300/tcp, :::10300->10300/tcp faster-whisper-cuda
70+
```

run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
export LD_LIBRARY_PATH=`python3 -c 'import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__))'`
4+
5+
python3 -m wyoming_faster_whisper --uri tcp://0.0.0.0:10300 --data-dir /data --download-dir /data --device cuda "$@"

0 commit comments

Comments
 (0)