bottlesdevs / Bottles

Run Windows software and games on Linux
https://usebottles.com
GNU General Public License v3.0
6.15k stars 258 forks source link

[Bug]: Bottles is assuming the wrong dedicated GPU #3270

Open BentHaase opened 6 months ago

BentHaase commented 6 months ago

Describe the bug

EA Launcher crashes after fresh installation with the following exception:

Unhandled exception: page fault on read access to 0x0000000000000020 in 64-bit code (0x00000002edf929c8).
Register dump:
 rip:00000002edf929c8 rsp:000000000011d670 rbp:000000000011d6c0 eflags:00010202 (  R- --  I   - - - )
 rax:0000000000000013 rbx:0000000000000013 rcx:0000000016658e10 rdx:0000000016658e10
 rsi:00000002ee0de410 rdi:000000000011d7a0  r8:0000000000000000  r9:0000000000000000 r10:00000000166c37f8
 r11:0000000000008e20 r12:0000000000000008 r13:000000000011d6b0 r14:00000000166c37e8 r15:0000000000000000
Stack dump:
0x000000000011d670:  00007ff34764e460 00007ff3475d6028
0x000000000011d680:  0000000000000000 000000017002adf0
0x000000000011d690:  0000000000000003 00000003a37fa000
0x000000000011d6a0:  000000017004e92f 0000000000000013
0x000000000011d6b0:  0000000016658e10 0000000000000013
0x000000000011d6c0:  0000000000000013 0000000000000000
0x000000000011d6d0:  0000000000000000 000000000011d7a0
0x000000000011d6e0:  00000000003240b0 0000000000000008
0x000000000011d6f0:  0000000000000000 00000000166c37f8
0x000000000011d700:  000000000011d790 00000000166c37e8
0x000000000011d710:  0000000000000000 00000002edf09d41
0x000000000011d720:  00000001700756a4 00007ff34758f39d
Backtrace:
=>0 0x00000002edf929c8 in dxgi (+0x929c8) (0x000000000011d6c0)
  1 0x00000002edf09d41 in dxgi (+0x9d41) (0x0000000000000000)
  2 0x00000002edf0780e EntryPoint+0x64be() in dxgi (0x0000000000000000)
  3 0x00000002edf09425 EntryPoint+0x80d5() in dxgi (0x000000000011d940)
  4 0x00000003590764ad EntryPoint+0x2515d() in d3d11 (0x0000000000000000)
  5 0x000000035907698a EntryPoint+0x2563a() in d3d11 (0x0000000000000000)
  6 0x0000000016be45a9 ??0PlatformMethods@angle@@QEAA@XZ+0x1c1919() in libglesv2 (0x0000000000000000)
  7 0x0000000016be3bcc ??0PlatformMethods@angle@@QEAA@XZ+0x1c0f3c() in libglesv2 (0x0000000000000000)
  8 0x0000000016be229a ??0PlatformMethods@angle@@QEAA@XZ+0x1bf60a() in libglesv2 (0x000000000e01004b)
  9 0x0000000016c1d15c ??0PlatformMethods@angle@@QEAA@XZ+0x1fa4cc() in libglesv2 (0x000000000e01004b)
  10 0x0000000016c1d77f ??0PlatformMethods@angle@@QEAA@XZ+0x1faaef() in libglesv2 (0x0000000000000000)
  11 0x0000000016a9300e ??0PlatformMethods@angle@@QEAA@XZ+0x7037e() in libglesv2 (0x0000000000000000)
  12 0x0000000016a29542 ??0PlatformMethods@angle@@QEAA@XZ+0x68b2() in libglesv2 (0x0000000000000000)
  13 0x0000000016a2b820 ??0PlatformMethods@angle@@QEAA@XZ+0x8b90() in libglesv2 (0x0000000000000000)
  14 0x000000001685e5ff in qwindows (+0x4e5ff) (0x000000000011e6c9)
  15 0x000000001681da19 in qwindows (+0xda19) (0x000000000011e920)
  16 0x000000001681e651 in qwindows (+0xe651) (0x000000000011e920)
  17 0x0000000016854866 in qwindows (+0x44866) (0x000000000011e920)
  18 0x0000000000939e05 ??$handleApplicationStateChanged@UAsynchronousDelivery@QWindowSystemInterface@@@QWindowSystemInterface@@SAXW4ApplicationState@Qt@@_N@Z+0x5c985() in qt5gui (0x000000000011e920)
  19 0x0000000001e7d58c ??0?$QEnableSharedFromThis@VUserNotificationController@QtWebEngineCore@@@@IEAA@AEBV0@@Z+0x6a40c() in qt5webenginecore (0x000000000011e920)
  20 0x0000000001e7f4ce ??0?$QEnableSharedFromThis@VUserNotificationController@QtWebEngineCore@@@@IEAA@AEBV0@@Z+0x6c34e() in qt5webenginecore (0x000000000011f240)
  21 0x0000000001e4d889 ??0?$QEnableSharedFromThis@VUserNotificationController@QtWebEngineCore@@@@IEAA@AEBV0@@Z+0x3a709() in qt5webenginecore (0x000000000011f240)
  22 0x0000000001c2815a ??0QQuickWebEngineAction@@QEAA@AEBVQVariant@@AEBVQString@@1_NPEAVQObject@@@Z+0x6fea() in qt5webengine (0x000000000011f240)
  23 0x00000001402dd8d6 in ealaunchhelper (+0x2dd8d6) (0x000000000011f240)
  24 0x00000001400565a2 in ealaunchhelper (+0x565a2) (0x000000000011f3e0)
  25 0x00000001400693ec in ealaunchhelper (+0x693ec) (0x000000000011fed9)
  26 0x00000001402f1690 in ealaunchhelper (+0x2f1690) (0x0000000000000000)
  27 0x000000007b62db59 ActivateActCtx+0x21ca9() in kernel32 (0x0000000000000000)
  28 0x0000000170060887 A_SHAFinal+0x3dcf7() in ntdll (0x0000000000000000)
