rockerbacon / modorganizer2-linux-installer

An easy-to-use Mod Organizer 2 installer for Linux
GNU General Public License v3.0
932 stars 77 forks source link

`EnableNonClientDpiScaling()` error on subsequent launches after 1st launch #409

Open WillsterJohnson opened 1 year ago

WillsterJohnson commented 1 year ago

Edit: if you're comfortable with the command line and don't particularly care what's running mo2 (so long as it works) I've got a repo with a guide to setting things up via proton. It works, but it's also a pain and needs a bit of technical work to set up. The repo is here, I've not touched it in a while and there may be differences due to software updates. oh, and I'm not responsible if you manage to break something.

I would 100% recommend using modorganizer2-linux-installer if it works for you. My repo isn't gonna get much in the way of support, updates, or automation, and the resulting setup is a bit fragile.


What I did:

Follow all install instructions including;

The only game I selected for setup was Skyrim SE, and that's the only game I've run since installing.

The full output from the terminal is below. I'm hand-copying from an image I took from my phone as copy/paste or screenshot on my computer was impossible (frozen OS)

INFO: read executable location 'Z'
Launching 'Z'
[<DATETIME> D] timing: MOApplication() 0 ms
[<DATETIME> D] timing: main() multiprocess 316 ms
[<DATETIME> D] command line: 'Z:\home\<MY USERNAME>\Games\mod-organizer-2-skyrimspecialedition\modorganizer2\ModOrganizer.exe'
[<DATETIME> I] starting Mod Organizer version 2.4.4 revision 1df1ea5e in Z:/home/<MY USERNAME>/Games/mod-organizer-2-skyrimspecialedition/modorganizer2, usvfs: 0.5.6.0
[<DATETIME> I] data path: C:/users/USERNAME/AppData/Local/ModOrganizer/<GLOBAL PROFILE NAME>
[<DATETIME> I] working directory: Z:/home/<MY USERNAME>/.steam/debian-installation/steamapps/common/Skyrim Special Edition
[<DATETIME> D] timing MOApplication setup() 4 ms
[<DATETIME> I] using game plugin 'Skyrim Special Edition' ('SkyrimSE', variant (none), steam id '489830') at Z:/home/<MY USERNAME>/.steam/debian-installation/steamapps/common/Skyrim Special Edition
# (the app tried to launch here, and the splash screen appeared)
[<DATETIME> E] EnableNonClientDpiScaling() failed for HWND 0x1009c (120) (Call not implemented.)
# (the app has been detected as non responsive and I'm given the option to force quit or wait)
[292:296:1018/045937.051:ERROR:dxva_video_decode_accelerator_win.cc(1399)] DXVAVDA fatal error: could not LoadLibrary: )
[292:296:1018/045937.088:ERROR:dxva_video_decode
# (my system has all but completely crashed, possibly cutting off the last output (above) before it could finish writing)

obligatory neofetch data:

OS: Pop!_OS 21.10 x86_64 
Host: L140CU 
Kernel: 5.18.10-76051810-generic
# (before crash: <5 hours)
Uptime: 21 mins 
Packages: 3382 (dpkg), 16 (flatpak), 12 (snap) 
Shell: bash 5.1.8 
Resolution: 1920x1080 
DE: GNOME 
WM: Mutter 
WM Theme: Pop 
Theme: Pop-dark [GTK2/3] 
Icons: Pop [GTK2/3] 
Terminal: gnome-terminal
# (I swear this laptop can run SkyrimSE no problem (okay ~30fps) with many mods, it did so on windows a week ago)
CPU: Intel i5-10210U (8) @ 4.200GHz 
GPU: Intel CometLake-U GT2 [UHD Graphics]
Memory: 3490MiB / 15731MiB 

info on other programs:

$: echo $0
bash
$: zenity --version
3.32.0
$: yad --version
12.0 (GTK+ 3.24.30)
# (--version did nothing for me)
$: flatpak info com.github.Matoking.protontricks

Protontricks - A simple wrapper that does winetricks things for Proton enabled
games

          ID: com.github.Matoking.protontricks
         Ref: app/com.github.Matoking.protontricks/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 1.9.2
     License: GPL-3.0
      Origin: flathub
  Collection: org.flathub.Stable
Installation: user
   Installed: 58.9 MB
     Runtime: org.freedesktop.Platform/x86_64/22.08
         Sdk: org.freedesktop.Sdk/x86_64/22.08

      Commit: fab6248ad1c2c8fc59a45c1cfc8cce914a759e1c68373d82ea1c03e0f75b9098
      Parent: 432c19aa74900c691a416b3efa55eaea68b4b9b3882756bccb4a46aba15fb901
     Subject: Update Freedesktop runtime to 22.08 (2e35f244)
        Date: 2022-09-22 16:01:03 +0000
# (MO2 Linux Installer used `wget` when installing itself)
$: wget --version
GNU Wget 1.21 built on linux-gnu.

-cares +digest -gpgme +https +ipv6 +iri +large-file -metalink +nls 
+ntlm +opie +psl +ssl/openssl 

Wgetrc: 
    /etc/wgetrc (system)
Locale: 
    /usr/share/locale 
Compile: 
    gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/etc/wgetrc" 
    -DLOCALEDIR="/usr/share/locale" -I. -I../../src -I../lib 
    -I../../lib -Wdate-time -D_FORTIFY_SOURCE=2 -DHAVE_LIBSSL -DNDEBUG 
    -g -O2 -ffile-prefix-map=/build/wget-OM48Vs/wget-1.21=. 
    -fstack-protector-strong -Wformat -Werror=format-security 
    -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall 
Link: 
    gcc -DHAVE_LIBSSL -DNDEBUG -g -O2 
    -ffile-prefix-map=/build/wget-OM48Vs/wget-1.21=. 
    -fstack-protector-strong -Wformat -Werror=format-security 
    -DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -g -Wall -Wl,-Bsymbolic-functions 
    -Wl,-z,relro -Wl,-z,now -lpcre2-8 -luuid -lidn2 -lssl -lcrypto -lz 
    -lpsl ftp-opie.o openssl.o http-ntlm.o ../lib/libgnu.a 

Other additional info:

Haven't run again since restarting after the crash, I'm about to do so but I'm going to post this first (I'm almost certain the issue is reproducable). Exact same error when running again, I'll hop back to windows for now but I'd love to have one less reason to use Windows.

