CyberEngineTweaks icon indicating copy to clipboard operation
CyberEngineTweaks copied to clipboard

Game crashing when closing with AMD GPUs

Open ZeoKen opened this issue 2 years ago • 21 comments

I just installed the tool without any mods and every time I close the game it crashes, if I uninstall the tool it doesn't happen. I tried version 1.19.0 and 1.19.1 but the same thing happens with both.

ZeoKen avatar Feb 19 '22 22:02 ZeoKen

every time i press [tide] the game crash

eyadee7 avatar Feb 22 '22 14:02 eyadee7

every time i press [tide] the game crash

This is unrelated to the current issue and also a support question, not a github issue.

maximegmd avatar Feb 22 '22 15:02 maximegmd

I'm having the same bug. Already reinstalled Cyberpunk (gog). No mods, reshade overlays etc.. Vanilla Game with CET 1.19.1 (1.19.0 also tested) Win 10 21H2 (19044.1526) On exit game crashes. cyber_engine_teaks.log is empty. Cyberpunk2077.exe-20220223-195007-57160-52660.txt

lex-7b avatar Feb 23 '22 18:02 lex-7b

I can replicate this with the Steam release and 1.19.1.

Seems fine during gameplay, it's only when quitting.

draeath avatar Feb 26 '22 01:02 draeath

I am using the steam release and 1.19.2 This is the error report that I get Cyberpunk2077-20220301-150247-12408-5412.zip

Rubengam3r avatar Mar 01 '22 22:03 Rubengam3r

I have the same issue. GoG version 1.52.1. Happens on a clean installation with only CET.

adbowers avatar Apr 23 '22 02:04 adbowers

I'm having the same issue. GOG verison 1.52. I did a clean install of the game with only CET but the issue still persists.

NaiveYves avatar May 06 '22 19:05 NaiveYves

To those experiencing this, does this happen with a clean install and only CET (no other mods)?

If so what hardware are you using? OS?

maximegmd avatar Jun 23 '22 19:06 maximegmd

It happens with a clean install of CP2077 (GOG version, idk if it matters), no other mods and I'm using Windows 10 Pro 21H2

ZeoKen avatar Jun 23 '22 19:06 ZeoKen

and hardware?

maximegmd avatar Jun 23 '22 19:06 maximegmd

CPU: AMD Ryzen 7 3700X GPU: RX 5700 XT

ZeoKen avatar Jun 23 '22 19:06 ZeoKen

Clean Install with CET only. CPU: Ryzen 5800X GPU: RX 6900XT

lex-7b avatar Jun 23 '22 21:06 lex-7b

I dont think this is related to this mod. My game was crashing almost everytime i quit it for a week and i was playing without any mods installed.

JMD13 avatar Jun 30 '22 19:06 JMD13

At least in my case the game was running fine without the mod, then I installed the mod and every time I close it crashes then I remove the mod and the game works fine again, then I did a clean install of the game and everything is fine, after I install the mod the game starts crashing again on closing and after I removed it everything works fine.

So at least in my case the mod is the only variable that I could think that's making it crash.

ZeoKen avatar Jun 30 '22 19:06 ZeoKen

I have the same problem and with CyberEngineTweaks (the last one) being the only variable. It is quite annoying. It is installed on a clean Cyberpunk 1.52. Hardware is a Ryzen 3600 with an RX 5700 XT. Is it related to the overlays? I haven't removed any. Thanks for your help. Btw also thanks for your contribution in making this community awesome!

cmonfeetcruise4me avatar Jul 08 '22 14:07 cmonfeetcruise4me

Same issue, only crash when I close the game. I tried with a fresh install without CET, no problem. As soon I install only CET, the game crash when I close it.

Windows 11 21H2 CPU AMD Ryzen 7 3800X GPU AMD Radeon RX 5700 XT Driver AMD Adrenaline 22.6.1

As far I can tell regarding the comments, it seems to be an AMD (CPU and/or GPU).

Thanks a lot for your support, Cheers

j-lsgr avatar Jul 11 '22 18:07 j-lsgr