0x00000002edf929c8 dxgi+0x929c8: cmpq   $14,0x0000000000000018(%r12)
Modules:
Module  Address                 Debug info  Name (137 modules)
PE  0000000000690000-000000000078c000   Deferred        ucrtbase
PE  0000000000790000-000000000081e000   Deferred        msvcp140
PE  0000000000820000-000000000083b000   Deferred        vcruntime140
PE  0000000000840000-0000000000844000   Deferred        api-ms-win-crt-runtime-l1-1-0
PE  0000000000850000-0000000000853000   Deferred        api-ms-win-crt-heap-l1-1-0
PE  0000000000860000-0000000000864000   Deferred        api-ms-win-crt-stdio-l1-1-0
PE  0000000000870000-0000000000873000   Deferred        api-ms-win-crt-locale-l1-1-0
PE  0000000000880000-0000000000883000   Deferred        api-ms-win-crt-time-l1-1-0
PE  0000000000890000-0000000000895000   Deferred        api-ms-win-crt-math-l1-1-0
PE  00000000008a0000-0000000000f52000   Export          qt5gui
PE  0000000000f60000-0000000001319000   Deferred        qt5qml
PE  0000000001320000-000000000147a000   Deferred        qt5network
PE  0000000001480000-000000000189a000   Deferred        qt5quick
PE  00000000018a0000-0000000001911000   Deferred        qt5qmlmodels
PE  0000000001920000-0000000001be3000   Deferred        libcrypto-1_1-x64
PE  0000000001bf0000-0000000001c15000   Deferred        qt5webchannel
PE  0000000001c20000-0000000001c86000   Export          qt5webengine
PE  0000000001c90000-0000000008166000   Export          qt5webenginecore
PE  0000000008170000-00000000081c4000   Deferred        qt5positioning
PE  00000000081e0000-000000000820b000   Deferred        qt5websockets
PE  0000000008210000-000000000876f000   Deferred        qt5widgets
PE  0000000008770000-000000001454b000   Deferred        libcef
PE  0000000014550000-00000000146bf000   Deferred        chrome_elf
PE  00000000146c0000-000000001476c000   Deferred        libssl-1_1-x64
PE  0000000014770000-00000000147b2000   Deferred        qt5webenginewidgets
PE  00000000147c0000-0000000014812000   Deferred        qt5printsupport
PE  0000000014820000-0000000014836000   Deferred        qt5quickwidgets
PE  0000000016810000-000000001697d000   Export          qwindows
PE  00000000169a0000-0000000016a1e000   Deferred        libegl
PE  0000000016a20000-000000001714f000   Export          libglesv2
PE  0000000017150000-0000000017176000   Deferred        qwindowsvistastyle
PE  000000007b000000-000000007b0da000   Deferred        kernelbase
PE  000000007b600000-000000007b814000   Export          kernel32
PE  0000000140000000-000000014079b000   Export          ealaunchhelper
PE  0000000170000000-00000001700a4000   Export          ntdll
PE  0000000180000000-0000000180606000   Deferred        qt5core
PE  00000001c3f00000-00000001c3f09000   Deferred        msvcp140_1
PE  00000001c4ee0000-00000001c4f10000   Deferred        winspool
PE  00000001c69e0000-00000001c731b000   Deferred        shell32
PE  00000001c8b40000-00000001c8b61000   Deferred        msacm32
PE  00000001c8db0000-00000001c8e48000   Deferred        msvcrt
PE  00000001cd360000-00000001cd364000   Deferred        api-ms-win-core-file-l1-1-0
PE  00000001cd860000-00000001cd863000   Deferred        api-ms-win-crt-utility-l1-1-0
PE  00000001cfdf0000-00000001cfe13000   Deferred        dxva2
PE  00000001d14b0000-00000001d14b3000   Deferred        api-ms-win-core-util-l1-1-0
PE  00000001d8e40000-00000001d8e43000   Deferred        api-ms-win-core-file-l1-2-0
PE  00000001d97a0000-00000001d97a7000   Deferred        api-ms-win-core-fibers-l1-1-1
PE  00000001dd3f0000-00000001dd4bf000   Deferred        crypt32
PE  00000001ec2b0000-00000001ec2d6000   Deferred        ws2_32
PE  00000001f51e0000-00000001f51f0000   Deferred        hid
PE  00000001fdfd0000-00000001fdff8000   Deferred        wintrust
PE  0000000201cf0000-0000000201d0f000   Deferred        secur32
PE  0000000212bb0000-0000000212bb3000   Deferred        api-ms-win-core-processthreads-l1-1-1
PE  0000000215450000-0000000215457000   Deferred        api-ms-win-security-systemfunctions-l1-1-0
PE  0000000216730000-0000000216733000   Deferred        api-ms-win-core-handle-l1-1-0
PE  000000021a7e0000-000000021a857000   Deferred        setupapi
PE  000000021b8f0000-000000021b8f3000   Deferred        api-ms-win-core-namedpipe-l1-1-0
PE  0000000226310000-0000000226313000   Deferred        api-ms-win-core-string-l1-1-0
PE  0000000228450000-000000022847b000   Deferred        propsys
PE  0000000231ae0000-0000000231b62000   Deferred        rpcrt4
PE  000000023d820000-000000023da76000   Deferred        user32
PE  0000000240030000-000000024005e000   Deferred        iphlpapi
PE  0000000241850000-0000000241853000   Deferred        api-ms-win-crt-environment-l1-1-0
PE  000000024f470000-000000024f48f000   Deferred        mpr
PE  00000002522e0000-0000000252324000   Deferred        oleacc
PE  0000000256480000-0000000256483000   Deferred        api-ms-win-core-datetime-l1-1-0
PE  000000025d740000-000000025d74e000   Deferred        dwmapi
PE  0000000263a00000-0000000263a03000   Deferred        api-ms-win-core-sysinfo-l1-1-0
PE  000000026b4c0000-000000026b53c000   Deferred        gdi32
PE  0000000270f60000-00000002712b3000   Deferred        d3d9
PE  00000002739c0000-0000000273af8000   Deferred        oleaut32
PE  0000000274a50000-0000000274a5d000   Deferred        kerberos
PE  0000000280ce0000-0000000280ce3000   Deferred        api-ms-win-core-interlocked-l1-1-0
PE  000000028d6c0000-000000028d6c3000   Deferred        api-ms-win-core-memory-l1-1-0
PE  000000028dfa0000-000000028dfac000   Deferred        nsi
PE  000000028ebe0000-000000028ebe8000   Deferred        api-ms-win-core-sysinfo-l1-2-1
PE  000000029cfc0000-000000029cfd6000   Deferred        dnsapi
PE  000000029ea80000-000000029ea87000   Deferred        api-ms-win-core-datetime-l1-1-1
PE  00000002a4090000-00000002a409e000   Deferred        wtsapi32
PE  00000002a9540000-00000002a9548000   Deferred        usp10
PE  00000002b8510000-00000002b8522000   Deferred        wintab32
PE  00000002bb750000-00000002bb894000   Deferred        comctl32
PE  00000002cc880000-00000002cc88c000   Deferred        wevtapi
PE  00000002d1070000-00000002d108a000   Deferred        cryptnet
PE  00000002d23f0000-00000002d2417000   Deferred        credui
PE  00000002d4d40000-00000002d4d58000   Deferred        bcrypt
PE  00000002d5140000-00000002d5143000   Deferred        api-ms-win-core-file-l2-1-0
PE  00000002de970000-00000002de9a3000   Deferred        rsaenh
PE  00000002e1360000-00000002e1363000   Deferred        api-ms-win-core-processenvironment-l1-1-0
PE  00000002e3540000-00000002e3591000   Deferred        shlwapi
PE  00000002e8f10000-00000002e902c000   Deferred        ole32
PE  00000002edf00000-00000002ee16d000   Export          dxgi
PE  00000002f1fa0000-00000002f1fae000   Deferred        version
PE  00000002f3920000-00000002f3930000   Deferred        esent
PE  00000002f7230000-00000002f725f000   Deferred        uxtheme
PE  00000002f7f20000-00000002f7f2c000   Deferred        vcruntime140_1
PE  00000002fa030000-00000002fa037000   Deferred        api-ms-win-core-localization-obsolete-l1-2-0
PE  00000002fa6b0000-00000002fa6b3000   Deferred        api-ms-win-core-console-l1-1-0
PE  00000003001a0000-00000003001a3000   Deferred        api-ms-win-core-processthreads-l1-1-0
PE  0000000306e10000-0000000306e13000   Deferred        api-ms-win-core-timezone-l1-1-0
PE  000000030a950000-000000030a9c2000   Deferred        dwrite
PE  000000030c980000-000000030c983000   Deferred        api-ms-win-core-synch-l1-2-0
PE  00000003126f0000-0000000312709000   Deferred        shcore
PE  000000031f800000-000000031f8ff000   Deferred        comdlg32
PE  0000000327020000-0000000327072000   Deferred        combase
PE  000000032a700000-000000032a72a000   Deferred        sechost
PE  0000000330260000-00000003302a0000   Deferred        advapi32
PE  0000000330a70000-0000000330aa9000   Deferred        uiautomationcore
PE  000000033a7c0000-000000033a7c3000   Deferred        api-ms-win-core-profile-l1-1-0
PE  000000033ea00000-000000033ea04000   Deferred        api-ms-win-crt-string-l1-1-0
PE  000000033f0c0000-000000033f0c3000   Deferred        api-ms-win-core-heap-l1-1-0
PE  00000003422e0000-000000034237c000   Deferred        urlmon
PE  0000000344840000-0000000344843000   Deferred        api-ms-win-crt-filesystem-l1-1-0
PE  0000000346ba0000-0000000346bc1000   Deferred        jsproxy
PE  0000000350a30000-0000000350a34000   Deferred        api-ms-win-crt-convert-l1-1-0
PE  0000000351680000-0000000351688000   Deferred        api-ms-win-core-localization-l1-2-1
PE  0000000353520000-0000000353523000   Deferred        api-ms-win-core-localization-l1-2-0
PE  0000000358120000-0000000358166000   Deferred        winhttp
PE  0000000359050000-00000003593eb000   Export          d3d11
PE  0000000361450000-0000000361453000   Deferred        api-ms-win-core-synch-l1-1-0
PE  00000003673d0000-00000003673f8000   Deferred        netapi32
PE  0000000375610000-0000000375648000   Deferred        win32u
PE  0000000376c50000-0000000376c53000   Deferred        api-ms-win-core-errorhandling-l1-1-0
PE  0000000388e20000-0000000388e2e000   Deferred        userenv
PE  0000000390d90000-0000000390d93000   Deferred        api-ms-win-core-libraryloader-l1-1-0
PE  000000039c380000-000000039c391000   Deferred        msv1_0
PE  000000039cce0000-000000039cce3000   Deferred        api-ms-win-core-rtlsupport-l1-1-0
PE  00000003a0440000-00000003a04c3000   Deferred        wininet
PE  00000003a19e0000-00000003a19ef000   Deferred        ncrypt
PE  00000003a2900000-00000003a2903000   Deferred        api-ms-win-core-debug-l1-1-0
PE  00000003a37f0000-00000003a37fd000   Deferred        dcomp
PE  00000003aa4c0000-00000003aa4cc000   Deferred        dhcpcsvc
PE  00000003afd00000-00000003afd1a000   Deferred        imm32
PE  00000003b8f00000-00000003b8fc1000   Deferred        winmm
PE  00000003bb250000-00000003bb358000   Deferred        cryptui
PE  00000003be590000-00000003be5f3000   Deferred        dbghelp
PE  00007ff345a70000-00007ff345a74000   Deferred        winex11
Threads:
process  tid      prio (all id:s are in hex)
00000030 services.exe
    ["C:\windows\system32\services.exe"]
    00000034    0
    00000038    0
    00000044    0
    00000054    0
    00000068    0
    00000074    0
    00000098    0
    000000b0    0
    000000ec    0
