BrokenSource / DepthFlow

🌊 Image to → 2.5D Parallax Effect Video. A Free and Open Source ImmersityAI alternative
https://brokensrc.dev
GNU Affero General Public License v3.0
323 stars 21 forks source link

RunPod dot io not utilizing the GPU for rendering, slow speeds on CPU only #25

Closed ti2 closed 3 months ago

ti2 commented 3 months ago

Hi, i tried to install Depthflow on a runpod linux gpu server, from the source manual installation.

I can generate a video, but the generation is very very slow and when I observe the activity of the server, I see that the gpu is stopped, I selected cuda but it does not seem to work. Do you think the problem comes from an incompatibility of cuda versions or I missed something in the installation. Thanks in advance for your help. peter

Tremeschin commented 3 months ago

There's an in depth doc page on the website I've written on what needs to happen for GPU acceleration to work on Docker:

I'm working with some other person and we've successfully ran it on https://modal.com/, but only after asking their support team to enable OpenGL via NVIDIA Container Toolkit "graphics,gpu,display" capabilities on our workspace

These serverless providers often only enables CUDA but not graphics acceleration, beware that some GPUs like NVIDIA A100/H100 (often called "Tensor Cores") don't have graphic APIs capabilities, so chose something like a Tesla T4, A10G, L4 or consumer grade RTX 20/30/40 hardware

Tremeschin commented 3 months ago

Also, using a base image like the one I use (nvidia/opengl:1.2-glvnd-runtime-ubuntu22.04) is essential for having glvnd and finding the opengl device

The lines below are also very important on the docker file: (if capabilities are also enabled from the container toolkit)

ENV NVIDIA_DRIVER_CAPABILITIES="all"
ENV NVIDIA_VISIBLE_DEVICES="all"
ENV WINDOW_BACKEND="headless"

Namely the "headless" for shaderflow to use EGL and not require a X11 server, apart from those, the other configs in the docker-compose.yml or the base docker file I linked previously are mostly for stuff to work on Windows/WSL2

ti2 commented 3 months ago

After much hassle (I'm new with docker) and your base image, I finally generates on the GPU, and the generation is lightning fast in comparison, thank you for your help!

Tremeschin commented 3 months ago

awesome!

just for future reference (as I don't know runpod platform myself), did you need to tweak anything specific on their configs, your script, or running those docker files present on the main repo simply worked?

asking this as I might add a section about common cloud providers on that docker page (maybe even their own page)