iXit / wine-nine-standalone

Build Gallium Nine support on top of an existing WINE installation
GNU Lesser General Public License v2.1
272 stars 23 forks source link

Cod MW2 Crash with d3d9-nine #116

Open mobin-2008 opened 2 years ago

mobin-2008 commented 2 years ago

Related issue on Freedesktop's gitlab:#5678

Hello Im cannot run some games with d3d9-nine for example : Call of Duty Modern Warfare 2 : log of wine

[mobin@Mobin-Mahdi-PC Call of Duty - Modern Warfare 2]$ wine iw4sp
01bc:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
Native Direct3D 9 v0.8.0.385-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
01bc:fixme:system:SystemParametersInfoW Unimplemented action: 59 (SPI_SETSTICKYKEYS)
01bc:fixme:system:SystemParametersInfoW Unimplemented action: 53 (SPI_SETTOGGLEKEYS)
01bc:fixme:system:SystemParametersInfoW Unimplemented action: 51 (SPI_SETFILTERKEYS)
Native Direct3D 9 v0.8.0.385-release is active.
For more information visit https://github.com/iXit/wine-nine-standalone
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x260dcd8), stub!
fixme:d3d9nine:DRIPresentGroup_GetMultiheadCount (0x260dcd8), stub!
tgsi_to_nir: unhandled TGSI property 23 = 1
wine: Unhandled page fault on read access to 00000038 at address F71E5722 (thread 01dc), starting debugger...
Unhandled exception: page fault on read access to 0x00000038 in 32-bit code (0xf71e5722).
Register dump:
 CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
 EIP:f71e5722 ESP:048ee8a4 EBP:eb128bd0 EFLAGS:00010212(  R- --  I   -A- - )
 EAX:7c980700 EBX:0000002c ECX:00000000 EDX:0000003c
 ESI:00000017 EDI:f77064c0
