
Linux running in a shader! By _pi_! Check it out!! The project has been featured on Adafruit, and my friend over on twitter has posted video evidence as well: Thanks to the team organizing the event for providing me with the opportunity! Here’s a recording of the live-stream where I presented it, it’s fun to see everyone’s reactions when I unveiled my big “secret project”:

This picture was taken after I showed off my work at the community meetup, a self-organized weekly get-together of VRChat creators from all over. Here’s me in my Avatar again, standing in front of a kernel panic: (a screenshot of the VRChat world and interface to use the emulator)

You will require a VRChat account and the corresponding client, both of which are free and give you access to a massive social platform full of user-created content such as this (no VR headset required!). You can experience the result of all this for yourself by visiting this VRChat world. And after a few months of work, I’m now proud to present the worlds first (as far as I know) RISC-V CPU/SoC emulator in an HLSL pixel shader, capable of running up to 250 kHz (on a 2080 Ti) and booting Linux 5.13.5 with MMU support. Due to the inherent limitations of that platform, the tool of choice had to be a shader. Let’s hope it will at least turn out entertaining.Īround March 2021 I decided on writing an emulator capable of running a full Linux Kernel in VRChat.

emulated RISC-V rv32ima/su+Zifencei+Zicsr instruction set.Here are some specs up front, if you’re satisfied with piecing the story together yourself:

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. Sometimes I decide to double down and get Linux running on my graphics card. Usually these ideas appear, I enjoy dissecting them for a few days, and then I move on. And then reality strikes, and you realize how utterly insane this would be, and just how much work would need to go into it. The idea grips you, your mind’s eye can practically visualize it already. Sometimes you get hit with ideas for side-projects that sound absolutely plausible in your head. Cursed technology stuff Linux in a Pixel Shader - A RISC-V Emulator for VRChat 25 August 2021, by _pi_įor comments see Hacker News, r/programming or r/vrchat Intro
