lutris / lutris

Lutris desktop client
https://lutris.net
GNU General Public License v3.0
7.83k stars 690 forks source link

Battle.net Launcher not rendered correctly with GIT pull from master Feb 10 2024 #5304

Closed OJ2024 closed 8 months ago

OJ2024 commented 8 months ago

GPU field on preferences -> global options -> enable Advanced was set to match the gpu and not left on Auto. Confirm on system options tab for battle.net that the value was set correctly. Launch battle,net and the battle.net launcher is a black window.

Normal launch output with 0.5.16 (nvidia proprietary set as the vulkan ICD loader):

NFO     2024-02-10 13:08:57,188 [application.do_command_line:479]:Starting Lutris 0.5.16
INFO     2024-02-10 13:08:57,189 [startup.get_drivers:54]:Using NVIDIA drivers 550.40.07 for x86_64
INFO     2024-02-10 13:08:57,189 [startup.get_drivers:58]:GPU: NVIDIA GeForce RTX 4070 Ti
INFO     2024-02-10 13:08:57,189 [display.display_gpu_info:78]:GPU: 10DE:2782 10DE:16E1 (nvidia drivers)
DEBUG    2024-02-10 13:08:57,416 [xrandr._get_vidmodes:16]:Retrieving video modes from XrandR
DEBUG    2024-02-10 13:08:57,591 [lutris.get_missing_game_ids:206]:Checking for missing games
DEBUG    2024-02-10 13:09:01,288 [xrandr._get_vidmodes:16]:Retrieving video modes from XrandR
Started initial process 519722 from /home/jhu/.local/share/lutris/runners/wine/wine-ge-8-26-x86_64/bin/wine /home/jhu/Games/battlenet/drive_c/Program Files (x86)/Battle.net/Battle.net.exe --exec=launch WoW
Start monitoring process.
wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
[0210/130905.343:ERROR:network_change_notifier_win.cc(143)] WSALookupServiceBegin failed with: 0
[0210/130905.398:ERROR:network_sandbox.cc(302)] Failed to grant sandbox access to cache directory C:\users\jhu\AppData\Local\Battle.net\BrowserCaches\common\Cache\Cache_Data: Procedure not found. (0x7F)
[0210/130905.398:ERROR:network_sandbox.cc(396)] Failed to grant sandbox access to network context data directory C:\users\jhu\AppData\Local\Battle.net\BrowserCaches\common\Network: Success. (0x0)
[0210/130905.399:ERROR:network_service_instance_impl.cc(270)] Encountered error while migrating network context data or granting sandbox access for C:\users\jhu\AppData\Local\Battle.net\BrowserCaches\common\Network. Result: 6: Success. (0x0)
[0210/130906.885:ERROR:dxva_video_decode_accelerator_win.cc(1459)] DXVAVDA fatal error: could not LoadLibrary: msvproc.dll: Module not found. (0x7E)
[0210/130906.896:ERROR:network_change_notifier_win.cc(143)] WSALookupServiceBegin failed with: 0
wine client error:5cc: [0210/130931.565:INFO:cef_logging.h(644)] BNET, sending query, close window
wine client error:5d4: wine client error:1f4: Initial process has exited (return code: 0)
Monitored process exited.
Exit with return code 0

output running git:

jhu@FrankenMint:~/AppImages/lutris/bin$ ./lutris -d
INFO     2024-02-10 13:13:29,600 [application.do_command_line:479]:Starting Lutris 0.5.16
INFO     2024-02-10 13:13:29,707 [startup.run_all_checks:114]:NVIDIA GeForce RTX 4070 Ti (10DE:2782 10DE:16E1 nvidia) Driver 550.40.07
DEBUG    2024-02-10 13:13:29,928 [xrandr._get_vidmodes:16]:Retrieving video modes from XrandR
DEBUG    2024-02-10 13:13:30,093 [lutris._update_missing_games:238]:Checking for missing games
DEBUG    2024-02-10 13:13:34,676 [xrandr._get_vidmodes:16]:Retrieving video modes from XrandR
Started initial process 524870 from /home/jhu/.local/share/lutris/runners/wine/wine-ge-8-26-x86_64/bin/wine /home/jhu/Games/battlenet/drive_c/Program Files (x86)/Battle.net/Battle.net.exe --exec=launch WoW
Start monitoring process.
wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
[0210/131338.805:ERROR:network_change_notifier_win.cc(143)] WSALookupServiceBegin failed with: 0
[0210/131338.902:ERROR:network_sandbox.cc(302)] Failed to grant sandbox access to cache directory C:\users\jhu\AppData\Local\Battle.net\BrowserCaches\common\Cache\Cache_Data: Procedure not found. (0x7F)
[0210/131338.902:ERROR:network_sandbox.cc(396)] Failed to grant sandbox access to network context data directory C:\users\jhu\AppData\Local\Battle.net\BrowserCaches\common\Network: Success. (0x0)
[0210/131338.903:ERROR:network_service_instance_impl.cc(270)] Encountered error while migrating network context data or granting sandbox access for C:\users\jhu\AppData\Local\Battle.net\BrowserCaches\common\Network. Result: 6: Success. (0x0)
[0210/131339.977:ERROR:network_change_notifier_win.cc(143)] WSALookupServiceBegin failed with: 0
[0210/131340.283:ERROR:dxva_video_decode_accelerator_win.cc(1459)] DXVAVDA fatal error: could not LoadLibrary: msvproc.dll: Module not found. (0x7E)
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  156 (NV-GLX)
  Minor opcode of failed request:  43 ()
  Serial number of failed request:  413
  Current serial number in output stream:  414

