Linux in a Pixel Shader - A RISC-V Emulator for VRChat
Sometimes you get hit with ideas for side-projects that sound absolutely plausible in your head. The idea grips you, your mind’s eye can practically visualize it already. And then reality strikes, and you realize how utterly insane this would be, and just how much work would need to go into it. Usually these ideas appear, I enjoy dissecting them for a few days, and then I move on. But sometimes. Sometimes I decide to double down and get Linux running on my graphics card. This is the story of how I made the rvc RISC-V emulator within VRChat, and a deep-dive into the unusual techniques required to do it. Here are some specs up front, if you’re satisfied with piecing the story together yourself: (image credit: @pema99, thanks!) Be warned that this post might be a bit rambly at times, as I try to recall the many pitfalls of writing this shader. Let’s hope it will at least turn out entertaining. Around March 2021 I decided on writing an emulator capable of running a full Linux Kernel in VRC
Linux in a Pixel Shader - A RISC-V Emulator for VRChat 25 August 2021 , by _pi_ views for comments see Hacker News , r/programming or r/vrchat Intro Sometimes you get hit with ideas for side-projects that sound absolutely plausible in your head. The idea grips you, your mind’s eye can practically visualize it already. And then reality strikes, and you realize how utterly insane this would be, and just how much work would need to go into it. Usually these ideas appear, I enjoy dissecting them for a few days, and then I move on. But sometimes. Sometimes I decide to double down and get Linux runn
saved by
related reading
- How to Optimize a CUDA Matmul Kernel for cuBLAS-like Performance: a Worklogsiboehm.com
- PiTorch: ML on Baremetal Raspberry Pis | projectsmasonjwang.com
- GitHub - adam-maj/tiny-gpu: A minimal GPU design in Verilog to learn how GPUs work from the ground up · GitHubgithub.com
- A case for learning GPU programming with a compute-first mindset – Maister's Graphics Adventuresthemaister.net
- What happens when you run a CUDA kernelfergusfinn.com
- Inside NVIDIA GPUs: Anatomy of high performance matmul kernels - Aleksa Gordićaleksagordic.com
- ⭐️ Fast LLM Inference From Scratchandrewkchan.dev
- p0: Running Rust code on RISC-V in QEMU · Meyer Zinnmeyerzinn.tech
- Teaching GPU programming in p5.js: now with compute shaders - Dave Pagurekdavepagurek.com
- Write your Own Virtual Machinejmeiners.com
- The Case for Use.GPU — Acko.netacko.net
- Dissecting the Apple M1 GPU, the endalyssarosenzweig.ca