PotatoOfDoom / CyberFSR2

FidelityFx Super Resolution 2.0 for Cyberpunk
MIT License
620 stars 67 forks source link

Working with UE4 games? #14

Closed TheRazerMD closed 7 months ago

TheRazerMD commented 2 years ago

Anyone tried modifying it for any UE4 game? Tried using the DL2 version that worked on other games (like Metro Exodus and Guardians) but no luck so far (tried on Deep Rock Galactic and Ready or Not). Might be a problem regarding the typical UE4 folder structuring - the DLSS dll is hidden behind atleast 3 or 4 subfolders from the game exe. Tried symlinks and hard links, but no dice.

nikviktorovich commented 2 years ago

I believe, both of these games use DirectX 11 (as per System Requirements section in the according Steam pages), while this project atm works with DirectX 12

TheRazerMD commented 2 years ago

Both games have DX11 and DX12 as a launch option, so that part should not be the problem.

xv0t commented 2 years ago

A shot in the dark since I have no idea if this mod allows for renaming, but I tried it on Chorus by forcing dynamic link library redirection and using a .dll name the game attempts to load (taken via Process Monitor with a NAME NOT FOUND filter). I also copied nvidia's nvngx_dlss.dll next to the executable for good measure. Unfortunately the game crashes upon launching with this message:

The procedure entry point timeEndPeriod could not be located in the dynamic link library executable location

edit: managed to have the game launch with the .dll loaded using an injection tool, still, no DLSS option shows up. image Using the Game Pass version, you can now inject and use wrappers in most single player games.

ronoverdrive commented 2 years ago

I have not gotten it to work with any Unreal Engine based games, but by the same token most of them were also equipped with EAC which most likely complicated things further.

TheRazerMD commented 2 years ago

@xv0t probably has some special GPU checks that need patching out

@ronoverdrive yeah, that’s why I mentioned the 2 games above. DRG and RoN, for example, don’t have EAC to complicate things.

nikviktorovich commented 2 years ago

I kinda managed to activate the DLSS option in Deep Rock Galactic, but for me it gives a lot of visual glitches. But anyway, I had to place JMP (0xEB) at 0xEC4DBF to skip GPU check (corresponds to "else if (!IsRHIDeviceNVIDIA())" line in the plugin source code, particularly in file "DLSS.cpp").

EDIT: In other UE games I believe it can be easily found by searching for reference to string NVIDIA NGX DLSS requires an NVIDIA RTX series graphics card cause the code for this section looks like:

...
else if (!IsRHIDeviceNVIDIA())
{
    UE_LOG(LogDLSS, Log, TEXT("NVIDIA NGX DLSS requires an NVIDIA RTX series graphics card"));
    DLSSSupport = EDLSSSupport::NotSupportedIncompatibleHardware;
}
...
TheRazerMD commented 2 years ago

@lnfecteDru Great work! Yeah, there were mentions of that string in the Discord server, found being mentioned in the DLSS Programming guide and then later while randomly searching interesting strings.

Also an interesting thing that may or may not be useful. After the latest commits regarding UE compatibility, I tried the DXVK+VKD3D meme spoof to RTX 3080 on my RX580 again. And now, there were no driver version error dialogue, and the DLSS option actually got exposed and it's working. Well, "working" as its got visual artifacts everywhere, as you've mentioned.

@PotatoOfDoom mentioned you'd have to play around with FoV and Depth values to get it working better, Also mentioned the common UE4/5 depth values are: NearPlane: 10.0 FarPlane: 1010.0

nikviktorovich commented 2 years ago

For Ghostwire this works as well even though it was a bit harder to find, cause there were no such string. The address is 0x12C3FDB where 6 bytes need to be replaced with NOPs. The game has visual glitches too, but different ones.

TheRazerMD commented 2 years ago

Could you show me a screen of the Ghostwire address? I'm trying to look for it in Ready or Not, but it also doesn't have this string. Neither does Chivalry 2. Actually, seems like Chiv 2 doesn't need GPU Check patching, but EAC is there, so don't recommend using online.

nikviktorovich commented 2 years ago

Could you show me a screen of the Ghostwire address? I'm trying to look for it in Ready or Not, but it also doesn't have this string. Neither does Chivalry 2.