0000003c winedevice.exe
    [C:\windows\system32\winedevice.exe]
    00000040    0
    0000004c    0
    00000050    0
    00000058    0
    0000005c    0
    000000bc    0
00000060 winedevice.exe
    [C:\windows\system32\winedevice.exe]
    00000064    0
    0000006c    0
    00000070    0
    00000078    0
    0000007c    0
    00000080    0
    00000084    0
    0000008c    0
00000090 plugplay.exe
    [C:\windows\system32\plugplay.exe]
    00000094    0
    0000009c    0
    000000a0    0
    000000a4    0
000000a8 svchost.exe
    [C:\windows\system32\svchost.exe -k LocalServiceNetworkRestricted]
    000000ac    0
    000000b4    0
    000000b8    0
000000d0 explorer.exe
    [C:\windows\system32\explorer.exe /desktop]
    000000d4    0
    000000d8    0
    000000dc    0
000000e4 rpcss.exe
    [C:\windows\system32\rpcss.exe]
    000000e8    0
    000000f4    0
    000000f8    0
    000000fc    0
    00000100    0
    00000104    0
    00000170    0
0000010c tabtip.exe
    ["C:\windows\system32\tabtip.exe"]
    00000110    0
    00000114    0
    0000011c    0
0000014c (D) C:\Program Files\Electronic Arts\EA Desktop\EA Desktop\EALaunchHelper.exe
    ["C:\Program Files\Electronic Arts\EA Desktop\EA Desktop\EALaunchHelper.exe"]
    00000150    0 <==
    0000015c    0
