Hello,
I tested Just Cause II Steam version and, even if its compatibility state is in progress, it is yet too unstable to be playable.
My config:
1) Firstly, this game crash at start if Steam overlay is enable. You can hope to join the aim game menu when Steam overlay is disabled.
2) in the menu you have several tests performance. I can launch two of this three performance tests: "dark tower" and "desert". The third performance test named "urban jungle" always crash the game
3) the game could crash at start or at exit
I joined the log when the game crashes with test performance named "urban jungle" :
JustCause2_d3d11.log
JustCause2_dxgi.log
just_cause_2.log
Thank you for your help.
Please disable the Steam Overlay when testing.
I'm aware it's unstable, but it's probably just hitting the 32-bit memory limitations. A few people who own the game already tried to debug it and hit an error condition that is impossible to hit if memory allocations work correctly, which indicates that this may indeed be the issue.
This is a common issue with DXVK and not easy or even impossible to resolve.
Back when I was testing DXUP and DXVK separately a month or so ago, I never had any issues running this.
I know one point where it always crashing for me -- Roaches base. Every time I tried to start initial mission, after several cutscenes.
Other factions are also affected, but randomly.
This missions are usually mean "you flying to a new location to do a job", so game probably loading new bunch of data at this time.
I upgraded my Nvidia drivers to 396.54 and Wine to 3-14-staging, most of the time the game crashes before showing his aim menu. If I reach the menu, when I choose "urban jungle" test performance, the game crashes. But I can launch a new game.
Do you know how to read dump from the game? I joined you some.
justcause2_crash_dump.zip
JustCause2_d3d11.log
JustCause2_dxgi.log
Do you need an apitrace?
Hello, I can't start the game at all. This is my first d3d10 game setup so it's possible my fault.
There are the steps I make:
Copy all of the DXVK libraries in the game's exe directory.
winetricks d3dcompiler_43
Set:
dxgi - native
d3d11- native
d3d10 native
Install DirectX End-User Runtimes (August 2009).
The game won't start with this setup complaining with "d3dcompiler:compile_shader HLSL shader parsing failed" error. I have to install d3dx10 and d3dx10_43 and the game starts but it freezes at the initial screen, right here:

