News for hackers. Stuff that matters.
Re:Rust on Every GPU by littlestymaar on Saturday July 26, 2025 @08:06AM (#44693470)
The performance purist don't use Cuda either though (that's why Deepseek used PTX directly).

Everything is an abstraction and choosing the right level of abstraction for your usecase is a tradeoff between your engineering capacities and your performance needs.

Re:Rust on Every GPU by LowLevelMahn on Saturday July 26, 2025 @08:10AM (#44693494)
this Rust demo also uses PTX directly

  During the build, build.rs uses rustc_codegen_nvvm to compile the GPU kernel to PTX.
  The resulting PTX is embedded into the CPU binary as static data.
  The host code is compiled normally.
Re:Rust on Every GPU by LegNeato on Saturday July 26, 2025 @08:22AM (#44693582)
To be more technically correct, we compile to NVVM IR and then use NVIDIA's NVVM to convert it to PTX.
Re:Rust on Every GPU by saagarjha on Sunday July 27, 2025 @07:43AM (#44700594)
That’s not really the same thing; it compiles through PTX rather than using inline assembly.
Re:Rust on Every GPU by LegNeato on Thursday July 31, 2025 @09:40PM (#44752188)
FYI, you can drop down into ptx if need be:

https://github.com/Rust-GPU/Rust-CUDA/blob/aa7e61512788cc702...

Re:Rust on Every GPU by brandonpelfrey on Saturday July 26, 2025 @09:39AM (#44694011)
The issue in my mind is that this doesn’t seem to include any of the critical library functionality specific eg to NVIDIA cards, think reduction operations across threads in a warp and similar. Some of those don’t exist in all hardware architectures. We may get to a point where everything could be written in one language but actually leveraging the hardware correctly still requires a bunch of different implementations, ones for each target architecture.

The fact that different hardware has different features is a good thing.

Re:Rust on Every GPU by rbanffy on Saturday July 26, 2025 @07:14PM (#44697648)
The features missing hardware support can fall back to software implementations.

In any case, ideally, the level of abstraction would be higher, with little application logic requiring GPU architecture awareness.