It is a known issue that Nvidia isn't performing optimally together with vkd3d-proton compared to native d3d12. Things to improve it have been and are still being explored.
https://github.com/HansKristian-Work/vkd3d-proton/pull/1902 Is some of the latest work in this category.
The above work can now be tested on Proton Bleeding Edge.
Right now this needs the Vulkan Dev driver to work (550.40.53)
Ok, thanks for the hint. I tried with a master wine build but I had some issues with it. I'll try proton instead.
I compiled Proton Experimental Bleeding Edge.
Tried 3 games, saw no difference unfortunately. I expected to see some change at least.
It is expected to only have a noticable effect in some games. Dead Space is one known. Lies of P too I've gathered.
AC valhalla is a weird game. Nothing seems to fix the FPS. Been benchmarking it across many drivers and vkd3d/proton versions.
Guardians of the galaxy and Control also saw no change.
EDIT:
Speaking of Control, it's been a hit and miss depending on what versions of proton and vkd3d that was used. But it ran pretty much like Windows on an RTX 3060Ti last time I used that card. For some reason after i switched to RTX 4070 I don't seem to get the same performance, i lose around 30 FPS compared to Windows.
Is there a way to check if nv_raw_access_chains is really being used?
@doitsujin @HansKristian-Work
Sorry to ping you but isn't this a bit weird, look at the GPU usage, from Control, this is with RT on. Obviously the card has a lot more to give...
Same location on Windows under D3D12 gives me ~90 FPS (89-98% GPU load).
Ok, so, if anyone can explain this? I noticed that turning Resizable Bar OFF (Above 4G decoding still ON) in BIOS actually makes Control use 99-100% of the GPU and bumps the FPS with ~15... so from 60, to 75. Still 15 FPS away from Windows but quite the bump nonetheless...
I also tested VKD3D_CONFIG=no_upload_hvv and Rebar ON in BIOS, it did not make any difference at all.
If it was possible to workaround it with no_upload_hvv it would not be an issue, but I can't. I don't know what sort of voodoo this game uses.
I did a test with Rebar off again but it didn't really help Control this time from what I could tell, then I disabled Above 4G decoding and boom, GPU usage was 100% and the FPS increased.
@HansKristian-Work Is there any way to bypass Above 4G decoding in vkd3d-proton? Or is it something managed by the driver?
There are reports that Alan Wake 2 also benefits slightly with 4G decoding off.
You can try VKD3D_CONFIG=no_upload_hvv, which prevents us from putting certain memory allocations in VRAM on ReBAR-enabled systems.
In my experience it is somewhat system-dependent whether or not doing so helps though so I'm somewhat hesitant on doing these tweaks by default.
@doitsujin Yea, but no_upload_hvv does not help at all, disabling 4G Decoding entirely in BIOS seems to be the only fix. That's why I was wondering if there was some way to disable 4G decoding in vkd3d-proton somehow. At least then we'll have a togglable setting for it.
No, we cannot override a BIOS setting from user space.
Yeah, it's quite possible a driver issue too. I have no idea. I was hoping 4G decoding could be bypassed in the code,
Windows is not affected by this under DX12.
A followup (again, I know)... I still feel like something is off here...
When starting Control vkd3d-proton log says this:
01f0:warn:d3d12_query_heap_create: Working around query heap bug.
01f0:warn:vkd3d_allocate_device_memory: Memory allocation failed, falling back to system memory.
That doesn't seem right? Why would it fall back to system memory when I have a 12GB card? I had an 8GB card some months ago and I thought it was on the edge for running Control in Linux, but it seems to be something else.
Hmm, I had another look at this. Is this a purely a game issue? It does not seem to be able to allocate required memory if Rebar is enabled, is there any way around this or figure out what the heck is going on? I tried with no_upload_hvv, then the allocation warning disappears but the performance does not improve, GPU usage is still 73% and not 100%.
The performance only improves if I actually disable Rebar/4G decoding in bios.
Update:
VKD3D_CONFIG=force_host_cached actually fixes the GPU usage issue, the game now uses the GPU 100% and vkd3d-proton does not complain about not being able to allocate the memory.... FPS does also seem to improve slightly in some areas but it might also cause the FPS to drop slightly too in other areas.
The "falling back" message can happen if ReBAR budget is exhausted. VKD3D_CONFIG=log_memory_budget gives a clearer picture.
Here's the log.
memory.log
System:
RTX 4070 - 12GB VRAM
Gigabyte Aorus Master Z390
Intel i9 9900KS
32GB RAM
❯ nvidia-smi -q -d memory
==============NVSMI LOG==============
Timestamp : Tue Aug 27 18:13:51 2024
Driver Version : 560.35.03
CUDA Version : 12.6
Attached GPUs : 1
GPU 00000000:01:00.0
FB Memory Usage
Total : 12282 MiB
Reserved : 382 MiB
Used : 853 MiB
Free : 11048 MiB
BAR1 Memory Usage
Total : 16384 MiB
Used : 20 MiB
Free : 16364 MiB
Conf Compute Protected Memory Usage
Total : 0 MiB
Used : 0 MiB
Free : 0 MiB
Update with additional information:
So it seems like with just 4G Decoding (256Mb BAR1 according to nvidia-smi) the game does actually utilize the GPU fully.
As soon as Rebar is enabled, the game doesn't utilize the full GPU. No matter if I run with no_upload_hvv, it does not help, as I said before.
This game "likes" a smaller bar size for whatever reason. Can I set the available bar size in vkd3d-proton to trick the game? It would be an interesting test.
Another interesting find is that the GPU utilization issue is only present when RT is turned on, if RT is off, FPS is great and GPU usage is 100%.
Lot's of focus on Control now, as for other games, if I disable Rebar, I actually don't notice much of a difference tbh, so I might just leave Rebar off........
I tried vkd3d-proton under Windows with Control (RT on)...
While there is a maybe slight performance drop in Linux compared to Windows with vkd3d-proton (might be because of the proton layer itself), the drop can't really be blamed on the Nvidia Linux drivers, At least not when it's comes to this game,
The GPU utilization issue with Rebar is not present under Windows tho', I don't think the falling back to system memory is the issue, since it does that under windows too.
I tried AC Valhalla with vkd3d-proton under Windows too... not as bad as Linux but still way worse than DX12.
I've tried to do some more reasearch...
Nvidias Vulkan performance doesn't seem to be bad using a native benchmark.
https://www.phoronix.com/review/breaking-limit-rt-linux
There's also this rather old post:
https://forums.developer.nvidia.com/t/linux-benchmarks-for-native-games/67238
I could be wrong but the performance degradation seems to be affecting vkd3d-proton only.
Done some more testing on my end...
"Native" vulkan - Same or better than Windows (RDR2 and Breaking limit tested)
DXVK - ~the same as Windows running DX11, may vary slightly.
vkd3d-proton - Up to 30% performance loss vs DX12 depending on title, both in Linux and Windows.
The performance issues with vkd3d-proton isn't Linux driver specific, which I've always thought.
Closing this, it got a bit hard to follow and I'm basically just having a monologue with myself. Besides more people started to see that Nvidia got issues with vkd3d-proton by now. There's a "new" thread on the Nvidia forums that gained some traction.
I'm curious where the bottleneck is tho', is it just "bad drivers" or does it go deeper than that and is somewhat a hardware limitation somewhere?
proton experimentalx1 2024-03VKD3D_CONFIG=log_memory_budgetx1 2024-08VKD3D_CONFIG=force_host_cachedx1 2024-08VKD3D_CONFIG=no_upload_hvv`,x1 2024-08VKD3D_CONFIG=no_upload_hvvx1 2024-03
It'll leave this here for cross reference, everything is in the forum post.
But in short, it feels like D3D12 suffer more then D3D11 titles with Nvidia GPUs, I understand there's technical differences between the two API's but it feels like something is off somewhere.
https://forums.developer.nvidia.com/t/please-sort-out-the-dx12-vkd3d-proton-performance-under-linux/284642/2
Thanks for all your efforts @doitsujin and @HansKristian-Work and everyone else involved.
If I can assist in any way, please let me know.