SentaiBrad commented 1 year ago

I receive the same errors on the Steam Deck. Granted, MO2 still works, but as the log piles up the program performance starts to tank heavily.

WrayOfSunshine commented 1 year ago

I'm having the same issue and it also has weird things where I have to pause and resume downloads before they will start.

SentaiBrad commented 1 year ago

MO2 throws those errors regardless. It is a Wine specific issue. I did, finally, get everything up and running the way I needed it through SteamTinkerLauncher, and I still get those errors no matter what.

rockerbacon commented 1 year ago

That is caused by wine not implementing EnableNonClientDpiScaling, this project can't fix it. I can only see these options:

itspngu commented 1 year ago

Found a workaround: https://github.com/rockerbacon/modorganizer2-linux-installer/issues/467#issuecomment-1627646622

WillsterJohnson commented 1 year ago

kinda forgot about this, I've been using proton to launch the windows executable, no issues at all. works for nxm uris and shortcuts. I have made a repo with a guide specific to skyrim, mostly for my own reference. hopefully it can be of use.

edit: here

rockerbacon commented 1 year ago

The Qt documentation provides some information on DPI Awareness which may be relevant to the issue: https://doc.qt.io/qt-6/highdpi.html

rockerbacon commented 1 year ago

The aforementioned workaround does not work and I don't see why it would. According to the Qt documentation linked above and the documentation on EnableNonClientDpiScaling, Qt uses Per-Monitor DPI Aware V2 by default and under that context there is no need to use the problematic function. Besides that, according to the Qt 5 documentation, dpiawareness=2 should be the default on anything newer than Windows 8.1 and Proton prefixes should be set to Windows 10 by default.

Something funky is going. From what I can see, EnableNonClientDpiScaling shouldn't be necessary, but I can't dig deep enough into the MO2 and Qt source code to find out exactly why it is being used.

lykosfx commented 9 months ago

Oi! Bom dia!

Text Portuguese: [spoiler] O entendimento que estou recebendo, após ler os comentários...

Vocês parecem que estão olhando para o lado errado. O Windows não está fazendo nenhuma chamada, quem faz, é o Steam. Isso quer dizer que não há nenhum problema com o Código Fonte do MO2Linux e nem do Qt.

O Projeto MO2Linux não está vinculado ao launcher do Steam para utilizar os Protons? Então é o Steam quem faz a chamada para o MO2Linux, para saber quem é que está acessando os Protons.

