Jump to content

Linux gaming technical discussion

Recommended Posts

Posted (edited)

This is a thread meant for Linux gaming experts who have been helping me via email to help decide on the best configuration for doing old game testing in Linux.  I've gotten some conflicting information, so this is an effort to sort it out.  Here's a recap of what I'm trying to do:

 

GOALS / SYSTEM INFO:

•Test compatibility on a battery of games, all 3D accelerated, from about 1997 - 2010.  They'll be DirectX 5 - 9 games with maybe a couple OpenGL titles.  A fair portion of these titles will be obscure and unlikely to be in many game databases.  None of them will be Steam or GOG copies, only disc originals (some with DRM cracks).

 

•I wish to force mixed mode antialiasing (MSAA+SSAA for alpha textures) or SSAA on as many titles as I can.

 

•I wish to measure the framerate on as many titles as I can.  This means disabling vsync for benchmarking, though it would be nice to be able to turn it back on when I'm not also.

 

•The machine I'm using has a FX-8350 CPU and a Geforce 770 GPU.  I have a weaker AMD GPU card also I could use, but my initial research showed a wider range of antialiasing compatibility for Nvidia GPUs on Linux.  I currently have Ubuntu Mate installed.

 

I was using PlayonLinux and was having disappointing performance on many older titles.  I've since been told I should be using Luttris.  What I'm looking for is to collectively come up with a COMPLETE guide for everything I should do from a new install to having a solid set up.  I was starting to make a checklist when I got all the Lutrris info and discovered WINE was forcing Adaptive VSYNC on me, which sent me back to the drawing board.   Here was my checklist so far:

 

 

 

Checklist


INSTALL PLAYONLINUX
Open Ubuntu Software Center / PLayonLinux should be listed / install
ALSO
make sure more recent WINE versions are installed for additional features
Go to tools / manage WINE versions / install at least 4.0 and up to have Nvidia framerate monitoring (x86 versions for my purposes)
ALSO
When installing a new WINE install under PlayonLinux, check "use another version of WINE" to manually select the newer version, otherwise it can default to an older one.
If program fails to install, rebooting is recommended


NVIDIA DRIVERS:
System / Administration / Software & Updates / Additional Drivers
If 415 or newer are unavailable, open terminal and type
sudo add-apt-repository ppa:graphics-drivers/ppa


ENABLE ANTIALIASING:
System / Administration / Nvidia X Server Settings / X Screen 0 / Antialising Settings / Override Application Settings / (set value)
(anisotropic filtering is in the same menu)
also
In PlayonLinux, right click on game profile / Registry editor /
In HKEY_CURRENT_USER/Software/Wine/Direct3D/, (create directory if needed) create new string "OffscreenRenderingMode" and set to "backbuffer"


INSTALL CD EMULATOR
In terminal type:
sudo apt-get install furiusisomount


KILL OPTION:
Create a script to forcibly shutdown WINE on a timer for games that lock up the system and controls when enabling AA.  Recommended to run the script ahead of time when forcing AA on an untested game.
Create text file named "kill.sh" or anything .sh
In it, add the following:

#!/bin/bash
sleep 30
for KILLPID in `ps ax | grep '.exe' | awk ' { print $1;}'`; do
  kill -9 $KILLPID;
done
With "sleep 30" meaning 30 seconds, change time if desired.


FRAMERATE MONITORING
Make sure Nvidia drivers 415 or newer are installed.
System / Administration / Nvidia X Server Settings / X Screen 0 / OpenGL Settings / check Enable Graphics API Visual Indicator


VSYNC ON:
System / Administration / Nvidia X Server Settings / X Screen 0 / OpenGL Settings / Sync to Vblank on
also
Press F2, type mate-tweak
Select Windows / set Window manager to Marco (Compton GPU Compositor)
possibly reboot


FRAMERATE MONITORING OPTION FOR STUBBORN GAMES WHERE IT DOESN'T WORK:
In playonlinux game directory type:
WINEDEBUG=ddraw wine ./bin/nameofgame.exe 2>&1 | grep --line-buffered -i "trace:ddraw:ddraw_surface7_Flip" | pv --line-mode --rate --timer -f 1>/dev/null
 

 

 

Obviously, some of this information is outdated, but I thought it was worth listing here for the parts I did get correct.

 