Stack dump:
0x048ee8a4:  00000000 f7470b4f eb128e50 eb128e68
0x048ee8b4:  eb128f88 048ee970 7c980700 f77064c0
0x048ee8c4:  eb1287f8 eb128f34 7c980700 00000017
0x048ee8d4:  048ee8f0 eb128bd0 f71e42b0 00000017
0x048ee8e4:  f77064c0 eb128bd0 f7e39467 7c980700
0x048ee8f4:  f7470a20 048ee91c 00000002 f71e42b0
Backtrace:
=>0 0xf71e5722 (0xeb128bd0)
0xf71e5722: movl        0xc(%ebx),%eax
Modules:
Module  Address                 Debug info      Name (70 modules)
PE        350000-  3d0000       Deferred        setupapi
PE        400000- 2550000       Deferred        iw4sp
PE       2660000- 2791000       Deferred        ole32
PE       27a0000- 2919000       Deferred        steam_api
PE       4a70000- 4a90000       Deferred        mssmp3.asi
PE       4a90000- 4aba000       Deferred        mssvoice.asi
PE       4ac0000- 4add000       Deferred        mileseq.flt
PE       4bf0000- 4bf6000       Deferred        mssds3d.flt
PE       4c00000- 4c12000       Deferred        mssdsp.flt
PE       4c20000- 4c31000       Deferred        msseax.flt
PE       4d50000- 4dad000       Deferred        dsound
PE       4db0000- 4edb000       Deferred        oleaut32
PE      10000000-100d8000       Deferred        ucrtbase
PE      18000000-18033000       Deferred        binkw32
PE      21100000-21197000       Deferred        mss32
PE      61680000-61683000       Deferred        api-ms-win-core-processthreads-l1-1-0
PE      61740000-61782000       Deferred        advapi32
PE      621c0000-621c3000       Deferred        api-ms-win-core-interlocked-l1-1-0
PE      62280000-62283000       Deferred        api-ms-win-core-libraryloader-l1-1-0
PE      62840000-62843000       Deferred        api-ms-win-core-processenvironment-l1-1-0
PE      62940000-62943000       Deferred        api-ms-win-core-synch-l1-1-0
PE      62980000-62983000       Deferred        api-ms-win-core-util-l1-1-0
PE      62b80000-62b88000       Deferred        api-ms-win-core-localization-l1-2-1
PE      62fc0000-6304f000       Deferred        rpcrt4
PE      63480000-6348c000       Deferred        version
PE      63bc0000-63bd9000       Deferred        shcore
PE      63e00000-63e03000       Deferred        api-ms-win-core-debug-l1-1-0
PE      64080000-64083000       Deferred        api-ms-win-core-processthreads-l1-1-1
PE      64a00000-64a03000       Deferred        api-ms-win-core-localization-l1-2-0
PE      64a40000-64a95000       Deferred        shlwapi
PE      64f00000-64f03000       Deferred        api-ms-win-core-sysinfo-l1-1-0
PE      66640000-66643000       Deferred        api-ms-win-core-file-l2-1-0
PE      67800000-67803000       Deferred        api-ms-win-core-string-l1-1-0
PE      67840000-678b1000       Deferred        winepulse
PE      67980000-67983000       Deferred        api-ms-win-core-datetime-l1-1-0
PE      67c00000-67c03000       Deferred        api-ms-win-core-handle-l1-1-0
PE      67d40000-67d6c000       Deferred        mmdevapi
PE      68140000-68143000       Deferred        api-ms-win-core-errorhandling-l1-1-0
PE      68300000-68303000       Deferred        api-ms-win-core-timezone-l1-1-0
PE      68500000-6855b000       Deferred        combase
PE      69180000-69190000       Deferred        wsock32
PE      697c0000-69840000       Deferred        ddraw
PE      6a040000-6a062000       Deferred        msacm32
PE      6a280000-6a32b000       Deferred        msvcrt
PE      6a340000-6a343000       Deferred        api-ms-win-core-file-l1-2-0
PE      6a400000-6a4bc000       Deferred        winmm
PE      6ac80000-6ac87000       Deferred        api-ms-win-core-fibers-l1-1-1
PE      6bb80000-6bb83000       Deferred        api-ms-win-core-console-l1-1-0
PE      6bc00000-6bc2a000       Deferred        sechost
PE      6bcc0000-6bcc3000       Deferred        api-ms-win-core-profile-l1-1-0
PE      6c9c0000-6cc54000       Deferred        gdi32
PE      6cdc0000-6cdc3000       Deferred        api-ms-win-core-namedpipe-l1-1-0
PE      6cec0000-6cecc000       Deferred        powrprof
PE      6de80000-6de83000       Deferred        api-ms-win-core-synch-l1-2-0
PE      6e1c0000-6e1c3000       Deferred        api-ms-win-core-rtlsupport-l1-1-0
PE      6e840000-6e844000       Deferred        api-ms-win-core-file-l1-1-0
PE      6ebc0000-6ebc3000       Deferred        api-ms-win-core-memory-l1-1-0
PE      6ed00000-6ef24000       Deferred        user32
PE      6f480000-6f48b000       Deferred        nsi
PE      705c0000-705c3000       Deferred        api-ms-win-core-heap-l1-1-0
PE      71200000-7121b000       Deferred        imm32
PE      7a840000-7a844000       Deferred        opengl32
PE      7b000000-7b0e8000       Deferred        kernelbase
PE      7b600000-7b81b000       Deferred        kernel32
PE      7bc00000-7bc9c000       Deferred        ntdll
PE      7d370000-7d374000       Deferred        winex11
PE      7dbc0000-7dbc4000       Deferred        wined3d
PE      7df10000-7e7e7000       Deferred        shell32
PE      7e950000-7e956000       Deferred        ws2_32
PE      7e980000-7e984000       Deferred        iphlpapi
Threads:
process  tid      prio (all id:s are in hex)
00000038 services.exe
        0000003c    0
        00000040    0
        0000004c    0
        00000070    0
        000000a8    0
        000000c0    0
        000000d4    0
00000044 winedevice.exe
        00000048    0
        00000054    0
        00000058    0
        0000005c    0
00000060 winedevice.exe
        00000064    0
        00000074    0
        00000078    0
        0000007c    0
        00000088    0
        0000008c    0
        00000090    0
00000094 plugplay.exe
        00000098    0
        000000ac    0
        000000b0    0
        000000b4    0
000000b8 svchost.exe
        000000bc    0
        000000c4    0
        000000c8    0
000000cc rpcss.exe
        000000d0    0
        000000d8    0
        000000dc    0
        000000e0    0
        000000e4    0
        000001d0    0
000001a8 start.exe
        000001ac    0
000001b0 conhost.exe
        000001b4    0