O Usuário @itspngu deu uma solução boa, adicinar um arquivo “qt.conf” no diretório do executável ModOrganizer.exe, mas, infelizmente, não funcionou porque o Argumento era para a Plataforma Windows, que não está fazendo nenhuma chamada.

O Steam não é uma Plataforma? E quem faz a chamada não é o Steam, por ser um launcher de login? Então, adicionei um segundo Argumento no “qt.conf”…

[Platforms] WindowsArguments = dpiawareness=2 SteamArguments = dpiawareness=2 <---

Ao testar duas vezes esse procedimento, percebi que, durante o carregamento do MO2Linux, vai ocorrer três chamadas (a quantidade de chamadas, vai depender do tempo de carregamento). No final do carregamento, as chamadas param e o desempenho do Gerenciador permanece normal.

Nota: De qualquer forma, é bom que vocês programadores, façam mais testes, para saber se não está ocorrendo alguma chamada “invisível” afetando o desempenho do MO2Linux. [/spoiler]

Obrigado pela sua atenção


Hey! Good morning!

Text English: [spoiler] The understanding I am receiving, after reading the comments…

You guys look like you're looking the wrong way. Windows is not making any calls, Steam is the one who does. This means that there is no problem with the Source Code of MO2Linux or Qt.

Isn't the MO2Linux Project linked to the Steam launcher to utilize the Protons? So it is Steam who makes the call to MO2Linux, to find out who is accessing the Protons.

The user @itspngu gave a good solution, adding a “qt.conf” file to the ModOrganizer.exe executable directory, but unfortunately it didn't work because the Argument was for the Windows Platform which is not making any calls.

Isn't Steam a Platform? And isn't Steam the one making the call, because it's a login launcher? So, I added a second Argument in “qt.conf”…

[Platforms] WindowsArguments = dpiawareness=2 SteamArguments = dpiawareness=2 <---

When testing this procedure twice, I realized that, while loading MO2Linux, three calls will occur (the number of calls will depend on the loading time). At the end of loading, calls stop and Manager performance remains normal.

Note: In any case, it is good for you programmers to do more tests to see if there is any “invisible” call affecting the performance of MO2Linux. [/spoiler]

Thank you for your attention

lykosfx commented 9 months ago

Oi! Bom dia!

Text Portuguese: [spoiler] Eu fiz algumas pesquisas sobre o identificador HWND (Identificador de Janelas) que faz parte do erro da função “EnableNonClientDpiScaling()”, percebi que o Wine não deve ser o problema.

https://learn.microsoft.com/en-us/windows/apps/develop/ui-input/retrieve-hwnd

https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enablenonclientdpiscaling

https://stackoverflow.com/questions/2620409/getting-hwnd-of-current-process

https://vulkan-tutorial.com/Drawing_a_triangle/Presentation/Window_surface

Vamos pensar um pouco…

O Wine, assim como o RumTime e o Proton só vão ser ativados, quando o SKSE é Iniciado.

Quando se Inicia o SKSE, no chat, aparecem duas chamadas (provavelmente, para o RumTime e para o Proton). Após Finalizar o SKSE, no chat, aparecem mais duas Chamadas (também, provavelmente, para o RumTime e para o Proton).

A pergunta a se fazer é…

Quem está fazendo as chamadas?

Nas minhas observações, só pode ser o Steam, que é uma Plataforma ativa (24h/dia), que necessita fazer chamadas constantes.

Parece que cada botão no Steam, ativado por algum usuário, deve ativar um identificador HWND (Identificador de Janelas), para saber quem está ativando o botão (qual a ID/Registro).

Como o MO2Linux não tem uma ID/Registro na Plataforma Steam, então, ao ativar o botão para abrir a Janela MO2Linux, o identificador HWND não vai Identificar a Janela e vai ativar o erro no chat (esse erro pode estar sendo enviado para a Valve).

Se as minhas observações estiverem corretas, então é preciso fazer uma pergunta…

Os Desenvolvedores do Projeto MO2Linux, pediram permissão para a Valve, para utilizar o botão SkyrimSE, para abrir uma Janela (HWND) na Plataforma Steam, para o Gerenciador de Mods?

Se a Valve deu permissão, então os Desenvolvedores do MO2Linux deveriam entra em contato com os Desenvolvedores da Valve e criar uma ID/Registro no Steam, para que o identificador HWND possa Identificar a Janela aberta (MO2Linux).