00000160 explorer.exe
    [C:\windows\system32\explorer.exe /desktop]
    00000164    0
    00000168    0
    0000016c    0
00000174 tabtip.exe
    ["C:\windows\system32\tabtip.exe"]
    00000178    0
    0000017c    0
    00000180    0
System information:
    Wine build: wine-7.0.r0.g2fc92f8b ( TkG Staging )
    Platform: x86_64
    Version: Windows 10
    Host system: Linux
    Host version: 6.6.11-200.fc39.x86_64

To Reproduce

  1. Create new Gaming bottle
  2. Install Programs
  3. Select 'EA Launcher' from list
  4. Run through installation process
  5. Launch EALauncher (or EA Client), results in crash

Package

Flatpak from Flathub

Distribution

Fedora release 39

Debugging Information

Official Package: true
Version: '51.10'
DE/WM: gnome
Display:
    X.org: true
    X.org (port): :0
    Wayland: true
Graphics:
    vendors:
        nvidia: &amp;id002
            vendor: nvidia
            envs:
                __NV_PRIME_RENDER_OFFLOAD: '1'
                __GLX_VENDOR_LIBRARY_NAME: nvidia
                __VK_LAYER_NV_optimus: NVIDIA_only
            icd: ''
            nvngx_path: null
        amd: &amp;id001
            vendor: amd
            envs:
                DRI_PRIME: '1'
            icd: /usr/lib/x86_64-linux-gnu/GL/vulkan/icd.d/radeon_icd.x86_64.json:/usr/lib/i386-linux-gnu/GL/vulkan/icd.d/radeon_icd.i686.json
    prime:
        integrated: *id001
        discrete: *id002
