jp7677 / dxvk-nvapi

Alternative NVAPI implementation on top of DXVK.
MIT License
353 stars 32 forks source link

The Last of Us Part 1 needs more functions to be implemented #115

Closed Saancreed closed 1 year ago

Saancreed commented 1 year ago

Well, actually not only that, without wine-nvml in the prefix it does this (logs provided by CME on LGD):

NvAPI_QueryInterface (0xad298d3f): Unknown function ID
DXVK-NVAPI hotfix-tlou-pso-memory (tlou-i.exe)
Successfully acquired Vulkan vkGetInstanceProcAddr @ 0x3b6dc40a0
NvAPI Device: NVIDIA GeForce GTX 1060 6GB (530.30.2)
NvAPI Output: \\.\DISPLAY1
NvAPI Output: \\.\DISPLAY2
NvAPI Output: \\.\DISPLAY3
NvAPI_Initialize: OK
NvAPI_QueryInterface (0x33c7358c): Unknown function ID
NvAPI_QueryInterface (0x593e8644): Unknown function ID
NvAPI_EnumPhysicalGPUs: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_GPU_GetArchInfo: OK
NvAPI_Initialize: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetPCIIdentifiers: OK
NvAPI_GPU_GetArchInfo: OK
NvAPI_GPU_GetGpuCoreCount: No implementation

… and otherwise it does:

NvAPI_QueryInterface (0xad298d3f): Unknown function ID
DXVK-NVAPI hotfix-tlou-pso-memory (tlou-i.exe)
Successfully acquired Vulkan vkGetInstanceProcAddr @ 0x3b6dc40a0
Successfully loaded nvml.dll
NVML loaded and initialized successfully
NvAPI Device: NVIDIA GeForce GTX 1060 6GB (530.30.2)
NvAPI Output: \\.\DISPLAY1
NvAPI Output: \\.\DISPLAY2
NvAPI Output: \\.\DISPLAY3
NvAPI_Initialize: OK
NvAPI_QueryInterface (0x33c7358c): Unknown function ID
NvAPI_QueryInterface (0x593e8644): Unknown function ID
NvAPI_EnumPhysicalGPUs: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_GPU_GetArchInfo: OK
NvAPI_Initialize: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetPCIIdentifiers: OK
NvAPI_GPU_GetArchInfo: OK
NvAPI_GPU_GetGpuCoreCount: OK
NvAPI_GPU_GetPstates20: No implementation

… after which it dies in both cases. That gives us two problems, maybe more if the game tries to call more functions after we fix the one that's causing it to explode now:

  1. It needs NvAPI_GPU_GetPstates20, which we can either fake or try to retrieve from libnvidia-api.so.1 somehow. If the former is enough to satisfy the game, I'd say we could avoid the issues mentioned in the other thread, at least for now.
  2. It needs NvAPI_GPU_GetGpuCoreCount, so either Proton would need to ship wine-nvml or we need to fake a success if NVML can't be used.
jp7677 commented 1 year ago

Could you try nvapi from https://github.com/SveSop/nvidia-libs ? This fork contains https://github.com/SveSop/dxvk-nvapi/commit/c2e0d2d04a11bb402a2815eab50fcc2fcdf1347e so at least we would pass this assertion and could see what happens next.

Saancreed commented 1 year ago

I don't have the game myself so I can't really test that, sorry :disappointed:

We will need someone else for that.

rserpent commented 1 year ago

Could you try nvapi from https://github.com/SveSop/nvidia-libs ? This fork contains SveSop@c2e0d2d so at least we would pass this assertion and could see what happens next.

Game starts, but performance is bad(5fps in main menu)

rserpent commented 1 year ago

Could you try nvapi from https://github.com/SveSop/nvidia-libs ? This fork contains SveSop@c2e0d2d so at least we would pass this assertion and could see what happens next.

Game starts, but performance is bad(5fps in main menu)

After compiling the shaders and enabling DLSS, it is playable.

jp7677 commented 1 year ago

@rserpent thanks for the confirmation, fortunately it is indeed just about those two methods Saancreed mentioned.

Could you please test https://github.com/jp7677/dxvk-nvapi/pull/117 without NVML? You can grab a build from https://github.com/jp7677/dxvk-nvapi/actions/runs/4557328491 This is a minimal implementation which essentially just returns zeros. May be we can get away with something like this, maybe hidden behind a profile since it is pretty bad...

Please also post you logs with this version (DXVK_NVAPI_LOG_LEVEL=info and DXVK_NVAPI_LOG_PATH=/home/user/, but with the log folder of your choice). Thanks.

jp7677 commented 1 year ago

This should now be resolved on master.