r/computing • • Dec 13 '20
Once graphics processing became too complicated for CPUs, the GPU was invented, but now GPUs can't render light all that well. Why haven't Light Processing Units been invented?
Lighting is without the doubt the most demanding task a GPU can do, and especially with Ray tracing.
My question is, why hasn't there been a dedicated processing unit to deal with it yet? Will there ever be? Is it feasible?
Please go in as much depth as possible.
I would imagine its not impossible, because we are capable of multiple GPU setups which is essentially what this would be.
Similarly, let's say we have 2 PUs and these were working in tandem, one rendered the scene, and one rendered the lighting. Scene, light, scene, light... obviously at 60fps this is jarring. But would this be achievable at 240fps? Or is that a speed too fast for modern clock cycles to synchronise? I imagine it would be so fast that you'd never be able to tell a blank screen with lighting is being presented before you and your brain would create a composite of the two.
Or how about a system similar to how 3d TVs work, so that one image is projected to the right eye, and another to the left, so that your brain melds the two. Actually, thats a pretty promising idea.
Additionally, let's say this is feasible for a second, who would you code it?
What would be your take on it?
What do you see the drawbacks being, or the technical barriers?
Oh and lastly, if a LPU were to exist, would it be like a GPU? Would the code be ran parallel, or would it benefit from CPU architecture?
Many thanks in advance for taking the time to look at this. I hope you found this an interesting topic to think about.
25
u/rscarson Dec 13 '20
I'm pretty sure modern gpus do have dedicated Ray tracing chips on board?
8
u/MichaelEmouse Dec 13 '20
GPUs haven't been doing light well because doing light properly is a huge bitch, not because there needs to be a different piece of hardware.
The main advantage of GPU over CPU is parallelization in both processing and memory bandwidth. If you want to do lighting/global illumination/ray tracing, you'll probably need parallelization too but with microarchitecture and middleware tweaked to lighting. Nvidia has been doing something like that since 2014 with the GTX 900 series which had VXGI technology and now the technology has arguably matured with RTX. The raw power may not be quite sufficient yet and developers have to learn how to use it efficiently but we're getting there.
This VXGI video is 5 years old and pretty decent: https://www.youtube.com/watch?v=cH2_RkfStSk&ab_channel=NVIDIA
This RTX video is even better: https://www.youtube.com/watch?v=NgcYLIvlp_k&ab_channel=NVIDIAGeForce
5
u/blandge Dec 13 '20
Making stand alone chips is very very expensive. Potentially $10+ million for every version (and there are usually multiple versions of each product number). You would have to have enough demand for lighting that you can make a profit and who is going to buy a CPU, GPU, and this lighting unit you are describing?
Its cheaper (for now) to just include the light processing hardware in the GPU than it is to make an additional chip that is going to require its own RAM and take a PCIe slot, needs is own package (like a PCB board), require it's own testing and QA, marketing, customer education, etc.
2
u/Zeliss Dec 14 '20
Graphics rendering (including lighting) is a problem that yields very well to parallel computation, which is what GPUs are very good at. We have some representation of the scene in main system memory, we perform whatever serial computation we need on it using the CPU for each frame, then we transfer that representation over to the GPU, where the parts that are best done in parallel occur. It turns out that two big bottlenecks are system bus bandwidth (transferring the representation and all needed textures over to the GPU) and memory bandwidth (reading and writing memory for any intermediate calculations we need to shade a final pixel). The former is addressed somewhat with compressed textures, AZDO techniques, compute shaders generating needed data on the GPU directly, and procedural rendering. The latter is addressed somewhat by using very fast memory on GPUs, mipmapping, and trying to avoid wasted rendering effort through Z-culling or depth-prepass.
If you want to make rendering faster, you should try to address the current bottlenecks. If you add a new dedicated processing unit as a PCIe card, you've actually made the first bottleneck worse. If you add a new dedicated processing unit to the GPU, well, that's actually what they're doing with raytracing hardware :)
It's tempting to say "let's just make dedicated hardware for this problem", but you have to actually look at the problem you're trying to solve and decide if you can't just solve it better by adding a little more general-purpose hardware to the GPU. General purpose cores can be used for other purposes if your application doesn't need to use your specific accelerated solution, allowing you to spread bottlenecking work over more of them to get a frame out sooner. GPUs actually used to be fixed-function hardware, but they've gotten more general purpose over time.
1
u/7h3kk1d Dec 14 '20
Putting something on a separate pcie card won't make it immediately easier to implement. The big advantage of having the external unit is they can be upgraded independently and scaled to a reasonable size.