Skip to content

Add CUDA support to the Dockerfile#76

Open
lmoe wants to merge 1 commit intorhasspy:mainfrom
lmoe:add_cuda_to_dockerfile
Open

Add CUDA support to the Dockerfile#76
lmoe wants to merge 1 commit intorhasspy:mainfrom
lmoe:add_cuda_to_dockerfile

Conversation

@lmoe
Copy link

@lmoe lmoe commented Jan 18, 2026

Hey,

this is one out of two PR's. I hope you find them beneficial.

I added optional GPU support to the Dockerfile. The current image only works with CPU. With --build-arg GPU=1 it uses a CUDA base image and pulls the CUDA torch wheels.

This enables --device cuda for the node.

# CPU (default, same as before)
docker build -t wyoming-faster-whisper .

# GPU
docker build --build-arg GPU=1 -t wyoming-faster-whisper:gpu .

The way this works is a bit ugly (Docker doesn't have proper conditionals for FROM), but it keeps the CPU images slim.

The downside is that the build will download the CUDA base image even when building for CPU, but it won't be included in the final result. Since these are built on CI anyway, I wouldn't mind this much personally.

Default is GPU=0 so nothing breaks for existing builds.

(I chose cu126 because it still supports older GPU's such as the 1080. Newer wheels would exclude them, but they still perform quite good with Whisper.)

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments