frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Zig and GPUs

https://alichraghi.github.io/blog/zig-gpu/
57•Cloudef•9mo ago

Comments

LegNeato•9mo ago
See also https://github.com/Rust-GPU/rust-gpu and https://github.com/rust-gpu/rust-cuda
ladyanita22•9mo ago
Surprisingly, it seems this project just supports Spir-V and PTX, but not DXIL or AMDGCN.

I say surprisingly, because I'd expect Rust support to be more mature than Zig's.

lostmsu•9mo ago
Microsoft indicated they are switching to SPIR-V from DXIL: https://devblogs.microsoft.com/directx/directx-adopting-spir...
skywal_l•9mo ago
I am a complete noob in GPU but is AMDGCN the older generation with the new one being RDNA? If you generate a binary for AMDGCN, will it run on the newest cards?

Also, I though that these GPU ISAs were "proprietary". I wonder how reliable the binary generation can be.

AliChraghi•9mo ago
AMD ISAs are changing for almost every generation so LLVM[1] continues to keep the architecture name "amdgcn" and handle the variation based on the model flag (e.g., -mcpu=gfx1030 for RDNA2, -mcpu=gfx1100 for RDNA3).

> I though that these GPU ISAs were "proprietary"

PTX spec[2] is publicly available but the actual hardware assembly (SASS) is not. Although i believe Nsight allows you to view it.

1. https://llvm.org/docs/AMDGPUUsage.html#processors

2. https://docs.nvidia.com/cuda/parallel-thread-execution

imtringued•9mo ago
If LLVM can target AMD GPUs what exactly prevents AMD and ROCm from supporting all the damn GPUs?

At this point I'm convinced that the real problem with AMD GPUs isn't necessarily the compilers (although they do produce mediocre code) or even the hardware itself, but some crappy C++ driver code that can't handle running graphics and compute at the same time. The datacenter GPUs never had to run graphics in the first place, so they are safe.

slavik81•9mo ago
In my experience, the compiler, compute drivers, and HIP runtime work fine for all modern AMD GPUs. The only parts of the stack that don't run on all GPUs are the math and AI libraries. And that is mostly because AMD isn't building and testing those libraries for unsupported GPUs. The actual work required to enable functional support was straightforward enough that I ported them myself when packaging the libraries for Debian. Though, I had a lot of help on the testing.

See the Debian Trixie Supported GPU list: https://salsa.debian.org/rocm-team/community/team-project/-/...

SomaticPirate•9mo ago
While I admire the work of hobbyists it still looks like C/C++ will be the default until a GPU vender makes the decision to support these libraries.

From my understanding, Vulkan and OpenGL are nice but the true performance lies in the specific toolkits (ie CUDA, Metal).

Wrapping the vendor provided frameworks is liable to break and that isn't tenable for someone who wants to do this on a professional basis.

pjmlp•9mo ago
They also miss that on CUDA's case it is an ecosystem.

Actually it is C, C++, Fortran, OpenACC and OpenMP, PTX support for Java, Haskell, Julia, C#, alongside the libraries, IDE tooling and GPU graphical debugging.

Likewise Metal is plain C++14 plus extensions.

On the graphics side, HLSL dominates, following by GLSL and now slang. There are then MSL, PSSL and whatever NVN uses.

By the way, at GTC NVIDIA announced going all in with Python JIT compilers for CUDA, with feature parity with existing C++ tooling. There is now a new IR for doing array programming, Tile IR.

dismalaf•9mo ago
I don't quite get this comment.

This is supposed to be used in place of CUDA, HIP, Metal, Vulkan, OpenGL, etc... It's targeting the hardware directly so doesn't need to be supported as such.

The site also seems to clearly state it's a work in progress. It's just an interesting blog post...

slowmovintarget•9mo ago
The Zig compiler can compile C, though.

Show HN: Is the world going mad' checker

https://maxua.com/mad
1•maxua•45s ago•0 comments

Why is flu so bad this year?

https://www.nature.com/articles/d41586-026-00061-6
1•7777777phil•2m ago•0 comments

Ask HN: How to bullet proof yourself from AI?

2•max_•2m ago•0 comments

ChaosBSD Is a New BSD for "Broken Drivers, Half-Working Hardware, Vendor Trash"

https://www.phoronix.com/news/ChaosBSD
1•ksec•3m ago•0 comments

