Go Faster: Integrating CUDA in Go for GPU Acceleration
summary
Shows how Go calls CUDA via cgo calling C.add1 and compiles CUDA with nvcc -> libadd1.so; example increments arrays with a CUDA kernel, uses 256 threads/warp-friendly and copies memory over PCIe (the transfers are the slowest part). Demonstrates a matrix multiply (2x3 × 3x2) run 250 times, launching a 16×6 thread block per multiply, and reports scaling to thousands of parallel ops on cheap hardware; recommends NVIDIA Nsight Systems and Nsight Compute for profiling.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:33What we will cover in this talk
- 2:57Introduction to GPUs and their architecture
- 8:27CUDA memory model
- 13:53Go-CUDA with CGO
- 22:21Matrix multiplication demo
- 26:16Optimizing with NVIDIA tools
- 29:28Summary
related talks
56mFrom Go to the GPU, Integrating with CUDA
34mHigh-load CGo: calling nonblocking C/C++ code without surprise ☠️
53mReconciling the irreconcilable and accelerating the unacceleratable using Go assembler☠️
18mMachine Learning and Go
51mFrom assembler to C++: structure and optimization of CGo ☠️
42mGo Go Java Developer
19mImplementing Parallelism
47mSpeeding up Go by designing the app with CPU architecture in mind ☠️
