All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Running Linux in a Pixel Shader: Building a RISC-V Emulator for VRChat

By

rbanffy

6mo ago· 35 min readen

Summary

A developer documents their ambitious side project of creating a RISC-V emulator that runs Linux entirely within a pixel shader in VRChat. The article details the technical challenges of implementing a CPU emulator in HLSL shader code, including memory management, instruction execution, and system calls, all running on a GPU. The project successfully boots Linux in a virtual world, demonstrating extreme technical creativity and pushing the boundaries of what's possible with modern graphics hardware.

Key quotes

· 5 pulled
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.
But sometimes. Sometimes I decide to double down and get Linux running on my graphics card.
This is the story of how I got Linux running in a pixel shader in VRChat.
The core idea is simple: implement a RISC-V emulator in HLSL shader code, and use that to run Linux.
It's slow, it's impractical, but it works - and that's the beauty of it.
Snippet from the RSS feed
Linux in a Pixel Shader - A RISC-V Emulator for VRChat

You might also wanna read