This would happen in 0.5.16 if the vulkan ICD loader was not correctly selected or left on unspecified

If the GPU is left on Auto, the battle.net launcher renders correctly

danieljohnson2 commented 8 months ago

OK, I've run this down. It's setting the __NV_PRIME_RENDER_OFFLOAD env-var, which also causes games to crash (for me). This used to be gated behind the "prime" option that was off by default.

I've restored this option in a consolidated form- one switch ("Use discrete graphics") activates NVidia and not-NVidia prime modes, and chooses based on your GPU choice. ("Auto" won't work- it will warn if you try. It needs to know the GPU to know how to activate this stuff).

The option is again off by default, and it's an advanced option now.

@OJ2024, do download a new master and run the bin/lutris script (no need to install). If this option is off, do you still have the error?

danieljohnson2 commented 8 months ago

On reflection, I've cut this option down to 'Enable NVIDIA Prime Render Offload'- it really just enables that crashy env-var only now. Should still work for you, I expect.

danieljohnson2 commented 8 months ago

Sorry, @strycore has asked I revert these changes. We're back to where we were. We'll have to find some other way to avoid this crash.

In any case, if you have only a single GPU, Auto should work.

strycore commented 8 months ago

If the GPU is left on Auto, the battle.net launcher renders correctly

Why don't you leave it on Auto then.

strycore commented 8 months ago

The crash isn't real.

image

danieljohnson2 commented 8 months ago

It's not every game. Amid Evil fails, Batman: Arkham City does not.

Interesting- Amid Evil fails only with the -dx12 option. Maybe an RTX thing?

strycore commented 8 months ago

Screenshot_20240217_145555

OJ2024 commented 8 months ago

So solution is leave it on Auto - close this then?

strycore commented 8 months ago

the solution is to not let people set anything other than auto if there's only 1 GPU

danieljohnson2 commented 8 months ago

Can't we just do "condition": len(GPUs)>2? Seems like this should be simple.

strycore commented 8 months ago

yes, it's that simple.

I would also consider not adding the options that fail the condition to the GUI instead of having them grayed out.

danieljohnson2 commented 8 months ago

I'll go ahead and put the "condition" in.

It may be better just to do that- if the control is grayed out, then the "reset" button can be used in case a stale, bad setting is found in there. Though that should only happen to git-master users, I think.

danieljohnson2 commented 8 months ago

OK, it's in. @OJ2024, you'll need to reset back to Auto, but the setting's reset button should allow you to do this.

strycore commented 8 months ago

then the "reset" button can be used in case a stale, bad setting

That should not be a possibility. Any option that has a condition should check twice, once for enabling the option in the GUI and once when applying the option when running a game. If an option doesn't do that, it's broken.

danieljohnson2 commented 8 months ago

And you don't want it to even be possible to correct the config?

I find you quite inscrutable.

strycore commented 8 months ago

It shouldn't matter what the config is. If the option doesn't fulfill the condition, it should never be applied. It is not up to the user to fix anything, Lutris should do the correct thing by default.

danieljohnson2 commented 8 months ago

I'll put the checks in, but I think this is a fragile approach.

strycore commented 8 months ago

how is that fragile? it's the complete opposite, it's a lot more robust that other alternatives and letting users completely mess up their installs.

OJ2024 commented 8 months ago