Yeah I agree it seems to be AMD related, sadly I don't have an AMD GPU, only someone with an AMD GPU will be able to debug this ;(

maximegmd avatar Jul 11 '22 18:07 maximegmd

I'm not sure what exactly is causing it because I am not familiar with DirectX, but it looks like there is some issue releasing resources on shutdown with AMD's driver that causes the issue. Here is the stack trace from WinDbg. I've commented line numbers and files for some of the calls.

amdxc64!OpenShimInterface+0x54a7:
00007ffa`7c0ef547 488b4008        mov     rax,qword ptr [rax+8] ds:00000166`f0fd49b0=????????????????
[0x0]   amdxc64!OpenShimInterface + 0x54a7   
[0x1]   amdxc64 + 0x20476   
[0x2]   D3D12Core!CDevice::GetEtwAllocationInfoImpl<void (__cdecl*)(D3D10DDI_HDEVICE,D3D12DDI_HANDLE_AND_TYPE,unsigned int * __ptr64,D3D12DDI_DEBUG_VIRTUAL_ADDRESS_ALLOCATION_INFO_0012 * __ptr64,unsigned int * __ptr64,D3D12DDI_DEBUG_KMT_ALLOCATION_INFO_0014 * __ptr64),D3D12DDI_DEBUG_KMT_ALLOCATION_INFO_0014> + 0x1c0   
[0x3]   D3D12Core!CDevice::VersionedLogEtwAllocationInfo + 0x7c   
[0x4]   D3D12Core!CPageable<ID3D12PipelineState>::LogEtwAllocationInfo<CPipelineState> + 0xb8   
[0x5]   D3D12Core!CBridgeImpl<ID3D12LayeredUseCounted,ID3D12LayeredUseCounted,CLayeredObject<CPipelineState> >::LUCPrepareForDestruction + 0x8a   
[0x6]   d3d12!CUseCountedObject<NOutermost::CDeviceChild>::`scalar deleting destructor' + 0x47   
[0x7]   d3d12!CUseCountedObject<NOutermost::CDeviceChild>::UCDestroy + 0x25   
[0x8]   d3d12!CUseCountedObject<NOutermost::CDeviceChild>::UCReleaseUse + 0x88   
[0x9]   d3d12!CUseCountedObject<NOutermost::CDeviceChild>::Release + 0xca   
[0xa]   D3D12Core!CLayeredObject<CBackingCommandAllocator>::CContainedObject::Release + 0x22   
[0xb]   cyber_engine_tweaks!SafeRelease<ID3D12PipelineState> + 0x2a   
[0xc]   cyber_engine_tweaks!ImGui_ImplDX12_InvalidateDeviceObjects + 0x2b   
[0xd]   cyber_engine_tweaks!ImGui_ImplDX12_Shutdown + 0x9   
[0xe]   cyber_engine_tweaks!D3D12::~D3D12 + 0x1b   //D3D12.cpp: 89
[0xf]   cyber_engine_tweaks!CET::~CET + 0x97   //CET.cpp: 79
[0x10]   cyber_engine_tweaks!CET::`scalar deleting destructor' + 0x17   
[0x11]   cyber_engine_tweaks!std::default_delete<CET>::operator() + 0x2f   
[0x12]   cyber_engine_tweaks!std::unique_ptr<CET,std::default_delete<CET> >::reset + 0x4e   
[0x13]   cyber_engine_tweaks!CET::Shutdown + 0x12   // CET.cpp: 16
[0x14]   cyber_engine_tweaks!Shutdown + 0x4e   //dllmain.cpp: 81
[0x15]   cyber_engine_tweaks!DllMain + 0x41   //dllmain.cpp: 105
[0x16]   cyber_engine_tweaks!dllmain_dispatch + 0x8f   
[0x17]   ntdll!LdrpCallInitRoutine + 0x6b   
[0x18]   ntdll!LdrShutdownProcess + 0x1ec   
[0x19]   ntdll!RtlExitUserProcess + 0xad   
[0x1a]   KERNEL32!ExitProcessImplementation + 0xb   
[0x1b]   Cyberpunk2077!AK::WriteBytesBuffer::Clear + 0x1550ae5   
[0x1c]   Cyberpunk2077!AK::WriteBytesBuffer::Clear + 0x1550a9b   
[0x1d]   Cyberpunk2077 + 0x195f38   
[0x1e]   Cyberpunk2077!AK::WriteBytesBuffer::Clear + 0x15412c6   
[0x1f]   KERNEL32!BaseThreadInitThunk + 0x10   
[0x20]   ntdll!RtlUserThreadStart + 0x2b   