Sure, here it is! ghostwire_assembly

I was searching for this particular section:

...
else if (!bLoadLibraries)
{
    UE_LOG(LogDLSS, Log, TEXT("NVIDIA NGX library loading has been disabled with r.NGX.Enable=0"));
    DLSSSupport = EDLSSSupport::NotSupported;
}
else
{
    // This one
    const bool bIsDX12 = (RHIName == TEXT("D3D12")) && GetDefault<UDLSSSettings>()->bEnableDLSSD3D12;
    const bool bIsDX11 = (RHIName == TEXT("D3D11")) && GetDefault<UDLSSSettings>()->bEnableDLSSD3D11;
    const bool bIsVulkan = (RHIName == TEXT("Vulkan")) && GetDefault<UDLSSSettings>()->bEnableDLSSVulkan;
...

Even though there are no log strings in Ghostwire, there are still strings "D3D12", "D3D11" and "Vulkan". And I was looking for jumps to this section.

nikviktorovich commented 2 years ago

In case of Ready or Not - the address is 0xABDBBF where you need to replace 1 byte with 0xEB (which is JMP). I'll attach a screenshot of the debugger later.

EDIT: This is how it looks for Ready or Not. The selected instruction has to be replaced with JMP image

TheRazerMD commented 2 years ago

@lnfecteDru You won't believe it, but I actually managed to patch it myself! Saw your screen regarding D3D12, found it, tried the JNE to JMP and managed to bypass it. Then I came here, and saw you already posted the screenshot XD

Thanks for all the help. Will try it on other UE4 games too.

TheRazerMD commented 2 years ago

Managed to find it for The Ascent too!

Change JNE to JMP on RVA 0xF95596 and it should work.

Screenshot_1

This is how it originally looks like

Edit: Main Menu works fine, but in-game it's flashing white and artifacts

TheRazerMD commented 2 years ago

@lnfecteDru here's an interesting find. It seems CyberFSR2 does work with some UE4 games.

Hellblade Enhanced and Chivalry 2 (bypassed EAC launch and tried on offline mode) are both UE4 games and have no GPU check. And it works just fine with both games, no artifacting. But other UE4 games with RTX/GPU Checks still keep on artifacting. Interesting, to say the least.

Hellblade Enhanced Chivalry 2

nikviktorovich commented 2 years ago

@lnfecteDru here's an interesting find. It seems CyberFSR2 does work with some UE4 games.

Hellblade Enhanced and Chivalry 2 (bypassed EAC launch and tried on offline mode) are both UE4 games and have no GPU check. And it works just fine with both games, no artifacting. But other UE4 games with RTX/GPU Checks still keep on artifacting. Interesting, to say the least.

Hellblade Enhanced Chivalry 2

Interesting indeed, I'll have a look, thank you.

nikviktorovich commented 2 years ago

Looks like disabling dilated motion vectors (r.NGX.DLSS.DilateMotionVectors 0) fixes the strange ghosting-like artifacts. Blinks, however, are still there.

EDIT: Also, there is no blinking in Vulkan build (dilated motion vectors still need to be disabled), but most of the discussed games (or even all of them) do not support Vulkan.

EDIT 2: In DRG dilated motion vectors can be disabled by patching 0x641E58 with 00, which changes default value of the flag to 0.

TheRazerMD commented 2 years ago

@lnfecteDru Going by Discord, that option fixed the ghosting for both Ghostrunner and Chorus. But now comes the fun part. The tester trying it out for Ghostrunner has a Pascal GPU (1050Ti), did not need GPU Check bypass (I suspect it requires only Nvidia GPU, not RTX, despite the in-game note saying RTX lol), mod works great after using that command. Meanwhile, I tried my RX580 - needed to bypass the GPU check - DLSS option exposed - artifacting like crazy, even with the command.

The Ascent on 1660Ti apparently also works fine, even with the required GPU Check bypass - meanwhile it artifacts on Radeon as usual.

Seems to me Radeon isn't getting parsed correct data when the GPU Check is present in UE4, for whatever reason.

EDIT: Same confirmation for The Ascent. The above command makes the ghosting gone on 1050Ti.

nikviktorovich commented 2 years ago

Also, CVars may be applied by putting it in Engine.ini (idk tho if section name or ini-file matter):

[SystemSettings]
r.NGX.DLSS.DilateMotionVectors=0

So there's no really need to patch it.

About the glitch part, probably there are some nvidia driver calls. I'll try to find something.

TheRazerMD commented 2 years ago

Forgot to mention in the last comment, but yes, pretty sure there's no need for patching as adding the command to Engine.ini should make it work everywhere.

(idk tho if section name or ini-file matter)

ini files matter for UE4, so it will only work if you put that whole command (with the SystemSettings part too) specifically in Engine.ini in WindowsNoEditor folder where the game config files are located

nikviktorovich commented 2 years ago

r.SceneColorFormat=5 fixed the artifacts for me. Can anybody check it as well?

TheRazerMD commented 2 years ago

Give me a few mins and I can check it out.

TheRazerMD commented 2 years ago

@lnfecteDru you absolute madlad, it's fixed! No more annoying artifacts! Tried it out on Ready or Not.

EDIT: Seems like majority of the artifacts are gone, however still some reside. Will need to test it out more!

Ready or Not_2022 08 18-15 42

Ready or Not_2022 08 18-15 42_1

You can notice these minor artifacts on reflective surfaces, especially on this glass

EDIT2: Works also for Deep Rock Galactic

TheRazerMD commented 2 years ago

@lnfecteDru Potato on Discord:

"sry I am super busy rn. the ue4 fix you guys found seems to be caused by a bug in fsr 2: https://github.com/GPUOpen-Effects/FidelityFX-FSR2/issues/39 (Probably already fixed in the internal tree 🙄). I'll add the fix to my fsr2 fork as soon as I have access to a pc again"

EDIT: Also a tester from Discord mentions that the r.scenecolorformat command did not fix the artifacting on RDNA2

nikviktorovich commented 2 years ago

@lnfecteDru Potato on Discord:

"sry I am super busy rn. the ue4 fix you guys found seems to be caused by a bug in fsr 2: GPUOpen-Effects/FidelityFX-FSR2#39 (Probably already fixed in the internal tree 🙄). I'll add the fix to my fsr2 fork as soon as I have access to a pc again"

Not really sure if it will help in this case, cause it looks like motion vector scale, sent by the engine, is equal to 1 regardless of settings: image

EDIT: Probably, MVScale should be initialized in CreateFeature function, cause according to plugin source code, if I get it right, the parameter is just passed around:

DlssEvalParams.InMVScaleX = InArguments.MotionVectorScale.X;
DlssEvalParams.InMVScaleY = InArguments.MotionVectorScale.Y;
dispatchParameters.motionVectorScale.x = (float)inParams->MVScaleX;
dispatchParameters.motionVectorScale.y = (float)inParams->MVScaleY;

But I believe that's related only to the 'ghosting-like' artifacts, which is still great and probably will increase the resulting image quality

EDIT 2: Probably, the reason of the blinking artifacts may be fixed as well: https://github.com/GPUOpen-Effects/FidelityFX-FSR2/pull/26

oscarbg commented 2 years ago

Hi, are someone interested in fixing the UE5 5.1 City demo (with DLSS support)?.. @lnfecteDru @TheRazerMD ? https://www.dsogaming.com/news/the-matrix-awakens-megacity-unreal-engine-5-1-available-for-download/ download this UE5.1 demo: https://drive.google.com/file/d/1eQ_Oav8pxMJ-55qwwyRurjS_dyKgFGqZ/view seems have some checks.. log:

[2022.08.27-05.35.35:282][  0]LogDLSS: FDLSSModule::StartupModule Enter
[2022.08.27-05.35.35:282][  0]LogDLSS: PluginBaseDir ../../../CitySample/Plugins/DLSS
[2022.08.27-05.35.35:302][  0]LogDLSS: NGXBinariesDir ../../../CitySample/Plugins/DLSS/Binaries/ThirdParty/Win64/
[2022.08.27-05.35.35:303][  0]LogDLSS: GDynamicRHIName NVIDIA D3D12
[2022.08.27-05.35.35:313][  0]LogDLSS: Plugin settings: NGXAppId = 0
[2022.08.27-05.35.35:317][  0]LogDLSS: Warning: NGX Application ID not specified, using the Project ID by default.
[2022.08.27-05.35.35:319][  0]LogDLSSNGXRHI: FNGXRHIModule::StartupModule Enter
[2022.08.27-05.35.35:321][  0]LogDLSSNGXRHI: FNGXRHIModule::StartupModule Leave
[2022.08.27-05.35.35:327][  0]LogDLSSNGXRHI: Searching for custom and generic DLSS binaries
[2022.08.27-05.35.35:328][  0]LogDLSSNGXRHI: NVIDIA NGX DLSS binary nvngx_dlss.dll not found in search path E:\a4\CitySample_51_DLSS_Cinematic\CitySample\Binaries\ThirdParty\NVIDIA\NGX\Win64\
[2022.08.27-05.35.35:329][  0]LogDLSSNGXRHI: NVIDIA NGX DLSS binary nvngx_dlss.dll not found in search path E:\a4\CitySample_51_DLSS_Cinematic\CitySample\Binaries\Win64\Binaries\ThirdParty\NVIDIA\NGX\Win64\
[2022.08.27-05.35.35:330][  0]LogDLSSNGXRHI: NVIDIA NGX DLSS binary nvngx_dlss.dll found in search path E:\a4\CitySample_51_DLSS_Cinematic\CitySample\Plugins\DLSS\Binaries\ThirdParty\Win64\
[2022.08.27-05.35.35:332][  0]LogDLSSNGX: [SDK]: [2022-08-27 07:35:35] [NGXSafeInitializeLog:130] App logging hooks successfully initialized
[2022.08.27-05.35.35:346][  0]LogDLSSNGX: [SDK]: [2022-08-27 07:35:35] [NGXGetPathUsingQAI:127] Path to driverStore found using QAI: C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_800c5375bcee0134
[2022.08.27-05.35.35:883][  0]LogDLSSNGX: [Core]: [2022-08-27 07:35:35] [NGXSafeInitializeLog:130] App logging hooks successfully initialized
[2022.08.27-05.35.35:996][  0]LogDLSSNGX: [Core]: [2022-08-27 07:35:35] [NGXCheckHardwareSupportUsingINF:212] error: unsupported hardware detected
[2022.08.27-05.35.36:002][  0]LogDLSSNGXD3D12RHI: NVSDK_NGX_D3D12_Init_with_ProjectID(ProjectID = 914301364FA2BD41AB81DA86AC490783, EngineVersion=5.1, APIVersion = 0x14, Device=0000012D6C4A1040) -> (3134193665 NVSDK_NGX_Result_FAIL_FeatureNotSupported)
[2022.08.27-05.35.36:086][  0]LogDLSSNGX: [Core]: [2022-08-27 07:35:36] [NGXCheckHardwareSupportUsingINF:212] error: unsupported hardware detected
[2022.08.27-05.35.36:106][  0]LogDLSSNGXD3D12RHI: NVSDK_NGX_D3D12_Init_with_ProjectID(ProjectID = 914301364FA2BD41AB81DA86AC490783, EngineVersion=5.1, APIVersion = 0x13, Device=0000012D6C4A1040) -> (3134193665 NVSDK_NGX_Result_FAIL_FeatureNotSupported)
[2022.08.27-05.35.36:111][  0]LogDLSSNGXD3D12RHI: NVSDK_NGX_D3D12_Init (Log C:/Users/rtfss/AppData/Local/CitySample/Saved/Logs/NGX/NGX_2022.08.27-07.35.35_478E6EB7483B6E0FFCA9559322110D8C) -> (3134193665 NVSDK_NGX_Result_FAIL_FeatureNotSupported)
[2022.08.27-05.35.36:113][  0]LogDLSS: DLSS not supported by the NVIDIA D3D12 RHI in the NGXD3D12RHI module at runtime
[2022.08.27-05.35.36:113][  0]LogDLSS: NVIDIA NGX DLSS supported 0
[2022.08.27-05.35.36:114][  0]LogDLSS: FDLSSModule::StartupModule Leave
nikviktorovich commented 2 years ago

Hi, are someone interested in fixing the UE5 5.1 City demo (with DLSS support)?.. @lnfecteDru @TheRazerMD ? https://www.dsogaming.com/news/the-matrix-awakens-megacity-unreal-engine-5-1-available-for-download/ download this UE5.1 demo: https://drive.google.com/file/d/1eQ_Oav8pxMJ-55qwwyRurjS_dyKgFGqZ/view seems have some checks.. log:

[2022.08.27-05.35.35:282][  0]LogDLSS: FDLSSModule::StartupModule Enter
[2022.08.27-05.35.35:282][  0]LogDLSS: PluginBaseDir ../../../CitySample/Plugins/DLSS
[2022.08.27-05.35.35:302][  0]LogDLSS: NGXBinariesDir ../../../CitySample/Plugins/DLSS/Binaries/ThirdParty/Win64/
[2022.08.27-05.35.35:303][  0]LogDLSS: GDynamicRHIName NVIDIA D3D12
[2022.08.27-05.35.35:313][  0]LogDLSS: Plugin settings: NGXAppId = 0
[2022.08.27-05.35.35:317][  0]LogDLSS: Warning: NGX Application ID not specified, using the Project ID by default.
[2022.08.27-05.35.35:319][  0]LogDLSSNGXRHI: FNGXRHIModule::StartupModule Enter
[2022.08.27-05.35.35:321][  0]LogDLSSNGXRHI: FNGXRHIModule::StartupModule Leave
[2022.08.27-05.35.35:327][  0]LogDLSSNGXRHI: Searching for custom and generic DLSS binaries
[2022.08.27-05.35.35:328][  0]LogDLSSNGXRHI: NVIDIA NGX DLSS binary nvngx_dlss.dll not found in search path E:\a4\CitySample_51_DLSS_Cinematic\CitySample\Binaries\ThirdParty\NVIDIA\NGX\Win64\
[2022.08.27-05.35.35:329][  0]LogDLSSNGXRHI: NVIDIA NGX DLSS binary nvngx_dlss.dll not found in search path E:\a4\CitySample_51_DLSS_Cinematic\CitySample\Binaries\Win64\Binaries\ThirdParty\NVIDIA\NGX\Win64\
[2022.08.27-05.35.35:330][  0]LogDLSSNGXRHI: NVIDIA NGX DLSS binary nvngx_dlss.dll found in search path E:\a4\CitySample_51_DLSS_Cinematic\CitySample\Plugins\DLSS\Binaries\ThirdParty\Win64\
[2022.08.27-05.35.35:332][  0]LogDLSSNGX: [SDK]: [2022-08-27 07:35:35] [NGXSafeInitializeLog:130] App logging hooks successfully initialized
[2022.08.27-05.35.35:346][  0]LogDLSSNGX: [SDK]: [2022-08-27 07:35:35] [NGXGetPathUsingQAI:127] Path to driverStore found using QAI: C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_800c5375bcee0134
[2022.08.27-05.35.35:883][  0]LogDLSSNGX: [Core]: [2022-08-27 07:35:35] [NGXSafeInitializeLog:130] App logging hooks successfully initialized
[2022.08.27-05.35.35:996][  0]LogDLSSNGX: [Core]: [2022-08-27 07:35:35] [NGXCheckHardwareSupportUsingINF:212] error: unsupported hardware detected
[2022.08.27-05.35.36:002][  0]LogDLSSNGXD3D12RHI: NVSDK_NGX_D3D12_Init_with_ProjectID(ProjectID = 914301364FA2BD41AB81DA86AC490783, EngineVersion=5.1, APIVersion = 0x14, Device=0000012D6C4A1040) -> (3134193665 NVSDK_NGX_Result_FAIL_FeatureNotSupported)
[2022.08.27-05.35.36:086][  0]LogDLSSNGX: [Core]: [2022-08-27 07:35:36] [NGXCheckHardwareSupportUsingINF:212] error: unsupported hardware detected
[2022.08.27-05.35.36:106][  0]LogDLSSNGXD3D12RHI: NVSDK_NGX_D3D12_Init_with_ProjectID(ProjectID = 914301364FA2BD41AB81DA86AC490783, EngineVersion=5.1, APIVersion = 0x13, Device=0000012D6C4A1040) -> (3134193665 NVSDK_NGX_Result_FAIL_FeatureNotSupported)
[2022.08.27-05.35.36:111][  0]LogDLSSNGXD3D12RHI: NVSDK_NGX_D3D12_Init (Log C:/Users/rtfss/AppData/Local/CitySample/Saved/Logs/NGX/NGX_2022.08.27-07.35.35_478E6EB7483B6E0FFCA9559322110D8C) -> (3134193665 NVSDK_NGX_Result_FAIL_FeatureNotSupported)
[2022.08.27-05.35.36:113][  0]LogDLSS: DLSS not supported by the NVIDIA D3D12 RHI in the NGXD3D12RHI module at runtime
[2022.08.27-05.35.36:113][  0]LogDLSS: NVIDIA NGX DLSS supported 0
[2022.08.27-05.35.36:114][  0]LogDLSS: FDLSSModule::StartupModule Leave

From what I see in the plugin source code, the DLSS loading procedure is the same as in UE4 (I'll check it later in game). According to the log, the game is trying to load nvngx_dlss.dll instead of nvngx.dll, are you sure you activated EnableSignatureOverride.reg?

EDIT: Yes, loading is the same, you need to patch 0x1EF899E with EB (which is JMP instruction). But I have different artifacts here. It would be harder to debug though since the DLSS version is compiled in Shipping configuration, which doesn't have a developer console.

EDIT 2: Artifacts were produced by TSR and not by DLSS (I forgot to patch it). The DLSS ones may be fixed by r.NGX.DLSS.DilateMotionVectors=0:

[SystemSettings]
r.NGX.DLSS.DilateMotionVectors=0

EDIT 3: There are some awful artifacts present when looking in the sky

MOVZX commented 2 years ago

This UE5 Demo is torture

R9 5950X + RX 6800 XT

Ultra Settings

image

Upscaling: OFF

image

Upscaling: Ultra Quality

image

Upscaling: Quality

image

Upscaling: Balanced

image

Upscaling: Performance

image

Upscaling: Ultra Performance

image

oscarbg commented 2 years ago

@lnfecteDru thanks for looking into it..

in the meanwhile I also was able to fix it also by changing: E8 04 D7 C4 01 84 C0 75 2D E8 04 D7 C4 01 84 C0 74 2D so changed jne with je, fix it for me but then remember a complete fix is change with jmp instruction inconditionally..

this fixes the IsRHIDeviceNVIDIA(void) in DLSS.. but then as I have a system with NV and AMD GPU even if I disable the NV card from device manager seems the DLSS static libraries linked into exe search for Nvidia installed drivers on Driverstore folder and use this _nvngx.dll breaking DLSS support.. the UNIQUE way to fix this is by putting cyberfsr2 nvngx.dll in the game folder "CitySample_51_DLSS_Cinematic\CitySample\Binaries\Win64" seems Nvidia left a way for users to use update nvngx.dll by putting in game exe folder NOT in thirdparty (CitySample_51_DLSS_Cinematic\CitySample\Plugins\DLSS\Binaries\ThirdParty\Win64) this is important!! this may be required by people also with old NV GPUs not supporting DLSS as they have a NV driver installed..

this is how it go with the patch but ends searching in driver folder _nvngx.dll:

LogDLSS: FDLSSModule::StartupModule Enter
[2022.08.27-06.33.47:748][  0]LogDLSS: PluginBaseDir ../../../CitySample/Plugins/DLSS
[2022.08.27-06.33.47:748][  0]LogDLSS: NGXBinariesDir ../../../CitySample/Plugins/DLSS/Binaries/ThirdParty/Win64/
[2022.08.27-06.33.47:748][  0]LogDLSS: GDynamicRHIName AMD D3D12
[2022.08.27-06.33.47:750][  0]LogDLSS: Plugin settings: NGXAppId = 0
[2022.08.27-06.33.47:750][  0]LogDLSS: Warning: NGX Application ID not specified, using the Project ID by default.
[2022.08.27-06.33.47:751][  0]LogDLSSNGXRHI: FNGXRHIModule::StartupModule Enter
[2022.08.27-06.33.47:751][  0]LogDLSSNGXRHI: FNGXRHIModule::StartupModule Leave
[2022.08.27-06.33.47:752][  0]LogDLSSNGXRHI: Searching for custom and generic DLSS binaries
[2022.08.27-06.33.47:757][  0]LogDLSSNGXRHI: NVIDIA NGX DLSS binary nvngx_dlss.dll not found in search path E:\a4\CitySample_51_DLSS_Cinematic\CitySample\Binaries\ThirdParty\NVIDIA\NGX\Win64\
[2022.08.27-06.33.47:757][  0]LogDLSSNGXRHI: NVIDIA NGX DLSS binary nvngx_dlss.dll not found in search path E:\a4\CitySample_51_DLSS_Cinematic\CitySample\Binaries\Win64\Binaries\ThirdParty\NVIDIA\NGX\Win64\
[2022.08.27-06.33.47:758][  0]LogDLSSNGXRHI: NVIDIA NGX DLSS binary nvngx_dlss.dll found in search path E:\a4\CitySample_51_DLSS_Cinematic\CitySample\Plugins\DLSS\Binaries\ThirdParty\Win64\
[2022.08.27-06.33.47:758][  0]LogDLSSNGX: [SDK]: [2022-08-27 08:33:47] [NGXSafeInitializeLog:130] App logging hooks successfully initialized
'CitySample-Win64-Shipping.exe' (Win32): 'C:\Windows\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_800c5375bcee0134\_nvngx.dll' cargado. 
'CitySample-Win64-Shipping.exe' (Win32): 'C:\Windows\System32\drvstore.dll' cargado. 
'CitySample-Win64-Shipping.exe' (Win32): 'C:\Windows\System32\wldp.dll' cargado. 
'CitySample-Win64-Shipping.exe' (Win32): 'C:\Windows\System32\nvapi64.dll' cargado. 
'CitySample-Win64-Shipping.exe' (Win32): 'C:\Windows\System32\nvapi64.dll' descargado
[2022.08.27-06.33.47:788][  0]LogDLSSNGX: [Core]: [2022-08-27 08:33:47] [NGXSafeInitializeLog:130] App logging hooks successfully initialized
'CitySample-Win64-Shipping.exe' (Win32): 'C:\Windows\System32\nvapi64.dll' cargado. 
'CitySample-Win64-Shipping.exe' (Win32): 'C:\Windows\System32\nvapi64.dll' descargado
[2022.08.27-06.33.47:796][  0]LogDLSSNGX: [Core]: [2022-08-27 08:33:47] [NGXCheckHardwareSupportUsingINF:134] error: unable to enumerate physical gpus
[2022.08.27-06.33.47:796][  0]LogDLSSNGXD3D12RHI: NVSDK_NGX_D3D12_Init_with_ProjectID(ProjectID = 914301364FA2BD41AB81DA86AC490783, EngineVersion=5.1, APIVersion = 0x14, Device=0000018C0D4D7F90) -> (3134193665 NVSDK_NGX_Result_FAIL_FeatureNotSupported)
'CitySample-Win64-Shipping.exe' (Win32): 'C:\Windows\System32\nvapi64.dll' cargado. 
'CitySample-Win64-Shipping.exe' (Win32): 'C:\Windows\System32\nvapi64.dll' descargado
'CitySample-Win64-Shipping.exe' (Win32): 'C:\Windows\System32\nvapi64.dll' cargado. 
'CitySample-Win64-Shipping.exe' (Win32): 'C:\Windows\System32\nvapi64.dll' descargado
[2022.08.27-06.33.47:818][  0]LogDLSSNGX: [Core]: [2022-08-27 08:33:47] [NGXCheckHardwareSupportUsingINF:134] error: unable to enumerate physical gpus
LogInit: Display: Starting Game.
[2022.08.27-06.36.32:513][  0]LogDLSSNGXD3D12RHI: NVSDK_NGX_D3D12_Init_with_ProjectID(ProjectID = 914301364FA2BD41AB81DA86AC490783, EngineVersion=5.1, APIVersion = 0x13, Device=0000018C0D4D7F90) -> (3134193665 NVSDK_NGX_Result_FAIL_FeatureNotSupported)
[2022.08.27-06.36.49:328][  0]LogDLSSNGXD3D12RHI: NVSDK_NGX_D3D12_Init (Log C:/Users/rtfss/AppData/Local/CitySample/Saved/Logs/NGX/NGX_2022.08.27-08.33.47_1CD0AF85472B33EB18BE31811AC98A57) -> (3134193665 NVSDK_NGX_Result_FAIL_FeatureNotSupported)
El subproceso 0x3dd0 terminó con código 0 (0x0).
[2022.08.27-06.36.49:329][  0]LogDLSS: DLSS not supported by the AMD D3D12 RHI in the NGXD3D12RHI module at runtime
[2022.08.27-06.36.49:330][  0]LogDLSS: NVIDIA NGX DLSS supported 0
[2022.08.27-06.36.49:330][  0]LogDLSS: FDLSSModule::StartupModule Leave
[2022.08.27-06.36.49:330][  0]LogInit: Display: Starting Game.
oscarbg commented 2 years ago

Hi,

even this is a issue about DLSS let me talk about UE5 D3D12 render issues on AMD cards..

in fact I make a BIG CLAIM: using this DLSS hacked support right now is a MUST for running UE5 content rendered correctly on AMD GPUs (at least currently)..

I mean using D3D12 and also authored to use SM6 backed (needed for Lumen anyway?).. this demo is an example of a UE5 D3D12 SM6 only compiled demo.. i.e. forcing -d3d11 or -sm5 demo will not run..

the example is @MOVZX (Upscaling: OFF) screenshoot (so no DLSS).. I had similar issues with RX Vega but RDNA2 also affected so seems all AMD cards affected.. hope is a driver issue..

@MOVZX have you noticed running the demo without DLSS enabled, (your Upscaling: OFF screenshot), has rendering issues, big "pixelation" effects, even tough it should be better than or equal to DLSS ultra quality, right? notice especially around the girl you control.. before hacking DLSS support, I had noticed that running on RX Vega D3D12, and thinked it was a Vega HW issue, or some driver issue.. I see now RDNA2 cards are also affected which is sad.. also noticed that running under VKD3D on Linux under RADV the issues aren't present.. (might require running with -novendordevice) under Windows VKD3D for AMD also needs a hack for enabling SM6.6 support because of missing NV_compute_derivatives.. but even then AMD Windows Vulkan driver +VKD3D doesn't boot the demo..

seems old NV hardware without DLSS has no rendering artifacts under D3D12 SM6(.6) mode..

would be nice to see with Intel DG2 hardware like A380 if this demo without DLSS has rendering issues..

RareMv commented 2 years ago

Tested another Unreal 4 game: Observer System Redux

FSR 2.1.1 from the CB77 Nexus mod works like a native implementation (version 0.8.0-beta2). Boosted performance with ZERO perceived image quality loss. Zero artefacting or ghosting. 10/10 implementation.

MOVZX commented 2 years ago

Tested another Unreal 4 game: Observer System Redux

FSR 2.1.1 from the CB77 Nexus mod works like a native implementation (version 0.8.0-beta2). Boosted performance with ZERO perceived image quality loss. Zero artefacting or ghosting. 10/10 implementation.

Look at this comparison images

NATIVE FSR 2.0

image

CyberFSR 0.8.0-beta2 (FSR 2.1.1)

image

It's a day and night difference, game is Deep Rock Galactic.

paulober commented 1 year ago

Has anyone here tried it with The Ascent (also UE4 and does only support DLSS2)?

spajdrEX commented 1 year ago

Has anyone here tried it with The Ascent (also UE4 and does only support DLSS2)?

It does work as long you use 0.8.0 beta 2. But there will be ghosting/smearing.

ishitatsuyuki commented 9 months ago

If you're wondering why the SceneColorFormat hack is needed, it's because some (or all?) versions of DLSS UE plugin has a bug where the InputColor buffer is in the wrong resource state (D3D12_RESOURCE_STATE_RENDER_TARGET). AMD hardware applies compression that are incompatible with SRV use, and using SceneColorFormat=5 works only because F32 is not compressed at all. It also comes at a performance cost.

It might be worth trying injecting a transition to D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE before FSR dispatch, then after the dispatch transition it back to D3D12_RESOURCE_STATE_RENDER_TARGET so that the engine don't get confused.