Show HN: PostWoman is a open source Postman alternative for macOS X

https://github.com/King-Bong-Software/postwoman
1•felltrifortence•4m ago•0 comments

Purdue blocks admission of many Chinese grad students in unwritten policy

https://www.science.org/content/article/purdue-blocks-admission-many-chinese-grad-students-unwrit...
1•bikenaga•5m ago•0 comments

Show HN: Zero to One but it's a game

https://zerooneterminal.com
1•stellarcat•5m ago•0 comments

Some C habits I employ for the modern day

https://www.unix.dog/~yosh/blog/c-habits-for-me.html
1•todsacerdoti•7m ago•0 comments

Show HN: Open-source certificate from GitHub activity

https://certificate.brendonmatos.com
1•brendonmatos•8m ago•0 comments

Show HN: DownloadStuffs – search, preview, and download from Internet Archive

https://downloadstuffss.vercel.app/
1•dawitworku•9m ago•0 comments

Monsanto's House of the Future: A Plastic Dream of Tomorrow in Photos

https://rarehistoricalphotos.com/monsanto-house-of-the-future-photos/
1•Brajeshwar•13m ago•0 comments

AI-Mediated Representations in Monetized Interfaces

https://zenodo.org/records/18276768
1•businessmate•13m ago•1 comments

Learning about myself with 11 years of Apple Health data and OpenAI Codex

https://twitter.com/bytebot/status/2012910089892696177
1•bytebot•14m ago•0 comments

Why doesn't Superman punch out ICE?

https://lytagold.substack.com/p/why-doesnt-superman-punch-out-ice
1•HotGarbage•15m ago•0 comments

Building a baseline JIT for Lua automatically

https://sillycross.github.io/2023/05/12/2023-05-12/
1•fanf2•18m ago•0 comments

Show HN: IssueWhiz – Automated Issue Triaging

https://github.com/pierotofy/issuewhiz
1•pierotofy•18m ago•0 comments

Brazil and US eye rare earths deal

https://www.ft.com/content/401a9e84-3034-4375-bf39-56b92500c7aa
2•alephnerd•19m ago•0 comments

The Discourse Is a Distributed Denial-of-Service Attack

https://www.joanwestenberg.com/the-discourse-is-a-distributed-denial-of-service-attack/
1•7777777phil•21m ago•0 comments

China Will Clinch The AI Race

https://www.ft.com/content/d9af562c-1d37-41b7-9aa7-a838dce3f571
2•karakoram•23m ago•0 comments

What if I lie to maxmind?

1•redditbannedme•23m ago•0 comments

An Artery of Empire: The Rise and Fall of China's Grand Canal

https://worldhistory.substack.com/p/an-artery-of-empire
1•crescit_eundo•24m ago•0 comments

Ask HN: What does your home office look like?

1•chistev•25m ago•0 comments

French diplomacy uses new governement account to troll back on Trump and Elon

https://x.com/FrenchResponse
3•hinata08•27m ago•2 comments

Malicious GhostPoster browser extensions found with 840k installs

https://www.bleepingcomputer.com/news/security/malicious-ghostposter-browser-extensions-found-wit...
1•howToTestFE•28m ago•0 comments

ChatGPT to start showing ads in the US

https://www.theguardian.com/technology/2026/jan/16/chatgpt-ads-in-revenue-boost
1•howToTestFE•29m ago•2 comments

Fastrender: Experimental New Browser Engine

https://github.com/wilsonzlin/fastrender
1•simonpure•29m ago•0 comments

Imgur Is the Last True Internet Culture Remaining – But Can It Survive? (2015)

https://www.mic.com/articles/123956/imgur-s-alan-and-sarah-schaaf-look-to-the-future
1•ubercow13•30m ago•0 comments

Your Agent Skills are all Slop

https://12gramsofcarbon.com/p/your-agent-skills-are-all-slop
1•theahura•32m ago•0 comments

Anthropic, please stop suggesting to use Claude as a linter

https://evgeniipendragon.com/posts/anthropic-please-stop-suggesting-to-use-claude-as-a-linter/
2•EPendragon•34m ago•0 comments

Chinese AI Developers Say They Can't Beat America Without Better Chips

https://www.wsj.com/tech/ai/china-ai-race-us-chips-9e74b957
1•gmays•34m ago•0 comments