Hi; when an Optimus/Prime system is used with vkd3d-proton ( D3D12 to Vulkan translation layer that is used in Valve’s Proton and can be used on Wine as well ) with master branch of it, games fails to render anything on screen.
Using VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_id environment variable makes the DX12 games renders correctly with vkd3d-proton.
When apps fails to render , log that is grabbed with VKD3D_CONFIG=vk_debug contains 0198:err:dxgi_vk_swap_chain_recreate_swapchain_in_present_task: Failed to create swapchain, vr -3..
When VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_id is used, apps renders correctly and log from VKD3D_CONFIG=vk_debug contains 0198:info:dxgi_vk_swap_chain_recreate_swapchain_in_present_task: Got 3 swapchain images instead of failure.
Can be easily reproduced within Steam with any DX12 game and using Proton Experimental as Proton build. Proton Experimental ships a fairly close to vkd3d-proton master build.
A further note; Nvidia actually tried to fix issues with that extension in 525.78.01 with Fixed a bug where usage of VK_KHR_present_id could cause applications to crash with Xid 32 errors. . With 525.78.01 and newer apps doesn’t crash anymore when that extension is used but has presentation problems mentioned/explained above.
I have filed a bug 3958879 internally for tracking purpose.
Shall try to reproduce issue locally and get back to you if require any additional information.
I am seeing similar issue in Metro Exodus game where as soon as intro video ends, the game Metro Exodus turns into black screen completely.
However I am getting XId 13 & 109 in dmesg logs where as your bug report doesn’t have such logs.
2-) Metro Exodus is a Linux native game that uses Vulkan unless you force it to use Proton which then will use DX12 and therefore vkd3d-proton. Additionally Windows build of Metro Exodus has both DX11 and DX12. So you have to make sure you’re using DX12 as well as it won’t repro on DX11.
3-) Proton version is crucial. Vkd3d-proton in Proton Stable won’t repro the issue, you need Proton Experimental.
2-) Add either ( problem is visible with either of them ) gears.exe or triangle.exe to Steam as a non Steam game. Click Add non Steam Game to Steam button in top left of Steam library view, select one of those demo exes. After that right click to that entry in Steam library-Properties-Force a Steam compatibility tool. Select Proton Experimental there.
3-) Make sure you launch them on Nvidia gpu by checking with nvidia-smi. If needed use NV prime render offload vars or vk icd filenames env variables.
4-) Run. Notice how they’re just not rendering anything. Close the demo.
5-) Add this as a launch option in Steam for the demo entry you’ve manually added.
@VulkanGuy
Unfortunately, I am still not able to repro this issue so far on multiple setups as mentioned below after following repro steps mentioned in last comment.
Both applications (gears and triangle) are rendering correctly.
Acer Nitro AN515-45 + AMD Ryzen 7 5700G with Radeon Graphics + Ubuntu 22.04.1 LTS + NVIDIA GeForce RTX 3080 + Driver 525.89.02 — prime setup
Dell Alienware m17 + Intel(R) Core™ i7-8750H CPU @ 2.20GHz + Ubuntu 20.04 LTS + NVIDIA GeForce RTX 2060 + Driver 525.85.05 – prime setup
HP OMEN by HP 25L Gaming Desktop GT15-0xxx + Ubuntu 20.04 LTS + NVIDIA GeForce RTX 3080 + Driver 525.85.05
Behaviour described above gets worse on 530 driver; i have to disable extension on vkd3d-proton 2.8 now, on 525 it worked on 2.8 but failed on master. Now with 530 it even fails on vkd3d-proton 2.8
Are you using an X.org conf like mentioned in the second link? I don’t as docs says there is no need to so i use Prime Render Offload env vars.
A second alternative is to use PRIME render offload, such that the integrated graphics device is used to drive the X screen, but the NVIDIA GPU is used on a per-application basis to accelerate rendering of specific applications. For details, see Chapter 35, PRIME Render Offload
I also tried without Xorg.conf file and using Prime Render Offload env vars but no luck in repro.
Could you please share repro video once for reference so that I can compare steps tried on my setup.
I did not deliberately set it to be that way. I have no configs in place to do that, i’m just using Prime Render Offload.
Besides; per readme what i do is a supported use case aka no fiddling.
Configure the X Server
On systems with both an integrated GPU and an NVIDIA discrete GPU, the X.Org X server version 1.20.7 and newer will automatically use NVIDIA’s PRIME render offload support if the system BIOS is configured to boot on the iGPU and no other explicit configuration files are present. Note that some Linux distributions (such as Ubuntu) may configure the X server differently. Please refer to your distribution’s documentation for details.
I sadly don’t have time to fiddle with my system as of now and it is clear that a driver issue is in play rather than config as with 530 driver situation is worse.
This issue was unable to reproduce on stable proton because it had workaround for this case which was reverted by this commit (probably because it was reported as fixed in 525.78.01):
So, previously vkd3d was disable this vulkan extensions for nvidia driver by default.
As I can see in commit I mentioned above it check the major driver version to be 525 and enable workaround if yes. So, on 530 driver it don’t enabled on any vkd3d version.
It’s mean that probably nothing new was broken in 530.
Hello! The bug still exists in driver “VIDIA-SMI 525.89.02 Driver Version: 525.89.02 CUDA Version: 12.0”.
It affects most/all DirectX 12 games running via VKD3D. The symptom: They hang at startup, freezing the entire computer for a few minutes at a time so that not even the mouse cursor can render, and then the game rolls smoothly for a little while, until it suddenly freezes the computer again.
But be aware… VKD3D coded a workaround to disable the broken Vulkan extensions in NVIDIA’s driver. So if you want to troubleshoot the issue and reproduce it internally, you need to build VKD3D from source and remove both of the bugfixes mentioned below:
There are two fixes for NVIDIA bugs there. The Vulkan present id/wait hang, and some queue/work related hang. Those bugs will be masked by VKD3D if you don’t remove those workarounds. :)
As a FYI; i won’t be able to test this issue further for any new potential fixes etc since i’ve built a desktop PC with AMD gpu and gave away my laptop ( device i reproduced the issue on ) to my brother with Windows installed in it.
So asking to people in the Github thread linked above for further testing would be better.