How to deal with no GPU during docker build time
Hey, i ran into an issue with new docker image support on spaces … and not sure, if this is standard behaviour, or specific to HF.I am building an app that needsneural_renderer. When i add this requirement to the Dockerfile it fails during build withNo CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'. After some trial-error i figured that i can install neural renderer after app start.So i assume that there is no GPU backing during docker build time and it only becomes available after container start. Sounds like a common problem … or am i missing something obvious?My original question on HF Discord:DiscordDiscord - A New Way to Chat with Friends & CommunitiesDiscord is the easiest way to communicate over voice, video, and text.  Chat, hang out, and stay close with your friends and communities.
2022-12-29T07:26:51Z
Here is some info from NVIDIA:Advanced topics · NVIDIA/nvidia-docker Wiki · GitHubSeems like my assumption is right and there is no GPU avail during docker build. So my question to the HF team is:how can one deal with that?
2022-12-29T07:31:49Z
Here is a howto for a NVIDIA GPU-backed runtime. This allows one to build the container image on your local system (or any other GPU system), submit it to Docker hub and then inherit from there during build on HF.stackoverflow.comdocker build with nvidia runtimedocker, nvidia-dockerasked bydannyon02:44AM - 11 Jan 20 UTC
2023-10-23T02:33:00Z
I had a couple of errors. I thought the first one was due to the absence of GPU during the installation, but it turned out that it was actually second.github.com/turboderp/exllamav2Install without GPUopened01:55AM - 23 Oct 23 UTCkopylWhen i build a Docker image on a machine with no GPU, after executing this `pyth…on setup.py install --user` i get a huge error:

https://pastebin.com/bCBcTszR

How can i install the app without GPU?I fixed them both by:RunningRUN apt update && apt install -y libpython3.10-devbeforeRUN python setup.py install --userReplacingRUN python setup.py install --userwithRUN TORCH_CUDA_ARCH_LIST=Turing python setup.py install --user(addedTORCH_CUDA_ARCH_LIST=Turing)Hope it helped you
2023-10-23T03:53:15Z
Thank you for the clarification,@kopyl. Apologies for the delay,@fjenett. You’re correct about Docker’s buildtime in Spaces, it doesn’t provide access to GPU hardware. Thus, any GPU-related commands shouldn’t be executed during your Dockerfile’s build step. For instance, commands likenvidia-smiortorch.cuda.is_available()can’t be run while building an image.@fjenett, your suggestion to build a wheel or a container on a GPU supported system and then loading it into Spaces later is excellent.