Anyway, please give me your detailed step-by-step instructions / suggestions for trying to get these games to run.  For example, maybe I should try Luttris in DXVK mode FIRST, but then if that doesn't work for a game, THEN try Playonlinux, etc.  Be as specific as you need to.  Alternately, if you disagree with advice someone else is giving, by all means, feel free to discuss it here.  You only need to "dumb down" the final instructions directed towards me, you can be as technical as you like towards each other. 

 

Thanks in advance for the help and if you're not particularly knowledgeable about Linux gaming, please refrain from posting in this thread.  I'm trying to cut down on the casual chatter here and focus just on the technical aspects of getting things working.

 

 

WHAT I CURRENTLY NEED HELP WITH

 

•Turning off adaptive Vsync in WINE.  It's been suggested to me that I should install libstrangle, which requires me to compile it myself.  It's also been suggested I disable Nvidia DRM, though someone else was claiming that would only work for Opteron setups.  I have no idea which route I should be pursuing, so I would appreciate some clarification here.

 

•Full installation / setup guide to Luttris for the types of games I'm testing (DirectX 5 - 9, mostly, many of which aren't in a Linux database).  Advice on what cases this is likely to be better, worse, etc.

 

•One person suggested dgvoodoo for getting antialiasing working on games it doesn't function on normally.  I think initial testing made this look like it was unlikely to help in most scenarios.  Any clarification on this + instructions for getting it working if it is in fact, recommended.

 

•For older games that only run at 4x3 resolutions, what is the recommended method to run these in full screen mode on a widescreen monitor with proportional stretching (in other words, the image will be scaled accordingly and not distorted horizontally)?

 

•(low priority) when forcing SSAA, I noticed on at least one title, it led to blurring above and beyond what you normally get from SSAA (all AA has a little bit of blur due to its nature, this was beyond that).  In situations this occurs in, are there any "sharpening" graphics options to counteract it?  If it helps, the title I remember this happening in was Warhammer: Mark of Chaos.

 

Edited by Ross Scott

Share this post


Link to post

Sorry for hijacking the thread, but if there's any info on how to turn off billinear filters \ get pixel perfect scaling (I forgot the term for it), it would be nice to have some info on it, it would be useful for games like StarCraft, where the game is just a blurry mess.

Share this post


Link to post
3 minutes ago, RaTcHeT302 said:

Sorry for hijacking the thread, but if there's any info on how to turn off billinear filters \ get pixel perfect scaling (I forgot the term for it), it would be nice to have some info on it, it would be useful for games like StarCraft, where the game is just a blurry mess.

That's alright, you reminded me of another thing I wanted to mention, I'm adding it to the original post.

Share this post


Link to post
Posted (edited)

Some preliminary points:

  • the adaptive vsync issue Ross discovered really seems like it could be very well behavior baked into Wine itself. It'd be prudent to test and determine this as soon as possible, possibly by contacting Wine devs and try to get a patch for Wine made that addresses it.
  • I think we should try to categorize all the games we'll be dealing with, because different types of games will require slightly different approaches depending on the graphics API used and other various nuances in the implementation. I imagine we'll have to tackle a lot of games on a case to case basis so it's important that solutions found in such manner will be correctly classified so they can be reused for others. Like for example as Ross mentions, some games actually benefit from going the whole dgvoodoo + DXVK route but a lot probably wouldn't.
  • Regarding the 4:3 thing, I suspect using Proton would be best since it has fullscreen scaling built in, unless vanilla Wine has finally got that upstreamed. Assuming there isn't a game-specific patch on http://www.wsgf.org/ of course.
  • I do think Lutris should be used as the "base of operations" because it has the best per-game configuration options, including an option of easily enabling DXVK. The only thing it misses is an easy way to make prefixes, but it's not like it's hard to make prefixes, even from a terminal.

I'll write more when I have time and as I collect my thoughts.

 

Edit: also I see nothing wrong with your checklist so far btw, Ross, seems like a reasonable starting point

Edited by qptain Nemo

Share this post


Link to post
Posted (edited)

Okay just as I wrote I see nothing wrong with that checklist I found some nitpicking material. I'd modify the kill wine script as follows

Quote

 

#!/bin/bash
sleep 30
for KILLPID in `ps ax | grep -i '.exe' | awk ' { print $1;}'`; do
  kill -9 $KILLPID;
done

killall -I -s KILL -v wineserver

 

Rationale:

  • wineserver doesn't have .exe in its name and it's better to make sure it's not still hanging and is killed together with the rest
  • the name of the game's executable might be in all caps so grep without -i won't catch it
