NVIDIAGameWorks / RTX-Path-Tracing

Real-time path tracing library and sample
Other
623 stars 67 forks source link

Vulkan support - ETA? #8

Closed BattleAxeVR closed 1 year ago

BattleAxeVR commented 1 year ago

Hi, the Path Tracing SDK website claims that both Vulkan and DX12 APIs are supported "at launch":

https://developer.nvidia.com/rtx/path-tracing/get-started

Q: What APIs are supported?

A: The Path Tracing SDK supports DirectX 12 and Vulkan at launch."

I wasn't going to say anything, and give it a few days as I assumed it would be resolved promptly in the days following this repo's launch, but it been well over a month still doesn't compile and run on Vulkan:

https://github.com/NVIDIAGameWorks/Path-Tracing-SDK/blob/main/pt_sdk/Sample.cpp#L2417

Any ETA on this?

fstrugar-nv commented 1 year ago

Hi! Thanks for the comment and I'm sorry, we completely failed on updating the docs on Vulkan support! That code comment is wrong (will be fixed) bu the actual Vulkan support is's actually in there 😅

To get it working, you need to a.) set CMake variables DONUT_WITH_VULKAN and NVRHI_WITH_VULKAN to true b.) run with "-vk" command line parameter

The 1.1.0 version that we're working on currently will bring better Vulkan support, we'll fixed the docs and etc!

BattleAxeVR commented 1 year ago

Great! thanks a bunch. That unblocks me from digging into this further.

For 1.1.0, if you could make Vulkan enabled by default so all that's needed is the -vk command line arg, that would probably save others in the future the same question.

fstrugar-nv commented 1 year ago

Will do, thanks for the feedback & we'll also document it properly! :)

BattleAxeVR commented 1 year ago

It doesn't actually compile with those two CMAKE flags set, a bunch of uninitialized shader parameter errors show up. Just a compiling warning-as-errors setting probably but I don't have time to figure out how to change it. If you know, that would be helpful.

fstrugar-nv commented 1 year ago

Hmm we had issues with various Vulkan SDK versions (and the dxc.exe in those). I think it worked with 1.3.231.1 for me. Someone also mentioned that just using latest DXC compiler (https://github.com/microsoft/DirectXShaderCompiler/releases/tag/v1.7.2212.1) worked for them too - I don't actually know if this is the valid branch to be used with Vulkan but I think it should work. I'm about to start debugging this on our end for the 1.1 which is due out soon(ish :) ).

BattleAxeVR commented 1 year ago

Ok, that sounds good, I'll try that. thanks

fstrugar-nv commented 1 year ago

Hey BattleAxeVR, sorry for the delay - we've got the 1.1.0 out and Vulkan support is significantly improved although it's still not enabled by default until few remaining issues are fixed. Please check out the current Vulkan build steps: https://github.com/NVIDIAGameWorks/Path-Tracing-SDK#building-vulkan

Please let us know if there are any issues :)

BattleAxeVR commented 1 year ago

Thanks for fixing this, I'll close it.

Aside from SL integration not working with VK (which it does in the SL VK sample so I presume you'll have that sorted soonish), the perf (release + no SL) on my 4090 is quite different from DX12, that's more alarming:

78 fps vulkan 106 fps dx12

fstrugar-nv commented 1 year ago

Hey, thanks for the info! Yes that's actually expected unfortunately, and is almost entirely explained by the lack of SER on Vulkan side at the moment. I get the same 106fps on default scene on 4090, but it's down to 84ish with SER disabled in the UI. So 106->84 is all due to SER, and 84->78 is due to other DX<->Vulkan differences. Good news is that we are working on figuring ou the best path to get SER on Vulkan. Same on SL as you noted it should not be that far off, but I have no specific timeline yet :)

BattleAxeVR commented 1 year ago

Thanks, I thought SER was available on Vulkan already through NV API calls (if you use HLSL -> SPV as your pipeline, that is), but it's ok, I'll wait.