Ray Tracing support using the Vulkan RHI (4-27 & 5-0)

Hey there,

I was wondering if there are any plans to support Real Time Ray Tracing using Unreal Engine’s Vulkan RHI, considering that the Vulkan API supports it? As far as I know (though I could be wrong on this), Vulkan is the only way to implement Ray Tracing in games on platforms other than Windows (or Xbox).

P.S. - This goes for Unreal Engine 5 too!

5 Likes

This is definitely something I’d be interested in using, as RTXGI static volumes are not nearly as potent as their dynamic equivalent, and Vulkan is our all-platforms target RHI.

Considering Nvidia posted a tutorial on RayTracing in Vulkan, it may be viable to implement it as a community PR to 5 and potentially even 4?

4 Likes

Actually, looking into the source, it seems VulkanRHI has raytracing support in the ue5-main branch- perhaps it’s possible (or even practical) to backport the changes to the Engine/Source/Runtime/VulkanRHI to 4.27? See git diff --stat origin/release origin/ue5-main -- Engine/Source/Runtime/VulkanRHI/ to see direct changes- but related changes to code outside of that directory may prove more interesting/complicated.

Any commentary from someone more familiar with engine code (maybe an official dev?) would be appreciated on this front.

2 Likes

I am using 5.0.3 on linux and tried a unbounded post process volume to test out ray tracing. There is no discernible change even when we enable the ray tracing (or path tracing) features. Also the official docs state that Windows 10 1809 or later is needed for path tracing.

I also noticed that Vulkan’s ray tracing extensions like VK_KHR_acceleration_structure and VK_KHR_ray_tracing_pipeline are found but are not being used by UE. This was verified by checking the application startup logs. 5.0 release notes mention that Vulkan ray tracing can be enabled by setting console variable r.Vulkan.ExperimentalRayTracing but it doesn’t mention the supported platforms. I am guessing it only works on windows because I couldn’t find that console variable on linux.

Considering all this, is it safe to assume that hardware ray tracing is not supported on linux even in UE 5.0 or UE 5.1?

I’m using 5.1 on linux and there is a console variable called r.Vulkan.RayTracing.

2 Likes

@ezgoin thanks for the info! I will try with 5.1 and see if it works.

If you don’t mind sharing, after setting the console variable r.Vulkan.RayTracing, do you see path tracing as a view mode for the level viewport like the one in the image below?

You’re welcome. Yeah i enabled it and seems to work fine.

I am totally impressed by the performance on linux. It’s twice as fast and so much more responsive.

2 Likes

Thanks for the update! One last thing, do you mind sharing what GPU you are using?

I have a rtx 3060 on debian testing with driver 510.85.02 and the 5.1 source.

1 Like

I can’t get path tracing to work. I’m using Rocky 9 (a RHEL based centOS style distro). I have latest Nvidia drivers and all the correct settings configured. I am using the latest stable UE5 Linux binaries. The path tracing option does appear in my “lit” menu but it just makes the whole scene turn black with no signs of any raytracing noise. It just looks like a raster scene with no lights on. When I re-enable “lit” mode. All the materials are now world materials.

I’ve tried the same settings/projects in Windows 10 and pathtracing works fine using Direct x RHI.

Is this as simple as a missing dependency? or is Vulkan RHI not able to support pathtracing out of the box?

I’m curious to know whether other Linux users have been able to get path tracing to work and if so does anyone know what the missing link is for me?

Same for me . I am using Nobara Linux (Fedora) and it seems that I can’t get the path tracing to work( and some more important things) . I think I tried everything .On the windows side everything works. Currently the only reason I have windows is unreal , basically I am forced to use windows even I feel sick every time I open it. Anyone has a solution how to get path tracing working on Fedora or simply is not supported yet ?

Same here, I am using Arch, I’ve been trying to make this work but I can’t figure out what is missing :frowning:

Just to add to my previous comment.

I believe this is a shader compile issue.

This is what the log says:

LogShaderCompilers: Warning: Failed to compile Material /Game/PhotoStudio/Shared/Materials/Background/M_BGHorizon.M_BGHorizon for platform SF_VULKAN_SM5, Default Material will be used in game.
  Invalid ray tracing shader parameter 'HitGroupSystemIndexBuffer'. Only uniform buffers and loose data parameters are supported.