Multi-gpu - auto fails when launching World of Warcraft from the launcher, but battle.net client is displayed as normal set the gpu to nvidia, and the battle.net launcher does not render gpu is greyed out on single gpu system

danieljohnson2 commented 8 months ago

You are relying on me getting this right- not missing a check.

Allowing the users to fix the config provides an option for them if I do not get this right. Sure I should revert that, so they can't fix their configs?

danieljohnson2 commented 8 months ago

@OJ2024, it sounds like the "NVidia" setting would not work for World of Warcraft because you could not use the launcher. Is that right?

OJ2024 commented 8 months ago

correct - I expect if I could see the launcher and could launch WoW, it would actually run just check with 0.5.16 on this same setup with nvidia explicitly selected as the vulkan ICD loader and it runs

OJ2024 commented 8 months ago

Ghostwire Tokyo through EGS runs multi-gpu set to auto

danieljohnson2 commented 8 months ago

Right- 0.5.16 has the complicated business with four different settings; the right combination can make this work. But I also agree with @strycore that that was a mess and a simpler GPU selection was needed.

I think the work-around for WoW might just be setting the env-vars directly. Not sure what you need here- maybe DRI_PRIME=1 would be enough?

If that won't do, maybe adding VK_DRIVER_FILES=/usr/share/vulkan/icd.d/nvidia_icd.json as well might do it.

strycore commented 8 months ago

Allowing the users to fix the config provides an option for them if I do not get this right. Sure I should revert that, so they can't fix their configs?

Lutris is meant for gamers, not computer engineers, they shouldn't even have the concept of "fixing" their config because Lutris should never have a broken config to begin with.

On the other hand, you are a computer engineer and it's your role to not mess this up.

danieljohnson2 commented 8 months ago

You think I don't write bugs? Really?

strycore commented 8 months ago

It's not up to the users to fix bugs, especially not when they are using lutris and trying to play games. I'm not asking for the moon, I'm just asking to check options with conditions twice like Santa Claus and his list.

strycore commented 8 months ago

We're not writing software with the preconception of it having bugs and having ways to workaround bugs in the UI.

danieljohnson2 commented 8 months ago

If you really believe demanding perfection of me will work, then you can revert commit 6425cea. That's the one that allows resetting disabled options. Your call.

OJ2024 commented 8 months ago

Well tried all those options - plus everything else I can think of - same X Error of failed request: BadMatch (invalid parameter attributes) with all combinations - OW2 won't launch either. I was also testing EGS - on Auto it runs on the igpu, set to nvidia it also gives the X error and black screen

strycore commented 8 months ago

If you really believe demanding perfection of me will work

I expect anyone contributing code to Lutris to push code that works. I'm not sure if it has to be perfect but it should at the very least not have known issues.

you can revert commit https://github.com/lutris/lutris/commit/6425cea19dcfaf1296345f7f757a4e03c9b12865. That's the one that allows resetting disabled options

I didn't say anything about resetting options. I said we should check options with condition twice and possibly not display the option at all.

strycore commented 8 months ago

@OJ2024 how many GPUs do you have?

What GPUs do you have?

OJ2024 commented 8 months ago

1 AMD 6700 xt 1 nvidia 4070 ti 7700x or 7800x3D igpu 2 separate systems

strycore commented 8 months ago

I have a 7800X3D as well but the iGPU is disabled. Should I enable it and put myself in a tri-GPU type of situation?

strycore commented 8 months ago

X error

are you not running Wayland?

danieljohnson2 commented 8 months ago

Oh, that's a good point. This Prime offload stuff works differently on Wayland I read; and I'm running X11 right now also so that may be why it won't repro for you.

I should see if I can repro on Wayland.

OJ2024 commented 8 months ago

Can easily switch to wayland - brb

danieljohnson2 commented 8 months ago

That's it; it works just fine on Wayland. I should have thought of that!

OJ2024 commented 8 months ago

Yeah can confirm here it runs fine on Wayland

danieljohnson2 commented 8 months ago

Hilarious. An X11 bug with an easy workaround in at least most cases. :shrug:

strycore commented 8 months ago

It's 2024 and there are less and less reasons to run Xorg. As time passes, I have more and more things breaking with Xorg which is why I've permanently switched to Wayland.

Sure, Lutris crashes a lot more, but this forces us to fix our code which was bad to begin with.

danieljohnson2 commented 8 months ago

We need to support X11 still.

You can condemn your own code for not responding quickly every single time, and you can try to mitigate that - but you are the exception here. Other software will just crash on Wayland.

And that will keep many users on X11 until it gets fixed in some more serious way.