Kernel:
    Type: Linux
    Version: 6.6.11-200.fc39.x86_64
Disk:
    Total: 33665585152
    Free: 33665421312
RAM:
    MemTotal: 62.7GiB
    MemAvailable: 19.3GiB
Bottles_envs: null

Troubleshooting Logs

flatpak run com.usebottles.bottles
12:45:55 (ERROR) Unable to load libGLX_nvidia.so.0 
12:45:55 (WARNING) Unable to locate libGLX_nvidia 
12:45:56 (INFO) Bottles Started! 

(bottles:2): Gtk-WARNING **: 12:45:56.366: AdwViewSwitcher 0x55e9e5328de0 (viewswitcher) reported min height -6, but sizes must be >= 0
12:45:56 (INFO) Performing Bottles checks… 
12:45:56 (INFO) Dxvks found:
     - dxvk-2.1-1-977669c
     - dxvk-2.3

12:45:56 (INFO) Vkd3ds found:
     - vkd3d-proton-2.8-1-b7fb41b
     - vkd3d-proton-2.11

12:45:56 (INFO) Nvapis found:
     - dxvk-nvapi-v0.6.2-1-742b17c
     - dxvk-nvapi-v0.6.4

12:45:56 (INFO) Latencyflexs found:
     - latencyflex-v0.1.1

