CDPR just announced that they're finally releasing a Cyberpunk2077.exe not compiled with AVX instructions!!! https://twitter.com/CDPRED_Support/status/1434824417151012866
That took some time...
Well, at least you were able to use my fix to get you playing until now.
I'm going to diff the new binary with the old, and with my patched one to see how they solved it? (or more like how the compiler solved it?) Chances are that those who have experienced a speed increase after applying my patch won't retain that after choosing their new binary. Tests will show.
In case the AVX crashes returns in future releases I'm ready to make another patch. Meanwhile if you still have AVX crashes and haven't applied my patch yet, I recommend that you pick the official solution from CDPR since that's the intended one. Let's hope it works...
Anyhow, thanks for those who helped me testing my patch and instructions!
We made it possible for people to play Cyberpunk 2077 these weeks after the 1.3 release broke AVX (and SSE 4.2). Now I can play around fixing some other annoying bugs in the game - which there are plenty to choose from, but it's more fun to fix critical crashes because the payoff is so much greater, but it was fun whilst it lasted!
Also thanks for all the positive feedback! This is why we make these mods for the community!
systemcan You shouldn't use this patch if you got the CDPR 1.3 own AVX hotfix, or if you got the 1.31 patch released today. That will only break the game in random ways since the binary has changed.
Please restore original 1.31 Cyberpunk2077.exe and launch the game again. If it crashes please post what error code you get so we can try to help you solve whatever issue you're having?!
You should also remove any mods you have installed since odds are they're no longer working after the 1.31 patch...
I managed to make it work here is some more detailed instructions:
1 - Download: CPAVXPatcher_v1-no-bin.zip from downloads section 2 - Get the file Jen provided: https://politisktinkorrektpappa.com/media/hpatchz.zip and remove the .txt extension so it becomes an exe again. 3 - Unzip the files in your game installation folder where Cyberpunk2077.exe is located. 4 - Press ALT + F in the same folder where Cyberpunk2077.exe is located 5 - Open Powershell as an administrator 6 - Execute this command: powershell -ExecutionPolicy Bypass -File .\CPAVXPatcher_v1.ps1 7 - If it works you will get a successful message on the screen. 8 - Play the game.
Wer Proleme mit der Powershell hat kann diese gerne für Admin ins Kontext bringen so startet die Powershell im Ordner selber. newdoxument.txt
copy:
Windows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\Directory\shell\OpenElevatedPS] @="PowerShell als Administrator" "Icon"="powershell.exe" "HasLUAShield"=""
Führt die .reg aus und bestätigt die Registry änderung. Voila Poweshell als Admin befindet sich im Kontextmenü (rechtsklick) So konnte ich nach langen hin und her endlich den Befehl von -6 ausführen und es konnte erfolgreich gepatchd werden.-
Ugh just doesn't work on my ancient pc lol... but my V 1.2 version works ok random crashes still. Ohh well its not like this game is so much better on a high end PC still buggy as hell. I'm convinced it will never run test proven as GTA5 a ancient game at that.
Hey... It seems we may need your mod again in 2.1 update... I noticed it uses way more cpu, and if I lower the ring clock, it slows down significantly, so there's probably some avx running. Plus a lot of people have similar problem as back then- crash on start.
EDIT: Some people are still having trouble reading/following the install instructions so I've updated the mod description and doc page. Please read through it before you begin patching the game and you shouldn't encounter any problems - and if you do, read the posts here because the answer is probably already answered, or if you can't find a solution make a new post and I'll help you!
New version uploaded and this is a tool, script, patch and instructions on how to patch Cyberpunk2077.exe on your computer!
BUT the tool hpatchz.exe got flagged with yet another false positive... sigh...
There's no public Win32 build of HDiffPatch that I could find so I wanted to add it so you people don't have to build it just so you can patch.
My previous attempt to contact mods to unflag the last file was unsuccessful, as in nobody got back to me. I'm doing another attempt but if one of you can contact a mod via Discord or similar I'd be grateful and it would speed up the process of getting everyone to play Cyberpunk again - which is why I haven't slept much the last three days!
I'm uploading a zip file without the patch tool so you who fancy acquiring hpatchz.exe on your own can do so! (https://github.com/sisong/HDiffPatch - thank you LachlanStowe for the tip!) Also thank you gab16ers for sorting out the PowerShell script! Who needs UAC anyway... :P
The file containing the hpatchz.exe is now approved as well so you don't have to sideload that from external site, but I'm keeping that route open regardless in case someone's browser/antivirus decides that exe files are dangerous and cannot be downloaded like this and deletes it...
Hey Jens can you try to upload again the files that gave false positive but without the .exe file extension it might work seems this site doesn't like the .exe extension send the archive in a zip file too.
I managed to make it work here is some more detailed instructions:
1 - Download: CPAVXPatcher_v1-no-bin.zip from downloads section 2 - Get the file Jen provided: https://politisktinkorrektpappa.com/media/hpatchz.zip and remove the .txt extension so it becomes an exe again. 3 - Unzip the files in your game installation folder where Cyberpunk2077.exe is located. 4 - Press ALT + F in the same folder where Cyberpunk2077.exe is located 5 - Open Powershell as an administrator 6 - Execute this command: powershell -ExecutionPolicy Bypass -File .\CPAVXPatcher_v1.ps1 7 - If it works you will get a successful message on the screen. 8 - Play the game.
I'm not a Windows guy so writing my first PowerShell script I tried to keep is as simple as possible. If "-ExecutionPolicy Bypass" is required I'll add it to the instructions! Since I'm developing on all my computers I've tweaked UAC and other security features since they make life a hell just trying to compile simple binaries, let alone anything more complex, or signed vs. unsigned binaries.
I think I understand why you added that so many thanks! I love community efforts and helping each other!
I'll update the texts here and call it for tonight.
Hi jensandree thanks you can add my instructions if you want, the bypass command was needed because my computer was not letting me execute the powershell command without the "-ExecutionPolicy Bypass" since your computer is tweaked i think the majority of users will need this command too to make the patch work.
Your mod is working perfectly so far with my testing so thanks again!
Some kind of problem with the powercell. To begin with, my folder with the game in the incentive has the name Cyberpunk 2077 and because of the space in the name of the povershell it does not find the files I need. However, even if you remove this space and try to enter the command again, you will receive the following message: "Can't find Cyberpunk.exe. Ensure that you're running in the right location?". And here I really don't understand what the problem is, I tried to rename my Cyberpunk2077.exe to Cyberpunk.exe but it did not help
ArtemBurbon you're not supposed to rename any files. The script makes a backup of the original Cyberpunk2077.exe as a first step and if it can't find the file you'll get an error message and the script stops. This would indicate that you're running the script in the wrong folder. Verify this and try again.
Okay, maybe I'm doing something wrong? When it comes to powercell, I conditionally enter the command: powershell -ExecutionPolicy Bypass -File E:\games\Steam\SteamApps\common\Cyberpunk 2077\bin\x64\CPAVXPatcher_v1.ps1 If you enter the command like this, the following message is displayed: "Processing -File 'E:\games\steamapps\common\Cyberpunk' failed because the file does not have a '.ps1' extension. Specify a valid Windows PowerShell script file name, and then try again." That is, the powercell ignores everything that is written after a space in the file address at the moment with the "Cyberpunk 2077" folder. I understand that I can still change the name of the folder and it will not be critical. If I don't change anything else, powercell still won't be able to find "Cyberpunk.exe". Maybe the problem is that I globally enter the wrong command? I just looked at the instructions in the comments and README realized that it was necessary to enter the command in exactly the same way.
The problem has been resolved. It was my miscalculation, I had to go through the directory with the game files first. I tried to do it like on the command line using "сd", but since it did not work, I thought that in the powercell it is not necessary to go to the directory in this way.
Thanks. I dont know if it was intended for me (I7-8750h/RTX 2060) but I can now run: 1080p, high with custom Ultra settings Ray Tracing no DLSS 45-60 fps
cacadodo666 Probably not if you were able to run 1.3 without it crashing as soon as you started a game - but you're not alone in noticing a speed increase after applying my patch and these AVX instructions aren't as fast as many believe they are - depending on how they're used that is... ;)
Hello OP,sorry for the offtopic but how didi you exactly find what string was the avx?Bcs i run in the same issue with dying light 2 and i would like to make an exe for that,please please PLEASE contact me.Lets get the people what they need.
A handful of people have reported another EXCEPTION_ILLEGAL_INSTRUCTION (0xC000001D) on XEON computers and it's due to 1.3 release now requires SSE 4.2, or more specific POPCTL. This was not the case previously and I'm sure this wasn't done on purpose, just like I'm sure AVX wasn't configured on purpose.
Sadly CDPR doesn't do a ECX test (execute CPUID with EAX=1 ) to see if bit 23 is set so it'll crash and there's nothing to stop it.
Patching it out is much harder than the AVX patch I did because here we need to replace the popcnt instruction with a math formula (n&(n-1)) but there's no way that's possible with the memory footprint available, unless I do a jmp and add a fix outside the normal exe file, and then jmp back after the replaced code has executed, but testing this kinda requires that I have a XEON computer which I don't...
Anyhow, I've found one way to emulate SSE 4.2 (and AVX as well - but please use my patch instead of relying on the emulator because everything emulated will be way slower to execute for obvious reasons...)
Download and install/unpack sde to your Cyberpunk install (...\Steam\SteamApps\common\Cyberpunk 2077\bin\x64\) directory.
Open a shell (CMD) as admin (right click "open as administrator"), navigate to the directory where you installed sde and type sde - Cyberpunk2077.exe (and hit enter)
It'll probably take an awful long time to start since all the emulation stuff needs to be setup, but you should be able to play the game at least until someone manages to fix the SSE 4.2/popctl crash.
It's the best solution I have for you at this point in time. With a bit of luck there's only a couple popctl instructions so it doesn't become a total lagfest... :/ Anyhow, just wanted to help out. Please report back if you try this workaround so we can tell others if it works well?!
Not working for, after crash game still doesn't start (CPU core2duo E8400/4.2GHZ) Error Reason: Unhandled exception Expression: EXCEPTION_ILLEGAL_INSTRUCTION (0xC000001D) Message: The thread tried to execute an invalid instruction.
Привет . Спасибо за патч. Но я не могу запустить Cyberpunk 2077. Я точно выполнил инструкции. «Сyberpunk2077.exe» сменил название на «Cyberpunk2077.exe.backup». Помогите пожалуйста
I have the AVX funcionality in my CPU, so... CDPR have removed completly AVX from Cyberpunk (at moment I play the 1.31 version) or they just made sure that processors that don't have this function can start it anyway, and who has the function activates itself?
in a nutshell: if they have completely disabled it, how can I re-enable it? (why)
obv ... if not complete disabled, just one word: NEVERMIND
Невозможно обработать -Файл "." Поскольку файл имеет расширение, отличное от PS1. Укажите допустимое имя файла сценария Windows PowerShell и имя файла из empire.How to decide как решить?как решить?как решить?
Привет. К сожалению, я не очень хорошо говорю по-русски. Вы можете следовать этой процедуре?
1 - Download: CPAVXPatcher_v1-no-bin.zip from downloads section 2 - Get the file: https://politisktinkorrektpappa.com/media/hpatchz.zip and remove the .txt extension so it becomes an exe again. 3 - Unzip the files in your game installation folder where Cyberpunk2077.exe is located. 4 - Press ALT + F in the same folder where Cyberpunk2077.exe is located 5 - Open Powershell as an administrator 6 - Execute this command: powershell -ExecutionPolicy Bypass -File .\CPAVXPatcher_v1.ps1 7 - If it works you will get a successful message on the screen. 8 - Play the game.
Unable to process -File "." Since the file has an extension other than PS1. Provide a valid Windows PowerShell script file name and file name from empire.how to solve?
The new v 1.3 completely flat line's buggy hell from the opening car chase sequence to as soon has night city loads it dies every time on queue. No mods added etc, but my other install V 1.2 runs ok crashes at randoms times or not at all. This is by far the most pathetic excuse for a money grab while NWO is being eStablished.
Hello, I did everything you said but powershell said ''patch is Ok! '' old .\Cyberpunk.exe.bakcup diff .\CPAVXPatchv1 out .\ Cyberpunk2077.exe patch ok!
Im still getting Flatlined error after I click play on steam or the exe
124 comments
https://twitter.com/CDPRED_Support/status/1434824417151012866
That took some time...
Well, at least you were able to use my fix to get you playing until now.
I'm going to diff the new binary with the old, and with my patched one to see how they solved it? (or more like how the compiler solved it?)
Chances are that those who have experienced a speed increase after applying my patch won't retain that after choosing their new binary. Tests will show.
In case the AVX crashes returns in future releases I'm ready to make another patch. Meanwhile if you still have AVX crashes and haven't applied my patch yet, I recommend that you pick the official solution from CDPR since that's the intended one. Let's hope it works...
We made it possible for people to play Cyberpunk 2077 these weeks after the 1.3 release broke AVX (and SSE 4.2).
Now I can play around fixing some other annoying bugs in the game - which there are plenty to choose from, but it's more fun to fix critical crashes because the payoff is so much greater, but it was fun whilst it lasted!
Also thanks for all the positive feedback! This is why we make these mods for the community!
Be well!
Cheers,
Jens
EOT
That will only break the game in random ways since the binary has changed.
Please restore original 1.31 Cyberpunk2077.exe and launch the game again. If it crashes please post what error code you get so we can try to help you solve whatever issue you're having?!
You should also remove any mods you have installed since odds are they're no longer working after the 1.31 patch...
1 - Download: CPAVXPatcher_v1-no-bin.zip from downloads section
2 - Get the file Jen provided: https://politisktinkorrektpappa.com/media/hpatchz.zip and remove the .txt extension so it becomes an exe again.
3 - Unzip the files in your game installation folder where Cyberpunk2077.exe is located.
4 - Press ALT + F in the same folder where Cyberpunk2077.exe is located
5 - Open Powershell as an administrator
6 - Execute this command: powershell -ExecutionPolicy Bypass -File .\CPAVXPatcher_v1.ps1
7 - If it works you will get a successful message on the screen.
8 - Play the game.
Wer Proleme mit der Powershell hat kann diese gerne für Admin ins Kontext bringen so startet die Powershell im Ordner selber.
newdoxument.txt
copy:
Edit .txt to >>> .reg
Führt die .reg aus und bestätigt die Registry änderung. Voila Poweshell als Admin befindet sich im Kontextmenü (rechtsklick)
So konnte ich nach langen hin und her endlich den Befehl von -6 ausführen und es konnte erfolgreich gepatchd werden.-
btw step 4 is a useless step
I noticed it uses way more cpu, and if I lower the ring clock, it slows down significantly, so there's probably some avx running.
Plus a lot of people have similar problem as back then- crash on start.
Some people are still having trouble reading/following the install instructions so I've updated the mod description and doc page.
Please read through it before you begin patching the game and you shouldn't encounter any problems - and if you do, read the posts here because the answer is probably already answered, or if you can't find a solution make a new post and I'll help you!
New version uploaded and this is a tool, script, patch and instructions on how to patch Cyberpunk2077.exe on your computer!
BUT the tool hpatchz.exe got flagged with yet another false positive... sigh...
There's no public Win32 build of HDiffPatch that I could find so I wanted to add it so you people don't have to build it just so you can patch.
My previous attempt to contact mods to unflag the last file was unsuccessful, as in nobody got back to me.
I'm doing another attempt but if one of you can contact a mod via Discord or similar I'd be grateful and it would speed up the process of getting everyone to play Cyberpunk again - which is why I haven't slept much the last three days!
I'm uploading a zip file without the patch tool so you who fancy acquiring hpatchz.exe on your own can do so!
(https://github.com/sisong/HDiffPatch - thank you LachlanStowe for the tip!)
Also thank you gab16ers for sorting out the PowerShell script! Who needs UAC anyway... :P
The file containing the hpatchz.exe is now approved as well so you don't have to sideload that from external site, but I'm keeping that route open regardless in case someone's browser/antivirus decides that exe files are dangerous and cannot be downloaded like this and deletes it...
Many thanks in advance,
Jens
You have to rename it from hpatchz.exe.txt to hpatchz.exe but that should be pretty obvious...
I hope this doesn't break any Nexus rules?!
Anyhow, have fun!
Cheers,
Jens
Thank you for appreciating the work! ??
1 - Download: CPAVXPatcher_v1-no-bin.zip from downloads section
2 - Get the file Jen provided: https://politisktinkorrektpappa.com/media/hpatchz.zip and remove the .txt extension so it becomes an exe again.
3 - Unzip the files in your game installation folder where Cyberpunk2077.exe is located.
4 - Press ALT + F in the same folder where Cyberpunk2077.exe is located
5 - Open Powershell as an administrator
6 - Execute this command: powershell -ExecutionPolicy Bypass -File .\CPAVXPatcher_v1.ps1
7 - If it works you will get a successful message on the screen.
8 - Play the game.
I'm not a Windows guy so writing my first PowerShell script I tried to keep is as simple as possible.
If "-ExecutionPolicy Bypass" is required I'll add it to the instructions!
Since I'm developing on all my computers I've tweaked UAC and other security features since they make life a hell just trying to compile simple binaries, let alone anything more complex, or signed vs. unsigned binaries.
I think I understand why you added that so many thanks! I love community efforts and helping each other!
I'll update the texts here and call it for tonight.
Cheers,
Jens
Your mod is working perfectly so far with my testing so thanks again!
Cordialement
Sywee
My game exe keeps getting deleted when i run this script.
It does make a backup so it's ok-ish. :)
P.S:
Are we doing this on the Gog or Steam version?
The script makes a backup of the original Cyberpunk2077.exe as a first step and if it can't find the file you'll get an error message and the script stops. This would indicate that you're running the script in the wrong folder. Verify this and try again.
1080p, high with custom Ultra settings
Ray Tracing
no DLSS
45-60 fps
I was getting 30-40 even at low settings.
The new crash happens here:
00007ff7`dc7631b0 f3480fb801 popcnt rax, qword ptr [rcx]
Sadly CDPR doesn't do a ECX test (execute CPUID with EAX=1 ) to see if bit 23 is set so it'll crash and there's nothing to stop it.
Patching it out is much harder than the AVX patch I did because here we need to replace the popcnt instruction with a math formula (n&(n-1)) but there's no way that's possible with the memory footprint available, unless I do a jmp and add a fix outside the normal exe file, and then jmp back after the replaced code has executed, but testing this kinda requires that I have a XEON computer which I don't...
Anyhow, I've found one way to emulate SSE 4.2 (and AVX as well - but please use my patch instead of relying on the emulator because everything emulated will be way slower to execute for obvious reasons...)
https://software.intel.com/content/www/us/en/develop/articles/intel-software-development-emulator.html
Download and install/unpack sde to your Cyberpunk install (...\Steam\SteamApps\common\Cyberpunk 2077\bin\x64\) directory.
Open a shell (CMD) as admin (right click "open as administrator"), navigate to the directory where you installed sde and type
sde - Cyberpunk2077.exe
(and hit enter)It'll probably take an awful long time to start since all the emulation stuff needs to be setup, but you should be able to play the game at least until someone manages to fix the SSE 4.2/popctl crash.
It's the best solution I have for you at this point in time. With a bit of luck there's only a couple popctl instructions so it doesn't become a total lagfest... :/
Anyhow, just wanted to help out.
Please report back if you try this workaround so we can tell others if it works well?!
Cheers,
Jens
Start patching...
old : ".\Cyberpunk2077.exe.backup"
diff: ".\CPAVXPatchv1"
out : ".\Cyberpunk2077.exe"
oldFile dataSize 67368608 != diffFile saved oldDataSize 65705160 ERROR!
hpatchz time: 0.016 s
Patch was successful
The Cyberpunk2077.exe.backup get created but no now exacutable is there to replace it
Error Reason: Unhandled exception
Expression: EXCEPTION_ILLEGAL_INSTRUCTION (0xC000001D)
Message: The thread tried to execute an invalid instruction.
I have the AVX funcionality in my CPU, so... CDPR have removed completly AVX from Cyberpunk (at moment I play the 1.31 version) or they just made sure that processors that don't have this function can start it anyway, and who has the function activates itself?
in a nutshell: if they have completely disabled it, how can I re-enable it? (why)
obv ... if not complete disabled, just one word: NEVERMIND
What can I do?
как решить?как решить?как решить?
К сожалению, я не очень хорошо говорю по-русски. Вы можете следовать этой процедуре?
1 - Download: CPAVXPatcher_v1-no-bin.zip from downloads section
2 - Get the file: https://politisktinkorrektpappa.com/media/hpatchz.zip and remove the .txt extension so it becomes an exe again.
3 - Unzip the files in your game installation folder where Cyberpunk2077.exe is located.
4 - Press ALT + F in the same folder where Cyberpunk2077.exe is located
5 - Open Powershell as an administrator
6 - Execute this command: powershell -ExecutionPolicy Bypass -File .\CPAVXPatcher_v1.ps1
7 - If it works you will get a successful message on the screen.
8 - Play the game.
old .\Cyberpunk.exe.bakcup
diff .\CPAVXPatchv1
out .\ Cyberpunk2077.exe
patch ok!
Im still getting Flatlined error after I click play on steam or the exe