4 ms·
Eh, I would say Vulkan decreases reliability. Precisely because Vulkan drivers are much thinner and do no error checking, it becomes very likely that you will
by nhaehnle 9y ago
Eh, I would say Vulkan decreases reliability.
Precisely because Vulkan drivers are much thinner and do no error checking, it becomes very likely that you will end up writing code that works on one system but fails on the next.
Granted, OpenGL has some of the same issues. It's incredibly frustrating when vendor B accepts some GLSL that is forbidden by the spec, and then some application fails on the more conformant driver of vendor A because the developer failed to test properly.
The thing is, Vulkan multiplies these issues significantly. You still have a compiler in the driver, so you still get the same potential for shader incompatibilities. But you also get to manage barriers and texture transitions yourself, and boy is it likely that you'll get something wrong there. And since memory models are different across vendors (and even different between different generations of hardware from the same vendor), it is extremely likely that you end up with code that works on card A but fails subtly on card B.
There are tools that try to catch these kinds of errors, but they're far from perfect.
On the issue of memory management, I am unaware of any OpenGL issues here that make applications unreliable. Sure, drivers may not always manage memory optimally, but having an application that runs a bit less than optimally is very different from an application that renders garbage because you failed to allocate your textures with sufficient alignment -- which is something you can do in Vulkan.
So really, at the end of the day, Vulkan is about giving graphics developers foot-guns in order to reduce CPU overhead. That was explicitly its mission statement from the beginning!
- laythea 9y agoThanks for the info! I'm no Vulkan expert. I'm coming from OpenGL, hoping that Vulkan will make things better eg at allowing the app to manage GPU memory explicitly to suit the application use-case. Agreed, reliable was the wrong word. Depending on the use-case, the ability for a program to tune its memory usage to effect performance in some beneficial way can mean the difference between a program that is usable or not - for an application trying to extract max perf. It is my understanding that Vulkan will help with this. Can you confirm?
- nhaehnle 9y agoI'm honestly uncertain. My best guess right now is: If you know what you're doing, it's possible that you might do memory management better in Vulkan. Then again, it's possible that by trying to exploit the freedom Vulkan gives you, you're actually making things worse. I suspect it's similar to prefetching and non-temporal moves on the CPU in that way. If you're targeting a specific machine and spend a lot of time on optimizations, then using those advanced features can give you a performance boost. But then a new machine comes along, and your fancy tweaks turn out to have made thing worse -- this happened with some games when Ryzen came out, and I suspect it's likely to happen with Vulkan as well. The main benefit of Vulkan is that it cuts CPU overhead because the driver no longer has to do state tracking. The state tracking is done (almost) entirely by the game engine, which knows precisely what is needed and can therefore do the job more efficiently. This is totally unrelated to memory management. Though keep in mind I'm speaking from a Linux perspective. On Windows, video memory is managed somewhat differently at least in WDDM2. Still, I'd be surprised if the story is much different. Vulkan doesn't expose the details of video memory swapping.
- laythea 9y agoThanks again.