Replies: 1 comment 10 replies
-
|
Interesting stuff. I assume this replicated across many runs? Since this would be inherently random to my knowledge. This might be a thing with DXC optimizing very well. If you try to manually use naga to compile, and then invoke DXC with a low optimization level, and pass this through using passthrough shaders, does that give a slower DX12 run? |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I made a sha256 brute force stuff (or a miner simulator) to find an input producing digests starting with zero bits. The code is shown at the bottom. I'm quite new to webgpu/wgpu and am trying to make some things. The code may be a little dumb somehow. However anyway, to my very surprise, DX12 backend of this program on Windows 10, runs much more faster than Vulkan on Windows/Linux!
Use this cmdline to test it:
My hardware is NVIDIA GeForce RTX 3060 Mobile. From my tests, on both Linux/Windows, the Vulkan backend finished the work in about 16s. However the DX12 backend did it only in ~2.5s (startup time not counted). I've played around with it and seems DX12 is trying to unfold for-iterations in the compute shader, so when you set a higher
-iparameter, the startup time will become larger. But still, I'm not expecting such a big difference.Another thing that is weird: when the dx12 version runs, Windows Task Manager only keeps showing a very low CPU and GPU usage (can be < 10% e.g.) (however GPU fans start spinning plus
nvidia-smireports 100%). Also the desktop is smooth (cursor moving, etc.). As a comparison, when the Vulkan version runs, Task Manager reports 100% as expected, and the desktop becomes a bit laggy.I don't know if dx12 does some magical optimizations for my naive code. Or, does that mean, if I write the code in a more optimized way, the Vulkan version could also run in ~2.5 seconds?
You can run the program below; observe the
dispatch: xx, start: xxlines also get printed faster than Vulkan's. It's not a fake illusion - DX12 runs really much faster than Vulkan here. I want an explanation.. Appreciate it!Code
Beta Was this translation helpful? Give feedback.
All reactions