How I Debugged A Cyberpunk 2077 Crash
A detailed explanation on how I debugged Cyberpunk 2077 to find the reason behind the crash.
I remember when I first downloaded Cyberpunk 2077 right after it came out, and I tried running it. I was immediately greeted with this error:
After spending a few hours looking around on forums and reddit, I eventually reached a dead end. I tried a few things like verifying file integrity via Steam, but everything I tried failed. I eventually just gave up, and played the game via a cloud gaming service instead (Geforce Now is the one I used, worked great!).
However, I randomly started thinking about Cyberpunk 2077 this morning, and decided to figure out why the game keeps crashing upon startup.
The debugging process
The first thing I did was open up the game in a debugger. I chose x64dbg because that’s the debugger I normally use now.
I ran the application within the debugger, and waited until I encountered some exceptions. Then I found this:
An access violation exception… Hmmm, maybe we should look at the call stack?
All I see are a bunch of function calls from some DirectX modules, and the d3d10warp module which is a Windows DLL file (Rasterizer). Upon further inspection of the code inside these functions, I quickly realized that it would be a pain in the ass to continue reverse engineering the code without symbol names.
Windbg to the rescue!
I decided to try using Windbg, and hopefully it’ll give me more information. I ran the application again, inside Windbg this time, and here’s what I saw:
I clicked on “stack” in the bottom right corner to view the call stack, and, lo and behold!
Symbol names! It seems that the access violation happens during the initialization of the D3D12 device, more specifically when dealing with shaders. This made me suspicious, and I had an idea for what the problem could be. To confirm this, I opened up dxdiag to check if my GPU actually supports DirectX 12.
Well, damn… My GPU doesn’t seem to support DirectX 12, which is not surprising considering my graphics card is 11 years old.
Although I haven’t verified this to be the actual cause of the crash, it seems very reasonable to assume that it is. So, if you’re experiencing the same Cyberpunk 2077 crash upon startup, make sure your GPU actually supports DirectX 12.