# Tutorial on GPU programming on julia

**URL:** <https://discourse.julialang.org/t/tutorial-on-gpu-programming-on-julia/21957>\
**Category:** GPU\
**Created:** [March 17, 2019, 9:04am UTC](https://discourse.julialang.org/t/tutorial-on-gpu-programming-on-julia/21957 "2019-03-17T09:04:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ferran\_Mazzanti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ferran_mazzanti/32/7458_2.png) [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Post date:** [March 17, 2019, 9:04am UTC](https://discourse.julialang.org/t/tutorial-on-gpu-programming-on-julia/21957/1 "2019-03-17T09:04:51Z")

</div>

Hi,  
I’m starting to appreciate CUDA programming in Julia, but find hard to learn how to do that properly since I can not find any tutorial or book on that. I’ve read the documentation about CuArrays.jl and CUDAnative.jl , but all that seem to be just a simple introduction showing capabilities, rather than tutorials… I hope I’m wrong, as I would appreciate some good docs to read and to learn from. Does anybody have a good recommendation for that? Thanks a lot,  
Ferran

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [March 17, 2019, 3:16pm UTC](https://discourse.julialang.org/t/tutorial-on-gpu-programming-on-julia/21957/2 "2019-03-17T15:16:31Z")

</div>

Have a look at this one [An Introduction to GPU Programming in Julia - Nextjournal](https://nextjournal.com/sdanisch/julia-gpu-programming)

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [March 18, 2019, 9:43am UTC](https://discourse.julialang.org/t/tutorial-on-gpu-programming-on-julia/21957/3 "2019-03-18T09:43:01Z")

</div>

> [@Ferran\_Mazzanti](#):
>
> I hope I’m wrong, as I would appreciate some good docs to read and to learn from.

There’s not much documentation right now, I’m afraid. On the other hand, you don’t need as much CUDAnative/CuArrays-specific docs as you might thing: CUDAnative works at the CUDA C abstraction level, and there plenty of resources to learn that language, while CuArrays aims to provide the same usability as Base.Array. For GPU-specific additions, there’s some resources on the CuArrays.jl home page, including [this slide deck](https://docs.google.com/presentation/d/1l-BuAtyKgoVYakJSijaSqaTL3friESDyTOnU2OLqGoA/edit).

> [@BeastyBlacksmith](#):
>
> Have a look at this one [https://nextjournal.com/sdanisch/julia-gpu-programming](https://nextjournal.com/sdanisch/julia-gpu-programming)

Note that Simon’s GPUArrays-centric workflow explained in that blog post isn’t maintained, and instead I recommend people to use CuArrays directly as in [this tutorial](https://juliagpu.gitlab.io/CuArrays.jl/tutorials/generated/intro/). GPUArrays.jl is still useful as an abstract container for GPU vendor-agnostic functionality, but not as a concrete type for direct use.

---

<div class="post-metadata">

**Author:** ![Ferran\_Mazzanti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ferran_mazzanti/32/7458_2.png) [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Post date:** [March 18, 2019, 11:17am UTC](https://discourse.julialang.org/t/tutorial-on-gpu-programming-on-julia/21957/4 "2019-03-18T11:17:23Z")

</div>

Thank you both for your input… I’ve read these two links before posting. They are great but only give a hint on how to start. I was looking for something more robust. Of course I can read about C-CUDA, but the idea was to avoid that and to get something self-contained for CUDA programming in Julia…  
Thanks anyway 🙂

---

<div class="post-metadata">

**Author:** ![Aquaman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aquaman/32/6586_2.png) [@Aquaman](https://discourse.julialang.org/u/Aquaman)\
**Post date:** [March 18, 2019, 4:21pm UTC](https://discourse.julialang.org/t/tutorial-on-gpu-programming-on-julia/21957/5 "2019-03-18T16:21:37Z")

</div>

Precompiling CuArrays  
ERROR: LoadError: LoadError: UndefVarError: CUBLAS not defined

Pkg,add(“CUBLAS”)  
ERROR: UndefVarError: add not defined  
Stacktrace:

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [March 19, 2019, 10:01am UTC](https://discourse.julialang.org/t/tutorial-on-gpu-programming-on-julia/21957/6 "2019-03-19T10:01:34Z")

</div>

This isn’t an appropriate topic to report such an issue.