Edited by qptain Nemo
oops, screwed up the syntax of kill because i always use killall wrapped in my own script

Share this post


Link to post
1 hour ago, qptain Nemo said:
  • I think we should try to categorize all the games we'll be dealing with, because different types of games will require slightly different approaches depending on the graphics API used and other various nuances in the implementation. I imagine we'll have to tackle a lot of games on a case to case basis so it's important that solutions found in such manner will be correctly classified so they can be reused for others. Like for example as Ross mentions, some games actually benefit from going the whole dgvoodoo + DXVK route but a lot probably wouldn't.

 

What I'm looking for is almost a flowchart process.  In other words, something like

 

Step 1: Try X software with Y settings.

Step 2: If X software is unsuccessful, try Z software with X1 settings, etc.

Step 3: If game is DirectX 7, try X2 software with Y2 settings, etc.

 

I'm looking for a "general procedure" to follow that I can apply to any random game of the type mentioned (DX5 - DX9, 3D accelerated, possibly too obscure to have existing documentation).  So I'm not expecting one piece of software or one setting to work with everything, but I want to be as prepared as possible with my procedure to get the game working.  It's fine if you want to list a different process for a game that already is in an existing database v. one that's not.  Now beyond that, there's also game-specific fixes, but that's a deeper level I can document elsewhere that people can help with later if you want (I can email about that).  For now, I'm just trying to nail down a general process.

 

 

 

 

 

Share this post


Link to post
Posted (edited)

Hello everyone. It's been a long time since I've used a forum, so forgive me if my etiquette is a little rusty.

 

This post may get a little long, but I'd like to address as much as I possibly can with all the information I have. I'd also like to suggest that we put in explanations on every terminal command that we post on this thread, as that will make it a lot easier for newbies to understand what they're actually doing. I think the best way is to have a commented out part after the command, so we can roughly explain what we're trying to achieve. Now for the actual post...

 

Wine, V-sync, and libstrangle

 

Spoiler

 

I'll start off by saying that, after the intensive testing I've conducted, I'm fairly certain that the Wine V-Sync issue is game specific and not likely a problem with Wine. To clarify, I've run Messiah (one of the games Ross was having the issue with) and confirmed that it indeed was using V-Sync even when the Nvidia settings had it disabled. I thought my compositor (Kwin) might have been playing a role, but disabling it did nothing. I tried multiple Wine versions in Lutris (tkg-protonified-4.6-x86_64, staging-3.8-i386, staging-2.21-i386) and still the problem remained, with Nvidia's built-in performance indicator not even working on version 2.21. I then tested Medal of Honor: Allied Assault (MoHAA) on those very same Wine prefixes, as they have similar system requirements in GoG (DirectX7 minimum on the GPU), which I assumed meant similar DX versions. Shockingly, MoHAA did not exhibit the V-Sync issue, and even had the indicator working in staging-2.21. All I can conclude from this is that the game itself must have some code that is forcing V-Sync on unless something on the driver side says "no".

 

After testing for many possibly solutions, I remembered libstrangle had options regarding forced V-Sync. I tried it out, and sure enough, I could now get 160FPS in Messiah (up  from 75 with V-Sync on). Typically, you need to run "VSYNC=0 strangle <game executable>" to do this, but with Lutris, it's actually the other way around. For anyone new to Lutris wanting to test this out: go to your game's launcher configuration, then go to the "System options" tab, scroll down until you see "Command prefix", and then type "strangle VSYNC=0" to disable V-Sync on the game. If you don't yet have libstrangle installed on your machine, and are running Ubuntu, you can follow the commands bellow to get it all setup.

 

Quote

sudo apt install git libc6-dev-i386 gcc-multilib ia32-libs      #installs dependent packages and git for downloading the source code
mkdir git && cd git                                                                               #creates a folder called "git" and enters that folder. keeping your home directory tidy
git clone https://gitlab.com/torkel104/libstrangle                  #downloads the contents of the gitlab repository into a directory with the same name
cd libstrange                                                                                        #gets into the directory we just cloned
make                                                                                                     #compiles the code
sudo make install                                                                               #installs libstrangle

 

 

 

 

Lutris
 

Spoiler

 


