scalableminds / webknossos

Visualize, share and annotate your large 3D images online
https://webknossos.org
GNU Affero General Public License v3.0
126 stars 23 forks source link

Use GPU in Render Animation Worker Job #7445

Closed philippotto closed 1 month ago

philippotto commented 10 months ago

Detailed Description

As a follow-up to #7348, speed might be improvable by using the GPU in the worker job.

Context

hotzenklotz commented 10 months ago

Time measurements for a single frame based on job 655b4d0e01000026094d9893__render_animation__1700482319547

philippotto commented 10 months ago
  • Eevee @ native Blender 3.6.5 GPU Euphorix: 00:01.12

Awesome! So, very good news, right?

hotzenklotz commented 10 months ago

Awesome! So, very good news, right?

Well... we already knew that GPU support is quick. But the WK worker is no running a on a GPU server. Nor was this in Docker....

philippotto commented 10 months ago

Ok, I see..

hotzenklotz commented 10 months ago

With the nvidia-container-toolkit installed you can just run the regular wk-worker Docker container to benefit from GPU support, e.g.

docker run \
    -v $(pwd):$(pwd) \
    -w $(pwd) \
    -u $(id -u ${USER}):$(id -g ${USER}) \
    --rm \
    --gpus all  \
    --runtime=nvidia \
    --privileged \
    -e NVIDIA_VISIBLE_DEVICES=all \
    -e NVIDIA_DRIVER_CAPABILITIES=display,compute \
    -v /run/nvidia-persistenced/socket:/run/nvidia-persistenced/socket \
    -v /var/run/nvidia-fabricmanager/socket:/var/run/nvidia-fabricmanager/socket \
    -v /tmp/nvidia-mps:/tmp/nvidia-mps \
    scalableminds/webknossos-worker:23.11.1.post15.dev0--e32a27ebe \
    blender --background --python create_blender_animation.py

Ca. 0.13s per frame on Euphorix with Geforce GTX 1080

hotzenklotz commented 7 months ago

Blender had a peak usage of slightly more then 900MB of VRAM for my test dataset (2 large meshes).

image