Using CUDA
How to use wasmVision with CUDA.
Local installation
Prerequisites
To build/run locally you must install OpenCV with CUDA support.
For more information see:
https://github.com/hybridgroup/gocv/blob/release/cuda/README.md#installing-cuda
Building
Once you have installed the needed versions of CUDA and OpenCV, actually building the executable is much easier.
go install -tags cuda ./cmd/wasmvision
Running
wasmvision run -p mosaic --cuda-enable=true
Docker
You can also run a wasmVision Docker image with CUDA support.
Prerequisites
You must install the following software before running the wasmVision Docker image with CUDA support:
Running
Pull the current development version:
docker pull ghcr.io/wasmvision/wasmvision-cuda-12:main
Verify it is installed like this:
docker run ghcr.io/wasmvision/wasmvision-cuda-12:main version
Now you can run a test to capture video using your webcam, blur it using a WebAssembly processor, and then stream the output to port 8080 on your local machine:
docker run --privileged --network=host --gpus all ghcr.io/wasmvision/wasmvision-cuda-12:main run -p /processors/mosaic.wasm --cuda-enable=true
Point your browser to http://localhost:8080
and you can see the output.