# Need Example Docker File with GPU Support

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fneed-example-docker-file-with-gpu-support%2F57747%3E%5C
**Category:** Spaces\
**Created:** [October 7, 2023, 9:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fneed-example-docker-file-with-gpu-support%2F57747 "2023-10-07T21:11:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MVPilgrim](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@MVPilgrim](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FMVPilgrim)%5C
**Post date:** [October 7, 2023, 9:11pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fneed-example-docker-file-with-gpu-support%2F57747%2F1 "2023-10-07T21:11:41Z")

</div>

Hi,  
Are there good examples of docker files which run apps using a GPU? I’ve copied the docker file statements from a log for a Gradio space with a GPU enabled to create my docker file. But the Python statement “torch.cuda.is\_available()” yields “false”.  
Thanks.

---

<div class="post-metadata">

**Author:** ![julien-c](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/julien-c/32/41937_2.png) [@julien-c](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fjulien-c)%5C
**Post date:** [October 9, 2023, 8:45am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fneed-example-docker-file-with-gpu-support%2F57747%2F2 "2023-10-09T08:45:12Z")

</div>

i think @chris-rannou can help!

---

<div class="post-metadata">

**Author:** ![XciD](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/xcid/32/32570_2.png) [@XciD](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FXciD)%5C
**Post date:** [October 9, 2023, 3:02pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fneed-example-docker-file-with-gpu-support%2F57747%2F3 "2023-10-09T15:02:22Z")

</div>

We dont expose GPU at build time, tha’ts this instruction will never work at build time, but should work at runtime

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fradames)%5C
**Post date:** [October 9, 2023, 6:55pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fneed-example-docker-file-with-gpu-support%2F57747%2F4 "2023-10-09T18:55:05Z")

</div>

A couple of templates examples for you

> **[Dockerfile · SpacesExamples/llama-cpp-python-cuda-gradio at main](https://huggingface.co/spaces/SpacesExamples/llama-cpp-python-cuda-gradio/blob/main/Dockerfile)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[Dockerfile · SpacesExamples/Gradio-Docker-Template-nvidia-cuda at main](https://huggingface.co/spaces/SpacesExamples/Gradio-Docker-Template-nvidia-cuda/blob/main/Dockerfile)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

<div class="post-metadata">

**Author:** ![MVPilgrim](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@MVPilgrim](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FMVPilgrim)%5C
**Post date:** [October 12, 2023, 11:27pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fneed-example-docker-file-with-gpu-support%2F57747%2F5 "2023-10-12T23:27:28Z")

</div>

I appreciate it. I’ll check them out.