The d3d10.log is empty.
d3d11 log:
https://pastebin.com/TKZeEHev
dxgi log:
https://pastebin.com/9SdZjhAP
Wine log:
https://pastebin.com/5Hcpgmva
Here you are an apitrace after this screen, recorded to the main menu:
https://my.pcloud.com/publink/show?code=XZXPN17ZqQWNGJKkPgpn9IROX0GUtSwL1asV
@mozo78 You need native d3dcompiler DLLs.
Thank you doitsujin :) How to obtain them? I installed d3dcompiler_43, isn't this enough?
@mozo78 try winetricks d3dcompiler directx10 directx11
@mozo78
Is it not easier to use:
winetricks d3dcompiler_43 dxvk72
(with winetricks master)??
Takes the guess work out of doing things manually...
@bobwya
I'm already with dxvk 0.72 and d3dcompiler_43 installed.
@legluondunet
Unfortunately this doesn't work:
Unknown arg d3dcompiler
Unknown arg directx10
And so on.
d3dcompiler_43 is installed via "winetricks d3dcompiler_43" and is set to native.
Not sure which version the game needs, might be d3dcompiler_42. Your error message indicates that it is still trying to use wine's d3dcompiler.
But as I said in my previous posts, I got this library installed via:
winetricks d3dcompiler_43
In the mean time I can't find a way to install d3dcompiler_42:
Unknown arg d3dcompiler_42
I tried to set all DirectX libraries to native to no avail :(
There are multiple versions of the d3dcompiler DLLs, and you installed 43 but not the others.
I'll try with the latest winetricks.
@mozo78
launch this command:
WINEPREFIX=path/to/your/pfx/game winetricks --gui
click on "install" applications", valid, escape, click on "install a windows DLL", valid,
check all d3dx10, d3dx11 and D3Dcompiler.
Even if you launch this game, it is too unstable, not playable.
And if you want more help for Wine and Winetricks use, I think it is better to ask on the Wine forum:
https://forum.winehq.org/
I have installed all d3dx10 and d3dx11 already. There isn't d3dcompiler sections in the winetricks. There are DXVK versions form 0.54 to 0.72, but there aren't any d3dcompiler options. Anyway, thank you and I'm sorry for the inconvenience caused.
I'm aware it's unstable, but it's probably just hitting the 32-bit memory limitations. A few people who own the game already tried to debug it and hit an error condition that is impossible to hit if memory allocations work correctly, which indicates that this may indeed be the issue.
This is a common issue with DXVK and not easy or even impossible to resolve.
I disagree. Here is a possible fix:
@ryao I hope you are aware that this "fix" breaks compatibility?
huh, I am not even able to get it to launch.
Getting this:
Unhandled privileged instruction at address 0x449000
System information:
Wine build: wine-3.17 (Staging)
Platform: i386
Version: Windows 7
Host system: Linux
Host version: 4.18.11-arch1-1-ARCH
I got latest nVidia driver (410.57-4) and got the latest commit of dxvk (8172d347beed6e9fb237957c9f82e2fc77795092)
I am having similar issues and found some strange behaviour which I hope can be of use to someone.
Launching the game with the '/failsafe' parameter seems to increase the chance of getting past the loading screen, avoiding the crash detailed by mozo78. After the launch you are able to change the settings and resolution back to a pre /failsafe state, so it's sort of a workaround. The game will crash ~10 minutes afterwards though.
Failsafe mode ignores settings, placing the game in windowed mode at a much lower resolution than it would otherwise launch at. My hypothesis is that because of the lower amount of memory consumed as a result occasionally it's able to beat the initial loading process and deallocate enough memory for playing, although eventually crashing again. Just Cause 2 is a 32 bit application. (so to my knowledge they can't consume much more than 3gb of memory?)
Regardless I doubt this this an issue with dxvk rather JustCause2's general bugginess. Even on windows there are issues similar to this one, and the dxvk overhead might just be a bit too demanding for it.
wine-staging 3.21: without DXVK the game launched, I can play all the three tests and launch the aim game. Color are sometimes not correct and game is not fluid.
With DXVK: the game crashed at the first picture.
Not sure if this is of any help to anyone, or if I did it correctly, but here is my apitrace.
https://pastebin.com/ebG7MdcY
That's not an apitrace.
How's this?
An apitrace is the file generated by apitrace. Not the console output.
Sorry for the wait. Link
Sorry for the mess with those commits. But with that PR the game _works_ for me. Performance is completely terrible (around 10 fps, so unplayable on my i7 6700 + GTX 1070) and turning on SSAO will make it crash.
It's sad. I had hopes this game will be finally playable. Thumbs up for your effort though :)
Can you give me a build to test it? Thank you :)
BTW, SSAO crash:
wine: Unhandled page fault on read access to 0x00000038 at address 0xf2545802 (thread 003c), starting debugger...
Unhandled exception: page fault on read access to 0x00000038 in 32-bit code (0xf2545802).
Register dump:
CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
EIP:f2545802 ESP:0346ee28 EBP:0346ee28 EFLAGS:00010296( R- -- I S -A-P- )
EAX:00000030 EBX:f272d000 ECX:0346ee78 EDX:00000030
ESI:0346ee78 EDI:0346eee0
Stack dump:
0x0346ee28: 0346ee68 f252d3fc 00000030 f254439a
0x0346ee38: 0346ee60 f252d3dc 7cdc9530 0118ef60
0x0346ee48: 00000030 f252db06 7cdb8270 cbefd810
0x0346ee58: cbec9b88 0346ee78 cbecaff4 7cdc9530
0x0346ee68: 00000000 00c3bb99 cbecaff4 00c3bb99
0x0346ee78: 7cdc9530 00000030 00000000 0118ef60
Backtrace:
=>0 0xf2545802 _ZN4dxvk10D3D10Query13GetD3D11IfaceEv+0x10() in d3d11 (0x0346ee28)
1 0xf252d3fc _ZN4dxvk11D3D10Device14SetPredicationEP15ID3D10Predicatei+0x37() in d3d11 (0x0346ee68)
0xf2545802 _ZN4dxvk10D3D10Query13GetD3D11IfaceEv+0x10 in d3d11: movl 0x8(%eax),%eax
As usual with JC2 backtraces, this doesn't make any sense. That piece of code simply cannot crash unless the game passes an invalid pointer to the function, which should also crash on Windows.
Does the game run when commenting out the entire function?
Nope, still crashes when SetPredication does nothing.
@doitsujin
Does the game run when commenting out the entire function?
When I tried to do this recently -- It crashes with similar GetD3D11Iface() call in IASetInputLayout() (or so)
src/d3d10/d3d10_device.cpp#L896.
I gave up to check further.
P.S. the game acts like this:
D3D10Device::SetPredication(0, 0) -- ok
D3D10Device::SetPredication(0x30, 0) -- crash
After forcing D3D11Query* d3d11Predicate = nullptr;:
D3D10Device::IASetInputLayout(0x30) -- crash
...
The issue is that the D3D10Device calls GetPredicate on the D3D11Context and doesn't account for the fact that that could set a nullptr.
ID3D11Predicate* d3d11Predicate = nullptr;
m_context->GetPredication(
ppPredicate ? &d3d11Predicate : nullptr,
pPredicateValue);
*ppPredicate = static_cast<D3D11Query*>(d3d11Predicate)->GetD3D10Iface();
So what we end up with:
*ppPredicate = static_cast<D3D11Query*>(nullptr)->GetD3D10Iface();
That then returns something like 0x00000034 which crashes when the game calls SetPredication with that pointer.
The same issue also happens with IAGetInputLayout which is why the game still crashed after I commented out everything in SetPredication. It affects a couple of GetXYZ methods in the D3D10Device.