# How to use CUDA in Github CI?

**URL:** <https://discourse.julialang.org/t/how-to-use-cuda-in-github-ci/77855>\
**Category:** GPU\
**Tags:** cuda\
**Created:** [March 14, 2022, 9:51am UTC](https://discourse.julialang.org/t/how-to-use-cuda-in-github-ci/77855 "2022-03-14T09:51:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [March 14, 2022, 9:51am UTC](https://discourse.julialang.org/t/how-to-use-cuda-in-github-ci/77855/1 "2022-03-14T09:51:26Z")

</div>

Hello,

I contributed some code to a package, and I made unit tests to check whether the code works on the GPU. I wrapped the code in a `if CUDA.functional() ... end` block and I see this:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/f/df039e649d3e3e7ce054f756a81c716e9bf6566c.png)  
It seems like CUDA is not functional in the CI. I went to see how the `ci.yml` is setup in CUDA.jl, and there’s none. So my question is : can you run CI jobs on GPUs? If yes, how? If not, is there an alternative ?

---

<div class="post-metadata">

**Author:** ![cjdoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cjdoris/32/213133_2.png) [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Post date:** [March 14, 2022, 10:04am UTC](https://discourse.julialang.org/t/how-to-use-cuda-in-github-ci/77855/2 "2022-03-14T10:04:45Z")

</div>

The GitHub-hosted runners don’t have GPUs so you can’t: [About GitHub-hosted runners - GitHub Docs](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources)

You’ll need to use a self-hosted runner: [About self-hosted runners - GitHub Docs](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners)

---

<div class="post-metadata">

**Author:** ![HenriDeh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrideh/32/8316_2.png) [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Post date:** [March 14, 2022, 10:05am UTC](https://discourse.julialang.org/t/how-to-use-cuda-in-github-ci/77855/3 "2022-03-14T10:05:37Z")

</div>

Okay thanks !