Se esse for o caso (do MO2Linux precisar de ter uma ID/Registro no Steam), então seria mais interessante se o Projeto MO2Linux pudesse estar hospedado na própria Plataforma Steam, com a sua própria página de instalação, devido a sua dependencia dos protons da Valve.

Os Usuários do Steam, poderiam fazer uma instalação completa, com todos os pré-requisitos necessários que o MO2Linux exige, sem ter que usar o console do Linux. Isso quer dizer que, os Desenvolvedores do Projeto MO2Linux, já saberiam qual a versão do Wine, Winetricks e do Protontricks que deveriam ser instalados para o MO2Linux, com links automáticos para a pré-instalação.

Nota: Sobre a linha adicionada no arquivo qt.conf (SteamArguments = dpiawareness=2)…

Mesmo não tendo uma (.dll) na pasta “platforms” com o nome “steam”, as chamadas não estão mais aparecendo constantemente, causando o mau desempenho do MO2Linux. Para mim, isso é positivo.

Mas quando iniciamos o SKSE de 3 à 4 vezes, por estar instalando os Mods, para verificar se não estão dando erros, então, essas “chamadas constantes” voltam a ocorrer.

A solução paliativa usada, foi fechar o MO2Linux por alguns segundos e depois abrí-lo novamente. Isso quer dizer que, se o usuário iniciar o SKSE apenas 1 vez, o chat terá, no máximo, 8 chamadas. Para mim, isso é positivo. [/spoiler]

Obrigado pela sua atenção


Hey! Good morning!

Text English: [spoiler] I did some research on the HWND identifier (Window Identifier) that is part of the “EnableNonClientDpiScaling()” function error, I realized that Wine should not be the problem.

https://learn.microsoft.com/en-us/windows/apps/develop/ui-input/retrieve-hwnd

https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enablenonclientdpiscaling

https://stackoverflow.com/questions/2620409/getting-hwnd-of-current-process

https://vulkan-tutorial.com/Drawing_a_triangle/Presentation/Window_surface

Let's think a little...

Wine, as well as RumTime and Proton will only be activated when SKSE is started.

When starting SKSE, in the chat, two calls appear (probably for RumTime and Proton). After finish the SKSE, in the chat, two more Calls appear (also, probably, for RumTime and Proton).

The question to ask yourself is…

Who is making the calls?

In my observations, it can only be Steam, which is an active platform (24 hours a day), which needs to make constant calls.

It seems that each button on Steam, activated by a user, must activate an HWND identifier (Window Identifier), to know who is activating the button (what ID/Registration).

As MO2Linux does not have an ID/Registration on the Steam Platform, when activating the button to open the MO2Linux Window, the HWND identifier will not Identify the Window and will activate the error in the chat (this error may be being sent to Valve).

If my observations are correct, then a question needs to be asked…

Did the Developers of the MO2Linux Project ask Valve for permission to use the SkyrimSE button to open a Window (HWND) on the Steam Platform for the Mod Manager?

If Valve has given permission, then MO2Linux Developers should contact Valve Developers and create a Steam ID/Registration, so that the HWND identifier can Identify the open Window (MO2Linux).

If this is the case (MO2Linux needs to have a Steam ID/Registration), then it would be more interesting if the MO2Linux Project could be hosted on the Steam Platform itself, with its own installation page, due to its dependence on the Protons of Valve.

Steam Users could do a complete installation, with all the necessary prerequisites that MO2Linux requires, without having to use the Linux console. This means that the Developers of the MO2Linux Project would already know which version of Wine, Winetricks and Protontricks should be installed for MO2Linux, with automatic links for pre-installation.

Note: About the line added in the qt.conf file (SteamArguments = dpiawareness=2)…

Even though there is no (.dll) in the “platforms” folder with the name “steam”, the calls are no longer appearing constantly, causing MO2Linux to perform poorly. For me, this is positive.

But when we start SKSE 3 to 4 times, because we are installing the Mods, to check that they are not giving errors, then these “constant calls” occur again.

The palliative solution used was to close MO2Linux for a few seconds and then open it again. This means that, if the user starts SKSE just 1 time, the chat will have a maximum of 8 calls. For me, this is positive. [/spoiler]

Thank you for your attention

Dark-Thoughts commented 1 month ago

Found a workaround: #467 (comment)

Doesn't seem to work for me.