Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvapi-gpu: Fake several NVML related methods #117

Merged
merged 2 commits into from
Mar 29, 2023
Merged

nvapi-gpu: Fake several NVML related methods #117

merged 2 commits into from
Mar 29, 2023

Conversation

jp7677
Copy link
Owner

@jp7677 jp7677 commented Mar 29, 2023

Lets see how we get away for The Last Of Us...

Return OK for GetGpuCoreCount, GetAllClockFrequencies and GetPstates20 when detecting The Last of Us part 1. Otherwise this title wont start.

@jp7677 jp7677 changed the title nvapi-gpu: WIP nvapi-gpu: Fake GetGpuCoreCount and GetPstates20 Mar 29, 2023
@jp7677 jp7677 marked this pull request as ready for review March 29, 2023 17:17
@jp7677 jp7677 marked this pull request as draft March 29, 2023 17:18
@jp7677 jp7677 changed the title nvapi-gpu: Fake GetGpuCoreCount and GetPstates20 nvapi-gpu: Fake several NVML related methods Mar 29, 2023
@jp7677
Copy link
Owner Author

jp7677 commented Mar 29, 2023

For reference:

---------- 2023-03-29 20:38:14 ----------
NvAPI_QueryInterface (0xad298d3f): Unknown function ID
DXVK-NVAPI v0.6.2-14-gb672395 (tlou-i.exe)
Successfully acquired Vulkan vkGetInstanceProcAddr @ 0x3b6dc40a0
NvAPI Device: NVIDIA GeForce RTX 2080 (525.47.15)
NvAPI Output: \\.\DISPLAY1
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: OK
NvAPI_GPU_GetAllClockFrequencies: OK
NvAPI_QueryInterface NvAPI_GPU_GetMemoryInfoEx: Not implemented method
NvAPI_Initialize: OK
NvAPI_DRS_CreateSession: OK
NvAPI_DRS_LoadSettings: OK
NvAPI_DRS_GetBaseProfile: OK
NvAPI_DRS_GetSetting (0x10afb76b/Unknown): Setting not found
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetAdapterIdFromPhysicalGpu: OK
NvAPI_DRS_GetSetting (0x10e41df2/Unknown): Setting not found
NvAPI_QueryInterface (0xf2400ab): Unknown function ID
NvAPI_EnumPhysicalGPUs: OK
NvAPI_DRS_GetSetting (0x10e41df2/Unknown): Setting not found
NvAPI_GPU_GetArchInfo: OK
NvAPI_SYS_GetDriverAndBranchVersion: OK
NvAPI_DRS_GetSetting (0x10afb764/Unknown): Setting not found
NvAPI_DRS_CreateSession: OK
NvAPI_QueryInterface (0xa782ea46): Unknown function ID
NvAPI_DRS_FindApplicationByName (Z:\mnt\cdrive0\Games\The Last of Us Part I\tlou-i.exe): Executable not found
NvAPI_DRS_DestroySession: OK
NvAPI_Initialize: OK
NvAPI_DRS_CreateSession: OK
NvAPI_DRS_LoadSettings: OK
NvAPI_DRS_GetBaseProfile: OK
NvAPI_DRS_GetSetting (0x10afb76b/Unknown): Setting not found
NvAPI_D3D12_IsFatbinPTXSupported: OK
NvAPI_EnumPhysicalGPUs: OK
NvAPI_GPU_GetAdapterIdFromPhysicalGpu: OK
NvAPI_GPU_GetArchInfo: OK
NvAPI_D3D12_GetGraphicsCapabilities (sm_75): OK
NvAPI_DRS_GetSetting (0x10afb76a/Unknown): Setting not found
NvAPI_DRS_GetSetting (0x10afb76c/Unknown): Setting not found
NvAPI_D3D12_CreateCubinComputeShaderWithName: OK
NvAPI_D3D12_CaptureUAVInfo: OK
NvAPI_D3D12_GetCudaTextureObject: OK
NvAPI_D3D12_LaunchCubinShader: OK

Return OK for GetGpuCoreCount, GetAllClockFrequencies and
GetPstates20 when detecting The Last of Us part 1. Otherwise
this title wont start.
@jp7677 jp7677 marked this pull request as ready for review March 29, 2023 19:45
Copy link
Collaborator

@Saancreed Saancreed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few notes and suggestions, but current revision is okay too.

Maybe this is a good moment to kindly ask Valve if they'd be interested in pulling wine-nvml into Proton 🙃

src/util/util_env.cpp Outdated Show resolved Hide resolved
src/nvapi_gpu.cpp Outdated Show resolved Hide resolved
src/util/util_env.cpp Show resolved Hide resolved
src/nvapi_gpu.cpp Show resolved Hide resolved
@jp7677 jp7677 merged commit c10c4fc into master Mar 29, 2023
@jp7677
Copy link
Owner Author

jp7677 commented Mar 29, 2023

Something to consider for later when testing is easier, this title seems handle a not existing function just fine.

NvAPI_QueryInterface NvAPI_GPU_GetMemoryInfoEx: Not implemented method

May be the game is okay with failure to query a function but not with failure to call it? If this is indeed the case, we could eventually greatly simplify the current work around.

@jp7677 jp7677 deleted the last-of-us branch March 29, 2023 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Last of Us Part 1 needs more functions to be implemented
2 participants