12:45:56 (INFO) Runners found:
     - soda-7.0-9
     - ge-proton8-25
     - GE-Proton8-25
     - ge-proton8-24
     - sys-wine-8.0.2

12:45:56 (INFO) Bottles found:
     - Winbox
     - FurMark
     - EA Desktop

12:45:56 (INFO) Catalog installers loaded 
12:45:56 (INFO) Catalog dependencies loaded 
12:45:57 (INFO) Catalog components loaded 
12:46:03 (INFO) Setting Key sync=fsync for bottle EA Desktop… 
12:46:03 (INFO) There is no running wineserver. 
12:46:04 (INFO) Launching an executable… 
12:46:04 (WARNING) Windows path detected. Avoiding validation. 
12:46:04 (INFO) Using Wine Starter -- run 
12:46:04 (ERROR) Unable to load libGLX_nvidia.so.0 
12:46:04 (WARNING) Unable to locate libGLX_nvidia 
12:46:05 (INFO) Using EasyAntiCheat runtime 
12:46:05 (INFO) Using BattlEye runtime 
fsync: up and running.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
002c:err:wineboot:process_run_key Error running cmd L"C:\\windows\\system32\\winemenubuilder.exe -r" (2).
00d4:err:ole:apartment_getclassobject DllGetClassObject returned error 0x80040111 for dll L"C:\\windows\\system32\\ieframe.dll"
0158:err:module:hacks_init HACK: setting LIBGL_ALWAYS_SOFTWARE.
info:  Game: EALaunchHelper.exe
info:  DXVK: v2.3
info:  Vulkan: Found vkGetInstanceProcAddr in winevulkan.dll @ 0x3b6dc4060
info:  Built-in extension providers:
info:    Win32 WSI
info:    OpenVR
info:    OpenXR
info:  OpenVR: could not open registry key, status 2
info:  OpenVR: Failed to locate module
info:  Required Vulkan extension VK_KHR_surface not supported
err:   DxvkInstance: Required instance extensions not supported
err:   D3D11CreateDevice: Failed to create a DXGI factory
wine: Unhandled page fault on read access to 0000000000000020 at address 00000002EDF929C8 (thread 0158), starting debugger...

Additional context

It seems that if you have multiple graphics at boot time and one of the GPUs (in this case the Nvidia card) is passed through to a virtual machine (PCIe passthrough) bottles still thinks this card can be used. There should be a global option for bottles to select the graphics card to be used for acceleration.

BentHaase commented 6 months ago

The problem seems to be this assumption: https://github.com/bottlesdevs/Bottles/blob/158fac515cfd34c3ea0768a9800a9b8facbd665a/bottles/backend/utils/gpu.py#L62-L70

There should definitely be a global option to manually select which GPU is the discrete GPU as well as selection which GPU is enabled or disabled.

landrevj commented 2 weeks ago

Also running into this issue due to my vfio setup. Would be great to have some way to point it at the desired GPU.