Thursday, 2 February 2017

Linux Graphics Drivers and LOTRO Performance

While debugging why LOTRO crashed on me in Linux, I made an important discovery which has led to a huge improvement in performance.

So, LOTRO froze while my character was just running through the Southern Bree-fields in Bree-land. I could move the mouse but the computer wouldn't respond to keyboard or mouse activity and I couldn't open a terminal or anything - I had to hard reboot the computer. The next time I logged into LOTRO, a similar thing happened to a character in Ered Luin, just running along, then the game froze and wouldn't respond. This is no good, what's going on?

I checked the PlayOnLinux debug file and found a lot of messages about a problem with wined3d - so maybe it's a DirectX graphics issue. I also googled the situation of running a Wine program that freezes and makes the computer unresponsive. Somebody suggested checking the system logs as they claimed that the problem must be deeper than Wine to cause the computer to become unresponsive. I checked the system logs (Linux Mint conveniently has a Log File Viewer available from the menu) and found a message about a PGRAPH engine fault on channel 6, then on the next line it said that lotroclient.exe was using channel 6. Then there was a message about "reboot crash terminate-all-tasks memory-full-oom-kill". So there was a memory overload? I looked up PGRAPH and found out that related to nouveau, the open source graphics driver for NVIDIA graphics cards. Someone else had got a similar error message and they were advised to check the size of their swap partition to make sure they did have plenty of memory (at least 3GB was recommended). I checked mine - I've got 8GB which should be enough. I found some bug reports for nouveau causing this issue dating back to 2014 - apparently still not fixed. Finally I found someone who said that they changed to using the proprietary NVIDIA graphics driver instead of nouveau and the problem went away - their applications didn't freeze anymore. Hooray!

They said to change graphics drivers, select the recommended NVIDIA driver from the Driver Manager (also readily available from the Linux Mint menu) and reboot. I did that and the next time I logged into LOTRO I got a message that it had detected my computer hardware could support DirectX 11 and did I want to enable it? Wine doesn't support DirectX 11 yet, so I said no and the client crashed to a black screen. Fortunately, I could close the client and do some more research. I found a report that you could go into the LOTRO UserPreferences.ini file (in the [home]/Documents/The Lord of the Rings Online folder) and change the settings about DirectX. There, I found out that my game had been running with the UseHighResolutionGameData=True. Well maybe that might account for some of my low frame rates! I set that to False. Down in the [Render] section, there were options for GraphicsCore=D3D9 (good: it's using DirectX 9, which is supported by Wine), and HavePromptedForD3D11AtStartup=False and HavePromptedForD3D10AtStartup=False. We don't want to use either DirectX10 or DirectX11, so don't prompt us - I changed them both to True to make it think it already had, saved the changes and went and launched LOTRO.

The game loaded fine and I got back into the game world and everything ran so smooth and looked better than ever! I checked the frame rate and it was at least double what I was getting before! I went from around 25-30 fps just running around to over 60 fps. I know my computer isn't the best, but that's a huge improvement.

A few weeks ago I was trying to tweak performance in LOTRO and I downloaded the free Unigine Heaven Benchmark 4.0 software for Linux. I tested my system (when it was using the nouveau driver) and was appalled - it really struggled with the animations and was very choppy. I tested it again after changing to the NVIDIA graphics driver, and the results were much better. Here's a Before and After report:

Jan 2017 - using the nouveau graphics driver
Feb 2017 - using the NVIDIA graphics driver

So, final conclusion: low frame rates and freezing in LOTRO may be a symptom that the graphics driver is not ideal. Nothing against the team behind nouveau - it's great they're developing an open-source alternative, but NVIDIA still knows how to get the best performance out of their hardware.

No comments:

Post a Comment