ruanformigoni / gameimage

Gameimage - FlatImage Game Packer
Apache License 2.0
265 stars 2 forks source link

Misclassification of GPU by "Tomb Raider: Anniversary" #79

Closed Tell-Sackett closed 2 months ago

Tell-Sackett commented 5 months ago

Hardware and Environment:

Steps to Reproduce (performed throughout all of my testing):

Problem (tldr):

Problem (testing detailed summary):

  1. The process of attempting to create a flatimage of TRA was done over the course of two computer sessions, spanning two days. During both sessions the same situation with the GTX 470 occured. (*) During the first session, I attempted to perform this process, I believe, without proper proprietary Nvidia i386 drivers. During this first session I was able to download DXVK (as well as the other addon), but upon trying to either install or launch the game (apologies, I can't recall which, exactly), the process would fail, with a message stating that the game does not support DirectX12, and that I should not use the "-dx12" or "[-dx??]" (sorry, I can't remember the exact error message) flags when launching. Seeing as how I was not inputting these arguments to begin with, I reattempted the process, this time not installing "DXVK 9/10/11" or the other addon option. If I recall correctly, during these attempts, the process would fail, stating that the game required the use of Directx9. I then used the flag "-dx9" in the argument section of the executable and the game launched. However, the GTX 470 and framerate issues were present.
  2. After installing additional proprietary Nvidia i386 drivers, I got the idea of trying to run the game through Lutris. Here, after downloading the game, I was prompted with the option to launch the options menu, or the game directly. Upon choosing the options menu, I was provided with the my actual graphics card (an Nvidia RTX 2070 Super). After applying the settings, the game launched and ran very smoothly.
  3. My second attempt at packaging TRA as a flatimage was done after the Lutris testing (now with the i386 drivers). The first time, I tried to download DXVK 9/10/11. However, this process seemed to hang and would not complete. After a while, I closed gameimage and attempted another round. This second time, I couldn't even get to the DXVK page. I closed the application and tried again. This third time, I made it to the DXVK page, and upon attempting to download DXVK 9/10/11 and the other add-on, they both completed very quickly (too quickly, in fact). Upon trying to proceed to the next page, I had some more issues. After a while I came to the conclusion that during my first attempt during this session (when the application hung on the DXVK download), some processes never completed and were complicating further attempts at using the application. I went into my Process Monitor application and, indeed, found some processes still attempting to run. After killing these, I tried to package the game once more, again trying to install DXVK 9/10/11. This process ended the same as the first time this session, with the application hanging and resulting in me having to kill the orphaned processes running in the background. The last attempt I made before writing this went as follows: I went through the process again without attempting to install DXVK 9/10/11, the other add-on, making any other wine configurations, etc.; launched "tra.exe" (with no additional arguments), and was greeted with the options menu where I was only given the option of choosing a GTX 470. After applying my settings the game automatically ran, and it had the same framerate problem I was having during my first session (before installing the i386 drivers).

Additional Notes:

Thanks

ruanformigoni commented 5 months ago

Hi @Tell-Sackett , thanks a lot for the detailed information on this issue! Always feel free to post problems that you find, doesn't matter how small they might seem to be.

Let's try to determine why the game is running poorly, it could be because dxvk is not installed properly or because the GPU drivers are not properly detected by flatimage (and using the integrated graphics instead).

By default you should install dxvk to avoid using the default opengl wine backend which much slower, you can check if the game is running with dxvk by adding the environment variable DXVK_HUD with the value full, like this:

And then running the game with dxvk installed, which should show up like this:

It already shows you the graphics adapter being used to run the game, it is normal for the dxvk process to stall without any output for some time (this is done by winetricks, not gameimage). Try to restart the process with a clean build directory (remove the previous one).

If it is still not possible to use dxvk, try to create the image anyway (where it is running in a sluggish manner) and open in the terminal like this:

FIM_DEBUG=1 ./tomb-raider.flatimage

This would output information about the GPU bindings as well as the currently selected one, if possible try to post it here so I can take a look.

Tell-Sackett commented 5 months ago

Here is a summary of the process I performed, including the results. Relevant .txt files, containing terminal and log output are attached as well.

Attempt 1 (installed DXVK, set environment variable "DXVK_HUD" "full" on, as well as attempting with them off):

Attempt 2 (did not install DXVK):

Attempt 3:

I think that covered everything. Sorry for including all the .txt files as downloads; I attempted to try and work-out GitHub's dropdown-menu system, but the logs were too squished together to be readable. If you know of a better way to do this, just let me know.

ruanformigoni commented 5 months ago

Thanks a lot for this information, and sorry for the troubles. I have identified the issue, the nvidia drivers are not being properly bound to the container, you can see this by these two lines:

I :: [o] :: [wine.sh] GPU Vendor  : mesa
I :: [o] :: [wine.sh] GPU Device  : llvmpipe (LLVM 17.0.6, 256 bits)

I will setup a debian/nvidia system to try to re-create the issue from my end. Your attempt 2 works probably because the integrated graphics supports opengl and does not suport vulkan.

Tell-Sackett commented 5 months ago

Np, and thank for identifying the issue! I glanced at the outputs but was unable to understand what was being said due to my, still very limited, knowledge on this kind of thing.

In case it helps: I just recently distro-hopped to this from a well-maintained Arch spin (it's my first time running base Debian), so I hope this isn't all just a result of my incompetence in driver installation and management. I attempted to follow (and presumably succeeded in, as the "NVIDIA Settings" app is installed and functioning properly) the guide on Debian's official site for replacing the stock Nouveau drivers for Bookworm with the proprietary Nvidia ones. Of particular note are sections: 1.2.2.2 for Bookworm proprietary driver installation, 1.8.4 for replacing the Nouveau drivers, and (this last section was only followed during the middle of my first post, as noted) 1.2.3 for 32-bit driver libraries installation.

ruanformigoni commented 5 months ago

I've managed to replicate the issue on my side, it should be all fixed now. The issue was that some nvidia files on debian are symlinks to update-alternatives, so I just needed to reference that to the real file before creating a symlink from inside the container. The driver installation for my side required to run the command sudo nvidia-xconfig --egpu doc, because I'm using a thunderbolt one.

Start up with a clean build directory, re-download the files and that should do it.

Tell-Sackett commented 5 months ago

Sorry for the late response. I've been out of the house for a number of days now, and will not be back for at least another week (probably longer); sorry about that, some life stuff is going on. For reference once I do get back: I have not seen an update to the program since you made your last post; what files, exactly, should I move or symlink where?

ruanformigoni commented 5 months ago

No problem, no need to hurry. You shouldn't need to change anything, I updated the runners with the changes (the files you download in the fetch screen). So just starting fresh and building a project from scratch should work.

Tell-Sackett commented 2 months ago

Sorry for the long wait; lots of irl life changes.

Just tried it out: the game recognized my GPU, monitor refresh rate, AND ran buttery smooth!

Thanks soo much!