Search code examples
cudaresourcesgpupycuda

Where can I find a "Cuda/PyCuda for Dummies" tutorial


I want to learn how to do GPU programming over the summer, and I'm open to all languages/libraries but most interested in PyCuda.

I am not a strong programmer; I can bang out most programs I want in Java, and understand the rudiments of C, but when I try anything complex in the latter a segfault or malloc error is almost certain.

Thus, I really need a "for dummies" tutorial/guide/documentation. Ideally, a guide would work from the very basics of GPU programming through to fairly complicated scientific/numerical programming while explaining each detail with clarity and depth that doesn't take for granted any prior knowledge.


Solution

  • Starting with PyCUDA doesn't eliminate the need to understand how CUDA works and how to program the GPU. Realistically you probably need to do all of the following, and in this order:

    1. Learn enough C to a least have a grasp of the syntax and a thorough understanding of pointers and memory concepts. The latter is really important because in CUDA you are always working with a non-uniform address space. There are dragons a plenty if you can't understand why pointers aren't portable and indirection of pointers in the wrong memory space can't work.
    2. Work through something like CUDA by example to get the hang of the basic ideas behind CUDA programming and how the APIs work.
    3. Do whatever "Python for dummies" and "numpy for dummies" tutorials you need to get up to speed with the Python end of things.

    Then PyCUDA will become completely self evident. It took me about an hour to digest PyCUDA coming from a background of already knowing how to write working CUDA code and working a lot with Python and numpy.