Hacker News new | ask | show | jobs
by ncmncm 1547 days ago
While we're here: is there any reasonable prospect of keeping one's GPU from being able to read and write to literally anywhere in physical memory?

I.e., a practical way a kernel and driver might be able to forward to the GPU only commands and shaders that can access only your process memory, and nobody else's, and your process's pixels, and no other process's pixels, when they live in GPU RAM?

For all I know, this is the norm for all GPUs, but I wonder why it is hard, then, for VMs to share a GPU.

2 comments

> I wonder why it is hard, then, for VMs to share a GPU.

It isn't. Nvidia & AMD just charge a massive premium for the privilege. Nvidia calls it vGPU https://docs.nvidia.com/grid/13.0/grid-vgpu-user-guide/index... and AMD calls it MXGPU https://www.amd.com/en/graphics/workstation-virtual-graphics

Both have been around for a while now, and both refuse to bring it to their consumer cards.

> is there any reasonable prospect of keeping one's GPU from being able to read and write to literally anywhere in physical memory?

This is the purpose of an IOMMU.

> I.e., a practical way a kernel and driver might be able to forward to the GPU only commands and shaders that can access only your process memory, and nobody else's, and your process's pixels, and no other process's pixels, when they live in GPU RAM?

So IOMMU and the GPU's MMU.

> For all I know, this is the norm for all GPUs

What?

> but I wonder why it is hard, then, for VMs to share a GPU.

Engineering is hard.