from Hacker News

Ask HN: How to learn CUDA to professional level

by upmind on 6/8/25, 10:52 AM with 82 comments

Hi all, I was wondering what books/courses/projects one might do to learn CUDA programming.

(To be frank, the main reason is a lot of companies I'd wish to work for require CUDA experience -- this shouldn't change your answers hopefully, just wanted to provide some context )

  • by indianmouse on 6/8/25, 3:13 PM

    As a very early CUDA programmer who participated in the cudacontest from NVidia during 2008 and I believe one of the only entries (I'm not claiming though) to be submitted from India and got a consolation and participation prize of a BlackEdition Card, I can vouch the method which I followed.

    - Look up the CUDA Programming Guide from NVidia

    - CUDA Programming books from NVidia from developer.nvidia.com/cuda-books-archive link

    - Start creating small programs based on the existing implementations (A strong C implementation knowledge is required. So, brush up if needed.)

    - Install the required Toolchains, compilers, and I am assuming you have the necessary hardware to play around

    - Github links with CUDA projects. Read the code, And now you could use LLM to explain the code in the way you would need

    - Start creating smaller, yet parallel programs etc., etc.,

    And in about a month or two, you should have enough to start writing CUDA programs.

    I'm not aware of the skill / experience levels you have, but whatever it might be, there are plenty of sources and resources available now than it was in 2007/08.

    Create a 6-8 weeks of study plan and you should be flying soon!

    Hope it helps.

    Feel free to comment and I can share whatever I could to guide.

  • by throwaway81523 on 6/8/25, 11:20 AM

    I looked at the CUDA code for Leela Chess Zero and found it pretty understandable, though that was back when Leela used a DCNN instead of transformers. DCNN's are fairly simple and are explained in fast.ai videos that I watched a few years ago, so navigating the Leela code wasn't too difficult. Transformers are more complicated and I want to bone up on them, but I haven't managed to spend any time understanding them.

    CUDA itself is just a minor departure from C++, so the language itself is no big deal if you've used C++ before. But, if you're trying to get hired programming CUDA, what that really means is they want you implementing AI stuff (unless it's game dev). AI programming is a much wider and deeper subject than CUDA itself, so be ready to spend a bunch of time studying and hacking to come up to speed in that. But if you do, you will be in high demand. As mentioned, the fast.ai videos are a great introduction.

    In the case of games, that means 3D graphics which these days is another rabbit hole. I knew a bit about this back in the day, but it is fantastically more sophisticated now and I don't have any idea where to even start.

  • by FilosofumRex on 6/9/25, 2:24 AM

    In you're in it for the money, then forget about HPC and the mathy stuff, unless you've a PhD in the application domain, no one will bother with you, even if you write CUDA at 120 wpm.

    The real money is in mastering PTX, nvcc, cuobjdump, Nsight Systems, and Nsight Compute. CUTLASS is good open source code base to explore - start here https://christianjmills.com/series/notes/cuda-mode-notes.htm...

    most importantly, stay off HN, get on Discord gpu mode, where real coders are: https://discord.com/invite/gpumode

  • by imjonse on 6/8/25, 11:41 AM

    These should keep you busy for months:

    https://www.gpumode.com/ resources and discord community Book: Programming massively parallel processors nvidia cuda docs are very comprehensive too https://github.com/srush/GPU-Puzzles

  • by lokimedes on 6/8/25, 11:18 AM

    There’s a couple of “concerns” you may separate to make this a bit more tractable:

    1. Learning CUDA - the framework, libraries and high-layer wrappers. This is something that changes with times and trends.

    2. Learning high-performance computing approaches. While a GPU and the Nvlink interfaces are Nvidia specific, working in a massively-parallel distributed computing environment is a general branch of knowledge that is translatable across HPC architectures.

    3. Application specifics. If your thing is Transformers, you may just as well start from Torch, Tensorflow, etc. and rely on the current high-level abstractions, to inspire your learning down to the fundamentals.

    I’m no longer active in any of the above, so I can’t be more specific, but if you want to master CUDA, I would say learning how massive-parallel programming works, is the foundation that may translate into transferable skills.

  • by elashri on 6/8/25, 11:34 AM

    I will give you personal experience learning CUDA that might be helpful.

    Disclaime: I don't claim that this is actually a systematic way to learn it and it is more for academic work.

    I got assigned to a project that needs learning CUDA as part of my PhD. There was no one in my research group who have any experience or know CUDA. I started with standard NVIDIA courses (Getting Started with Accelerated Computing with CUDA C/C++ and there is python version too).

    This gave me good introduction to the concepts and basic ideas but I think after that I did most of learning by trial and error. I tried a couple of online tutorials for specific things and some books but it was always a deprecated function there or here or a change of API that make things obsolete. Or basically things changed for your GPU and now you have to be careful because yoy might be using GPU version not compatible with what I develop for in production and you need things to work for both.

    I think learning CUDA for me is an endeavor of pain and going through "compute-sanitizer" and Nsight because you will find that most of your time will go into debugging why things is running slower than you think.

    Take things slowly. Take a simple project that you know how to do without CUDA then port it to CUDA ane benchmark against CPU and try to optimize different aspect of it.

    The one advice that can be helpful is not to think about optimization at the beginning. Start with correct, then optimize. A working slow kernel beats a fast kernel that corrupts memory.

  • by sputknick on 6/8/25, 2:21 PM

    I used this to teach high school students. Probably not sufficient to get what you want, but it should get you off the ground and you can run from there. https://youtu.be/86FAWCzIe_4?si=buqdqREWASNPbMQy
  • by Onavo on 6/8/25, 11:33 AM

    Assuming you are asking this because of the deep learning/ChatGPT hype, the first question you should ask yourself is, do you really need to? The skills needed for CUDA are completely unrelated to building machine learning models. It's like learning to make a TLS library so you can get a full stack web development job. The skills are completely orthogonal. CUDA belongs to the domain of game developers, graphics people, high performance computing and computer engineers (hardware). From the point of view of machine learning development and research, it's nothing more than an implementation detail.

    Make sure you are very clear on what you want. Most HR departments cast a wide net (it's like how every junior role requires "3-5 years of experience" when in reality they don't really care). Similarly when hiring, most companies pray for the unicorn developer who can understand the entire stack from the GPU to the end user product domain when the day to day is mostly in Python.

  • by rramadass on 6/8/25, 12:08 PM

    CUDA GPGPU programming was invented to solve certain classes of parallel problems. So studying these problems will give you greater insight into CUDA based parallel programming. I suggest reading the following old book along with your CUDA resources.

    Scientific Parallel Computing by L. Ridgway Scott et. al. - https://press.princeton.edu/books/hardcover/9780691119359/sc...

  • by ForgotIdAgain on 6/8/25, 11:34 AM

    I have not tried it yet, but seems nice : https://leetgpu.com/
  • by canyp on 6/8/25, 5:08 PM

    My 2 cents: "Learning CUDA" is not the interest bit. Rather, you want to learn two things: 1) GPU hardware architecture, 2) parallelizing algorithms. For CUDA specifically, there is the book CUDA Programming Guide from Nvidia, which will teach you the basics of the language. But what these jobs typically require is that you know how to parallelize an algorithm and squeeze the most of the hardware.
  • by mekpro on 6/8/25, 3:32 PM

    To professionals in the field, I have a question: what jobs, positions, and companies are in need of CUDA engineers? My current understanding is that while many companies use CUDA's by-products (like PyTorch), direct CUDA development seems less prevalent. I'm therefore seeking to identify more companies and roles that heavily rely on CUDA.
  • by SoftTalker on 6/8/25, 3:34 PM

    It's 2025. Get with the times, ask Claude to do it, and then ask it to explain it to you as if you're an engineer who needs to convince a hiring manager that you understand it.
  • by SonOfLilit on 6/8/25, 11:33 PM

    Prefix scan is a great intro to GPU programming:

    https://developer.download.nvidia.com/compute/cuda/2_2/sdk/w...

    After this you should be able to tell whether you enjoy this kind of work.

    If you do, try to do a reasonably optimized GEMM, and then try to follow the FlashAttention paper and implement a basic version of what they're doing.

  • by alecco on 6/8/25, 6:51 PM

    Ignore everybody else. Start with CUDA Thrust. Study carefully their examples. See how other projects use Thrust. After a year or two, go deeper to cub.

    Do not implement algorithms by hand. Recent architectures are extremely hard to reach decent occupancy and such. Thrust and cub solve 80% of the cases with reasonable trade-offs and they do most of the work for you.

    https://developer.nvidia.com/thrust

  • by CalmDream on 6/14/25, 5:41 PM

    I think this might be good introduction to GPU programming: https://builds.modular.com/puzzles/introduction.html. It explains gpu concepts in an hardware agnostic way and verify understanding with implementation puzzle. It is based on https://github.com/srush/GPU-Puzzles but is CUDA specific.
  • by math_dandy on 6/8/25, 3:49 PM

    Are there any GPU emulators you can use to run simple CUDA programs on a commodity laptops, just to get comfortable with the mechanics, the toolchain, etc.?
  • by tkuraku on 6/8/25, 1:57 PM

    I think you just pick a problem you want to solve with gpu programming and go for it. Learning what you need along the way. Nvidia blog posts are great for learning things along the way such as https://devblogs.nvidia.com/cuda-pro-tip-write-flexible-kern...
  • by sremani on 6/8/25, 4:07 PM

    The book - PMPP - Programming Massively Parallel Processors

    The YouTube Channel - CUDA_MODE - it is based on PMPP I could not find the channel, but here is the playlist https://www.youtube.com/watch?v=LuhJEEJQgUM&list=PLVEjdmwEDk...

    Once done, you would be on solid foundation.

  • by fifilura on 6/8/25, 4:55 PM

    I am not a CUDA programmer but when looking at this, I think I can see the parallels to Spark and SQL

    https://gfxcourses.stanford.edu/cs149/fall24/lecture/datapar...

    So - start getting used to programming without using for loops, would be my tip.

  • by gdubs on 6/8/25, 5:07 PM

    I like to learn through projects, and as a graphics guy I love the GPU Gems series. Things like:

    https://developer.nvidia.com/gpugems/gpugems3/part-v-physics...

    As an Apple platforms developer I actually worked through those books to figure out how to convert the CUDA stuff to Metal, which helped the material click even more.

    Part of why I did it was – and this was some years back – I wanted to sharpen my thinking around parallel approaches to problem solving, given how central those algorithms and ways of thinking are to things like ML and not just game development, etc.

  • by lacker on 6/9/25, 12:34 AM

    If you're experienced in C++ you can basically just jump in. I found this youtube series to be really helpful:

    https://www.youtube.com/playlist?list=PLxNPSjHT5qvtYRVdNN1yD...

    After watching this video I was able to implement a tiling version of a kernel that was the bottleneck of our production data analysis pipeline to improve performance by over 2x. There's much more to learn but I found this video series to be a great place to start.

  • by weinzierl on 6/8/25, 12:02 PM

    Nvidia itself has a paid course series. It is a bit older but I believe still relevant. I have bought it, but not yet started it yet. I intend to do so during the summer holidays.
  • by majke on 6/8/25, 1:12 PM

    I had a bit, limited, exposure to cuda. It was before the AI boom, during Covid.

    I found it easy to start. Then there was a pretty nice learning curve to get to warps, SM's and basic concepts. Then I was able to dig deeper into the integer opcodes, which was super cool. I was able to optimize the compute part pretty well, without much roadblocks.

    However, getting memory loads perfect and then getting closer to hw (warp groups, divergence, the L2 cache split thing, scheduling), was pretty hard.

    I'd say CUDA is pretty nice/fun to start with, and it's possible to get quite far for a novice programmer. However getting deeper and achieving real advantage over CPU is hard.

    Additionally there is a problem with Nvidia segmenting the market - some opcodes are present in _old_ gpu's (CUDA arch is _not_ forwards compatible). Some opcodes are reserved to "AI" chips (like H100). So, to get code that is fast on both H100 and RTX5090 is super hard. Add to that a fact that each card has different SM count and memory capacity and bandwidth... and you end up with an impossible compatibility matrix.

    TLDR: Beginnings are nice and fun. You can get quite far on the optimizing compute part. But getting compatibility for differnt chips and memory access is hard. When you start, chose specific problem, specific chip, specific instruction set.

  • by dist-epoch on 6/8/25, 11:15 AM

    As they typically say: Just Do It (tm).

    Start writing some CUDA core to sort an array or find the maximum element.

  • by epirogov on 6/8/25, 12:48 PM

    I bought P106-90 for 20$ and start porting my date apps to parallel processing with it.
  • by matt3210 on 6/8/25, 6:44 PM

    Just make cool stuff. Find people to code review. I learn way more during code reviews than anything else.
  • by brudgers on 6/8/25, 7:02 PM

    For better or worse, direct professional experience in a professional setting is the only way to learn anything to a professional level.

    That doesn't mean one-eyed-king knowledge is never enough to solve that chicken-and-egg. You only have to be good enough to get the job.

    But if you haven't done it on the job, you don't have work experience and you are either lying to others or lying to yourself...and any sophisticated organization won't fall for it...

    ...except of course, knowingly. And the best way to get someone to knowingly ignore obvious dunning-kruger and/or horseshit is to know that someone personally or professionally.

    Which is to say that the best way to get a good job is to have a good relationship with someone who can hire you for a good job (nepotism trumps technical ability, always). And the best way to find a good job is to know a lot of people who want to work with you.

    To put it another way, looking for a job is the only way to find a job and looking for a job is also much much harder than everything that avoids looking for a job (like studying CUDA) by pretending to be preparation...because again, studying CUDA won't ever give you professional experience.

    Don't get me wrong, there's nothing wrong with learning CUDA all on your own. But it is not professional experience and it is not looking for a job doing CUDA.

    Finally, if you want to learn CUDA just learn it for its own sake without worrying about a job. Learning things for their own sake is the nature of learning once you get out of school.

    Good luck.

  • by izharkhan on 6/8/25, 12:25 PM

    Haking Kase kare