000001b8 (D) Z:\mnt\HDD\Games\Call of Duty - Modern Warfare 2\iw4sp.exe
        000001bc    0
        000001d4    0
        000001d8    0
        000001dc    0 <==
        000001e0    0
        000001e4   15
        000001e8   15
        000001ec   15
        000001f0   15
        000001f4    2
        000001f8    0
        000001fc    0
        00000208    0
000001c0 explorer.exe
        000001c4    0
        000001c8    0
        000001cc    0
System information:
    Wine build: wine-6.14
    Platform: i386 (WOW64)
    Version: Windows 7
    Host system: Linux
    Host version: 5.13.6-artix1-1
01b4:fixme:ver:GetCurrentPackageId (000000000021FDB0 0000000000000000): stub

system info AMD Ryzen 5 3500x NVIDIA Geforce GTX 1650 (with nouveau & mesa) 2x8GB ram, DDR4, 3200,CL16

mobin-2008 commented 2 years ago

I am ready for any help and information

axeldavy commented 2 years ago

@Venemo That's one for you I guess ^^

To debug this issue, what would be helpful is either a trace of the game taken with wined3d (see wiki for how to make a trace), or the log with NINE_TGSI_DUMP=1 (needs mesa built with ndebug set to false, or debug build)

Venemo commented 2 years ago

Thanks for the bug report. I think the relevant part is this:

tgsi_to_nir: unhandled TGSI property 23 = 1

I'll look into it

mobin-2008 commented 2 years ago

Trace: https://mobintestserver.ir/d3d9.trace.xz

axeldavy commented 2 years ago

I cannot replicate the issue when running the trace.

mobin-2008 commented 2 years ago

I was doing something for a while and I did not pursue this issue. I'm sorry. I do not understand! I recorded the game performance with wined3d9 and sent it to you. Where was my work wrong?

lorn10 commented 2 years ago

What a coincidence. I ran today into the exact same tgsi_to_nir: unhandled TGSI property 23 = 1 problem described here.

I tried to test the new nir-to-tgsi path of the r600 Mesa driver (via R600_DEBUG=nir) in conjunction with the Xbox "emulator" CXBX-R and Gallium Nine.

Long story short, it looks that the underlying problem here has to do with the incompleteness of tgsi-to-nir, please see "ttn doesn't translate const decls into ubo vars, so then ntt doesn't make a const decl" in Mesa MR 14883.

Mesa developer Emma Anholt suggest therefore, I quote:

wine nine is basically the only user of tgsi_to_nir (unless you're on a nir-backend-only driver and using it to take in u_blitter shaders). I think we need to just make nine stop using ttn on preferred-nir drivers, given that ttn is not complete.

More information can be found at the corresponding WIP: r600: Use tgsi-to-nir instead of TGSI when the NIR debug opt is disabled MR on Mesa.

@axeldavy (Really sorry to bother you again) and @Venemo (Because you are here the "owner" of the bug)

lorn10 commented 2 years ago

@mobin-2008 You haven't done here anything wrong. It's just so that the problem must be reproducible by the devs, otherwise it is almost impossible to fix it. :wink:

Whatever, if you have the time and motivation then it would be interesting to know if you are able to reproduce this tgsi_to_nir: unhandled TGSI property 23 = 1 error on your nvc0 nouveau driver based hardware with one of my Crash Tag Team Racing apitraces from #5966 or #5967.

axeldavy commented 2 years ago

Have you tried enforcing tgsi then ?

lorn10 commented 2 years ago

Yes, Gallium Nine works on the r600 driver perfectly well with TGSI. This tgsi_to_nir: unhandled TGSI property 23 = 1 problem here is only present for me when I enforce NIR with R600_DEBUG=nir.

PS It is somehow interesting and strange why we have no such problem with the RadeonSI driver.

mobin-2008 commented 2 years ago

https://gitlab.freedesktop.org/anholt/mesa/-/commit/8392711ef663139b5cc46ce48f8dcb3a461c6b51

I think this problem has been completely solved by upgrading this issue in the upstream project (mesa) when version 22.2 is released. In this case, I close this issue.

lorn10 commented 2 years ago

Yes, there was a fix (or workaround) in Mesa MR !14883 which landed recently.

However, according to the comment here of Timur Kristóf it looks that the tgsi_to_nir: unhandled TGSI property 23 = 1 problem will be resolved finally when some additional D3D9 functionality is added to TTN. :wink:

Addition: For whatever reason I still get this tgsi_to_nir: unhandled TGSI property 23 = 1 bug with the r600 driver.