LogShaderCompilers: Warning: Failed to compile Material /Game/PhotoStudio/Placeables/LightPanel/Assets/M_LightPanel.M_LightPanel for platform SF_VULKAN_SM5, Default Material will be used in game.
  Invalid ray tracing shader parameter 'HitGroupSystemIndexBuffer'. Only uniform buffers and loose data parameters are supported.
LogShaderCompilers: Warning: Failed to compile Material /Game/PhotoStudio/Shared/Materials/Stages/M_Stage.M_Stage for platform SF_VULKAN_SM5, Default Material will be used in game.
  Invalid ray tracing shader parameter 'HitGroupSystemIndexBuffer'. Only uniform buffers and loose data parameters are supported.
LogShaderCompilers: Warning: Failed to compile Material /Game/ConceptCar/Car/Assets/M_CarPaint.M_CarPaint for platform SF_VULKAN_SM5, Default Material will be used in game.
  Invalid ray tracing shader parameter 'HitGroupSystemIndexBuffer'. Only uniform buffers and loose data parameters are supported.
LogShaderCompilers: Warning: Failed to compile Material /Game/ConceptCar/Car/Assets/M_TireRubber.M_TireRubber for platform SF_VULKAN_SM5, Default Material will be used in game.
  Invalid ray tracing shader parameter 'HitGroupSystemIndexBuffer'. Only uniform buffers and loose data parameters are supported.
LogShaderCompilers: Warning: Failed to compile Material /Game/ConceptCar/Car/Assets/M_Metal.M_Metal for platform SF_VULKAN_SM5, Default Material will be used in game.
  Invalid ray tracing shader parameter 'HitGroupSystemIndexBuffer'. Only uniform buffers and loose data parameters are supported.
LogShaderCompilers: Warning: Failed to compile Material /Game/ConceptCar/Car/Assets/M_Glass.M_Glass for platform SF_VULKAN_SM5, Default Material will be used in game.
  Invalid ray tracing shader parameter 'HitGroupSystemIndexBuffer'. Only uniform buffers and loose data parameters are supported.



I have checked the console variable and it is set to “1” as default.

I also have all the correct project settings active.

Please can someone help me understand what is missing? Is there a certain package that needs to be installed? or is this a limitation in editor? the most recent version of UE5 I have tried is 5.2. But I have also tried 5.0 and 5.1.

Those who commented back in late 2022. Is path tracing still working for you in the latest builds of UE 5?

Better yet can some one from Epic confirm what the situation is regarding pathtracing on Linux?



1 Like

I come from this thread: Cast raytraced shadows and vulkan/linux

Late, but I’ve waited for bookworm.
Now I have a clean install of Debian 12 with the repo nvidia driver (525) and the UE5.2.1 downloaded by the ue site.

I check all the parameters mentioned in this thread, you can find in the screenshots.

As stated by @focalcgi there’s a clear warning message, complaining the failing of the compilation of the material for the platform VULKAN_SM5.

Is it the problem that creates those horrible shadows?

Any idea on how to proceed?

An other note, if I click on “Path tracing debug” and I choose an option what I see it’s a black screen, same problem I suppose.

Hi.

Looks like those “horrible shadows” were fixed in the 5.3.0-preview1.

On the 5.3.1 I’ve tested also VULKAN_SM6 and Path Tracing is still not working properly. It’s easy to test even on the “clean” new UE project.

There are requirements for the Windows on the Path Tracer page Path Tracer in Unreal Engine | Unreal Engine 5.3 Documentation but still the option is available on the Linux.

There are few mentions about “HitGroupSystemIndexBuffer” in the UE source but that didn’t bring me closer to solving that puzzle.

Looks like Material shaders should get compiler for the path tracer (ray tracer? they have partially shared code) but since the “invalid parameter” HitGroupSystemIndexBuffer appears, then the shaders cannot be compiled and Material is replaced by the default one (if the default one is defined and can be compiled) or empty one. Then this scene is pushed to the Path Tracer which traces “nothing”.

It’s very probable the Path Tracing is working but the Vulkan shader compilation is somehow broken.

I can confirm, that the problem with the “horrible shadows” seems to be resolved, 5.3.1. version.
Sorry for the horrible (again) image, but it was a fast test.
I haven’t done other and deep investigation for the moment.