As for Lutris, the uninitiated may ask: what is Lutris? Lutris is a game manager that tries to be your all-in-one game launcher in Linux. Unlike PlayOnLinux, they aren't just a dedicated Wine manager, but they do that along with many other things. Why should you use Lutris over PlayOnLinux? To rip-off an AMD marketing slogan: "PlayOnLinux was great, but so was coal." One of the project goals of Lutris is to aid game preservation by making it as easy as possible to just install any game from any system. For most games, the process literally is as simple as the click of a button after Lutris is installed. On top of that, it offers many useful features such as Proton-like Wine builds, built-in DXVK support, built-in forced windowed mode, built-in support for resolution switching, and so much more! Lutris provides instructions for installation as well as for DXVK, so I'll be skipping over those and get into how you can install games.

 

The first thing you'll want to do is search for the game you want to install on Lutris's Games page. Chances are the game you're trying to install is on there, and if it is, simply go to the game's page and click "Install" on whichever version you want to install. That will open Lutris and from there you just need to follow the installer.

 

But what if the game you want to install isn't on Lutris yet? Assuming you're trying to install a Windows game in Wine:

  1. Open Lutris and click "Wine" under the "Runners" tab on the left.
  2. Click the "+" icon on the top bar and select "Add Game..."
  3. Type in the name of your game in the "Game info" tab and make sure Runner is set to "Wine (Runs Windows games)".
  4. Under "Game options" click the "Browse..." button for Wine prefix.
  5. Navigate to where you would like to install your game (Typically "/home/<your_username>/Games/").
  6. Create a folder with the name of the game, enter it, and click "OK".
  7. In "Runner options" we can set a bunch of options like enabling DXVK, selecting which Wine version to use (typically the latest tkg-protonified is fine), enabling Esync (usually desirable unless you see stuttering), forced windowed mode, forced AA, and a few other advanced features.
  8. In "System options" we can set options for changing screen resolution for games, as well as restoring our native resolution after the game is done running. It's also where we can use libstrangle under Command prefix.
  9. Once you're satisfied, hit save.
  10. Click the game icon you've just created, and then click "Wine configuration" on the right panel.
  11. Set the Windows version to whatever you feel is appropriate for the game, then hit "OK".
  12. Click "Run EXE inside wine prefix" on the right panel.
  13. Navigate to where your game's setup EXE is (be it your CD/DVD Drive or somewhere in your hard drive), and select it.
  14. Go through the installation process as normal and apply any no-CD cracks if you wish.
  15. Right click the game icon in Lutris and select "Configure".
  16. Now under "Game options", click "Browse..." for Executable.
  17. Navigate to your game installation directory (Should be "/home/<your_username>/Games/<game_name>/drive_c/<windows_install_path>/") and select your game's launch exe.
  18. Hit save.
  19. Finally, double click the game icon or click "Play" in the right panel, and your game should launch.

 

 

 

 

Forced Anti-aliasing
 

Spoiler

 

I'll admit I'm not the most experienced with this, but besides Lutris's forced AA option, you also have the ability to force both AA and Anisotropic Filtering in nvidia-settings. In both cases you want to make sure you're "Overriding Application Settings".

 

 

 

Old games and resolution

 

Spoiler

My personally preferred method for having a clean looking game is to play the game in Lutris's windowed mode. If this is not an option for you, you can have Lutris change your desktop resolution to something the game natively supports and toggle the option to "Restore resolution on game exit". For games not heavily affected by scaling, leaving everything as default should work fine.

 

 

DXVK and D9VK

 

Spoiler

 

I've used the term DXVK but not really explained what it means. Basically DXVK is a project that aims to replace Wine's built-in DirectX 10/11 to OpenGL translation layer with an DirectX 10/11 to Vulkan translation layer. The big difference is that Vulkan is that, in short, Vulkan can offer a much faster translation, which results in enhanced performance over stock Wine. DXVK is mostly for modern games, since it only works with DirectX 10 and 11. Using it in Lutris is as simple as enabling it in "Runner options".

 