Flat avatar Sep 30 '22 19:09 Flat

I've also got this issue, but I don't believe it's related to AMD GPU, cause it worked without crashing after you exit the game without CET installed, and the bypassing intro video doesn't seems to work either!

e33et avatar Oct 04 '22 10:10 e33et

Well it only occurs with AMD GPUs so it is related to their drivers, the stack above shows that it crashes within the driver code

maximegmd avatar Oct 07 '22 13:10 maximegmd

That's strange cause I don't see any AMD related issue in my log after I exit and then crash!

"amdxc64!OpenShimInterface+0x54a7: 00007ffa7c0ef547 488b4008 mov rax,qword ptr [rax+8] ds:00000166f0fd49b0=????????????????

[0x0] amdxc64!OpenShimInterface + 0x54a7
[0x1] amdxc64 + 0x20476 "

But my issue is probably the same behavior!

Regards /e33et

e33et avatar Oct 10 '22 16:10 e33et

Current master should be stabilized a bit in regards to binding.

I dont know about how all of these behave on Windows 7, but I had random crashes during startup etc. before changes from today and few days ago (after you two talked)

And I have nvidia GPU, not AMD.

Incorrect resource handling should be fixed along with errorneous thread which was being spawned during CET init and was trying to hook all over the place in improper time.

@e33et @Flat mby others... Could someone test with latest artifact from actions once it finishes building? https://github.com/yamashi/CyberEngineTweaks/actions/runs/3260994358

Make a backup of bindings.json and config.json before using this new build! It has only one-way upgrade for these.

WSSDude avatar Oct 16 '22 21:10 WSSDude

Current master still crashes on exit. Same error as before.

Flat avatar Oct 16 '22 21:10 Flat

Resource release may be happening too late I guess... Well, another one to the list then.

At least it is exit crash, that is less severe I believe than it not starting at all.

WSSDude avatar Oct 16 '22 21:10 WSSDude

There was one on startup that could happen (had not had stable repro for it)

That one should be gone at least, was caused by us running side-by-side another hooking procedure while DXGI was not ready to be used at times.

Also could have possibly caused other issues we didnt know about, it was able to corrupt memory the way it was set.

That hook was meant for Windows 7 and ran always, sometimes in wrong times. Changed place this happens.

WSSDude avatar Oct 16 '22 21:10 WSSDude

I think I'll close this in favor of #725 which is trying to resolve these sort of things (not necessarily popup not showing and such, although it may help with something there too)

WSSDude avatar Oct 16 '22 22:10 WSSDude

Current master should be stabilized a bit in regards to binding.

I dont know about how all of these behave on Windows 7, but I had random crashes during startup etc. before changes from today and few days ago (after you two talked)

And I have nvidia GPU, not AMD.

Incorrect resource handling should be fixed along with errorneous thread which was being spawned during CET init and was trying to hook all over the place in improper time.

@e33et @Flat mby others... Could someone test with latest artifact from actions once it finishes building? https://github.com/yamashi/CyberEngineTweaks/actions/runs/3260994358

Make a backup of bindings.json and config.json before using this new build! It has only one-way upgrade for these.

Yep, sorry, but thanks anyway same issue happen to me too, nothing changed, uploaded my game log file, if that helps a bit!

Cyberpunk2077-20221017-091313-8068-18972.zip

My hardware:

CPU: AMD Ryzen 7 2700X 3,7 GHz GPU: AMD Radeon RX 6800 XT Memory: 32GB DDR4 RAM 3000MHz

Windows 10 x64 21H2 (19044.2130) GPU Driver: AMD Adrenalin 22.10.1

e33et avatar Oct 17 '22 07:10 e33et