r/GraphicsProgramming • u/TheNextJohnCarmack • Dec 20 '21
Question x64 instructions for GPU stuff?
I am thinking about creating an OS, just for myself, but I wanna do 3D games on it. Can I just write my own driver for one specific GPU (nevermind the logistics, this is a hobby project. I just want to know if it is POSSIBLE), and how would I do that?
3
Upvotes
3
u/the_Demongod Dec 20 '21
Obviously nothing is completely impenetrable, I'm sure Nvidia and AMD have teams of experts trying to reverse engineer each others' ISAs. It's just probably outside the capabilities of one person. Modern hardware is definitely a FOSS enthusiast's worst nightmare, it's absurdly complicated and the fine details of the architecture represent the company's entire value on the market. That's why if you work in e.g. an Intel fab, it's incredibly silo'd and you're not allowed to know anything beyond the immediate knowledge required to do your job. In principle you can sniff the packets being sent to the GPU, but I don't see how you could manage to make the GPU do anything useful with the information you'd be able to glean from that.
I don't know why you'd want to do this anyways, if you want to learn more about GPUs you should just build your own. I don't imagine you'd be able to eke any real capability out of a full-size GPU from the information you'd garner by sniffing binary on the PCIe bus, so by building your own you'd learn a whole lot more and wouldn't be sacrificing much hardware capability since you're not going to be able to make a real GPU do anything interesting this way anyways.