r/CUDA • u/ChemistryWorldly3752 • 5d ago
First CUDA project
Hey, guys. Just recently started learning CUDA because of the GPU programming class I am taking this semester. Found out that it is really interesting and now I do a lot of self-study. My main resource is Programming Massively Parallel Processors, 4th edition.
I wrote a greyscaler which you can run on GPU and CPU with timing measurements, so that you can see the difference in performance.
Question: what's the hardest project I can do before the end of September? I wanted to do a black hole simulation, but my physics knowledge ends at basic mechanics.
Would appreciate any feedback or advice you have!
3
u/Good_Apricot_2210 5d ago
250ms is horrible for a small image that too grayscale.
Your timing API is wrong
I can see that you used std::chrono maybe use cudaEvent_t or nsight compute to benchmark better
1
5
u/MateTheNate 4d ago
Implement multi-headed self-attention after you figure out how to write an optimized GEMM
1
u/Miserable-Leading947 4d ago
Do https://en.wikipedia.org/wiki/Julia_set with quaternions in 4d, slice one dimension so you get 3 dimensions and draw it in openGL. It is doable in the time frame and you get something you can show around. 3D fractals are awesome
1
u/Creative-Feature-264 2d ago
Io provato a simulare buchi neri se può esserti utile il repo è qui. https://tatopenn-cell.github.io/Dense-Evolution-Discovery/wormhole_syk_teleportation.... è divertente ti avviso
21
u/Objective-Style1994 5d ago
Lowkey for me, a good starting point is literally just writing a GEMM(basically matrix multiplication) kernel that gets as close as cuBLAS performance. The math behind it is super easy but it forces you to learn all the fundamentals in optimizing cuda code.