D9VK is a fork of DXVK, which implements DirectX 9 support onto DXVK's codebase. The project is still in early development, so there can be a few visual glitches, but early results show a substantial improvement over Wine's DX9->OGL translation layer. The creator is hoping to eventually merge the project with DXVK once it's mature enough. Using it in Lutris is slightly more manual at the moment.

  1. Download the latest release zip from the releases page on the project's GitHub.
  2. Open the downloaded zip and navigate inside the "dxvk-release" folder.
  3. Extract the "x32" and "x64" folders into "/home/<your_username>/.local/share/lutris/runtime/dxvk/d9vk_(release_version)/".  If you don't see a .local folder, that's because folders with a dot prefix are hidden by default. Either enable showing hidden folders, or manually type it in the address bar. You can name the d9vk folder whatever you want, so long as it doesn't conflict with the DXVK folders.
  4. Back in Lutris, open your game configuration and go to "Runner options".
  5. Enable DXVK and in DXVK version type in the name of your d9vk folder. Be mindful of casing, as Linux is case sensitive.
  6. Hit save, and you should be good to go. You'll need to repeat this process with new releases of D9VK.

There's not really any project like this for older APIs, as it's more or less accepted that those games should run fast enough on modern systems.

 

 

 

 

 

Phew. I think that's everything so far. Sorry again for the extra long post.

Edited by cgalves

Share this post


Link to post

Okay, thanks for the advice so far, I'll test it when I get a chance.  Question, for D9VK, is the usual method of forcing AA still the same (setting it in the Nvidia control panel + adding the registry setting to the WINE install)?

Share this post


Link to post
17 hours ago, Ross Scott said:

Okay, thanks for the advice so far, I'll test it when I get a chance.  Question, for D9VK, is the usual method of forcing AA still the same (setting it in the Nvidia control panel + adding the registry setting to the WINE install)?

Short answer: yes.

 

Long answer: D9VK operates similarly to what's already built into Wine, by translated D3D9 calls into Vulkan calls. It doesn't require anything special for setup beyond what I delineated in my previous post. If it doesn't take forced AA, it could likely be a bug as it's still in its early days of development. Assuming you're using Lutris, you don't need to mess with the registry, as you can simply use the Anti-Aliasing option under "Runner options".

Share this post


Link to post
15 hours ago, cgalves said:

Short answer: yes.

 

Long answer: D9VK operates similarly to what's already built into Wine, by translated D3D9 calls into Vulkan calls. It doesn't require anything special for setup beyond what I delineated in my previous post. If it doesn't take forced AA, it could likely be a bug as it's still in its early days of development. Assuming you're using Lutris, you don't need to mess with the registry, as you can simply use the Anti-Aliasing option under "Runner options".

Maybe it's different on Linux, but on Windows, forcing AA has always been a crapshoot on DX9 and above.  If you know of any games where it can be forced (in other words, no in-game option to turn on AA, but it does work when forced through drivers), let me know, that could be good to confirm it's working.

Share this post


Link to post
9 minutes ago, Ross Scott said:

Maybe it's different on Linux, but on Windows, forcing AA has always been a crapshoot on DX9 and above.  If you know of any games where it can be forced (in other words, no in-game option to turn on AA, but it does work when forced through drivers), let me know, that could be good to confirm it's working.

I have a pretty big game library, so it's kind of hard for me to remember what games have what settings. Any outstanding examples you want me to test?

Share this post


Link to post
14 minutes ago, cgalves said:

I have a pretty big game library, so it's kind of hard for me to remember what games have what settings. Any outstanding examples you want me to test?

Really just anything that runs on D9VK.  Well known games might be best since they're more likely to have been tested.  It's not essential that you find one, it would just be nice to have a point of reference to ensure it works.

 

EDIT:

If you have a game that has in-game options for AA, but that's disabled, however driver-forced AA is on, that can work too (as long as it's in override mode).

Edited by Ross Scott

Share this post


Link to post
3 minutes ago, Ross Scott said:

Really just anything that runs on D9VK.  Well known games might be best since they're more likely to have been tested.  It's not essential that you find one, it would just be nice to have a point of reference to ensure it works.

 

EDIT:

If you have a game that has in-game options for AA, but that's disabled, however driver-forced AA is on, that can work too (as long as it's in override mode).

D9VK has mostly focused on Shader Models 2 and 3, IIRC. Newer games (more likely to have built-in AA) are more likely to work better on it, ATM. SM 1 is next in line, though. I can test a variety of games, but can add a known odd-ball or two if you can name them.

Share this post


Link to post

Unreal engine games are pretty common.  Maybe something like one of the Mass Effect games (or Unreal Tournament 3) would be a good test.

Share this post


Link to post
6 hours ago, Ross Scott said:

Unreal engine games are pretty common.  Maybe something like one of the Mass Effect games (or Unreal Tournament 3) would be a good test.

Alright. I'll run some tests and tag you in a post whenever I've got something.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in the community.

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.