# GPU not being used in Spaces Deployment

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgpu-not-being-used-in-spaces-deployment%2F135038%3E%5C
**Category:** Spaces\
**Created:** [January 9, 2025, 3:20pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgpu-not-being-used-in-spaces-deployment%2F135038 "2025-01-09T15:20:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tvkarthik](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@tvkarthik](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ftvkarthik)%5C
**Post date:** [January 9, 2025, 3:20pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgpu-not-being-used-in-spaces-deployment%2F135038%2F1 "2025-01-09T15:20:54Z")

</div>

I have a deployment in my Space. But the GPU is not being used. I installed CUDA 11.8 and and I am using torch.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [January 9, 2025, 3:27pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgpu-not-being-used-in-spaces-deployment%2F135038%2F2 "2025-01-09T15:27:20Z")

</div>

Is it zero GPU space?  
If so, you’ll need to follow a slightly different procedure.  
If not, that’s strange. Maybe you forgot to **.to(“cuda”)** the model or pipeline.

> **[zero-gpu-explorers (ZeroGPU Explorers)](https://huggingface.co/zero-gpu-explorers)**
>
> Org profile for ZeroGPU Explorers on Hugging Face, the AI community building the future.

---

<div class="post-metadata">

**Author:** ![tvkarthik](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@tvkarthik](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ftvkarthik)%5C
**Post date:** [January 9, 2025, 3:41pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgpu-not-being-used-in-spaces-deployment%2F135038%2F3 "2025-01-09T15:41:54Z")

</div>

Hi John,  
Thank you for the quick response.

When i send the request to the inference i see that the CPU is being used but GPU is not getting picked up although i have included .to(“cuda”). I am using the NVIDIA 1xL4. Just a snapshot below. When request is sent CPU touches 44% but GPU is not used.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/0/9/093ffa96dcecd5d61be55b86b2b326a3cffa1447.png)

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [January 9, 2025, 4:09pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgpu-not-being-used-in-spaces-deployment%2F135038%2F4 "2025-01-09T16:09:39Z")

</div>

It’s getting weirder and weirder…  
The only thing that’s unusual is that the CUDA version is much older than the 12.4 that is common in HF, but I think it works even if it’s older…  
And if there’s not enough VRAM, it should offload properly if accelerate is installed.

I think trying to load some unrelated model into the GPU might help isolate the problem.
