protonscr

[TF2] Suddenly Using 100% Of CPU Power, Locking-Up The System

steamclosed MOVED: Team Fortress 2NVIDIA driversreviewed
ValveSoftware/steam-for-linux#696 · opened 2013-01-13 by Aypok · updated 2013-01-31 · 6 comments · github
AAypok 2013-01-13 github

As of Thursday/Friday (10th or 11th of January 2013; I forget which, but one of those two), TF2 and Steam have been very unreliable under Linux. As far as I'm aware, there have been no major updates to my OS (Ubuntu 12.04) which have caused this.

Firstly, TF2 kept reporting that the "server requires that you be running steam" when attempting to join a server. That was fixed yesterday (Saturday 12th) by re-installing Steam as discussed in ticket #615 . Before I updated, running "apt-cache policy steam" reported that it was at version "1.0.0.14", despite asking Steam to check for newer version (none were found). It's now at version "1.0.0.21".

The biggest problem at the moment is that, after playing for between thirty and sixty minutes, TF2 will suddenly start using 100% CPU power (of a single core), with Xorg taking 100% of another. This makes the game -- and, indeed, the whole computer -- near unusable. The sound in TF2 stutters and the frame-rate drops to updating the screen only once every three seconds (yes, I timed it).

On two occasions, normal operation resumed within a minute - every other time (pushing a dozen occurrences), I've had to change to a TTY (or attempt to load a terminal) and "kill -9" the TF2 process ("kill -15" seems to have no effect). Given that the entire system is running so slowly while this occurs, it's very frustrating.

As for the cause or common factors, I'm not sure. It mostly seems to happen at round end - but not always. Game mode, class, weapons, server, etc, seem to make no difference.

For a while, I thought I'd fixed it by my work-around for ticket #695 (when TF2 broke, I'd often be in a rush to re-join the game, so didn't reset the graphics options as explained in that ticket). That gave me about three or four hours of uninterrupted playing. When I returned (making sure to fix the V-sync issue), it broke within twenty minutes. I tried the Windows version of TF2 (under Windows 7 on the same hardware) and had no such problems.

I've made sure my OS, the Nvidia drivers (310.14) and Steam are all up-to-date (as far as I can see, they are) and have rebooted the system - yet this problem persists.

I don't know if it's related or just a coincidence, but one of my friends said that my disconnection from the server (when TF2 caused the system to effectively lock-up) was reported (to the other gamers on the server, of which my friend was one) as "Steam ticket canceled" - or something along those lines.

Edit: The information below (given by Steam), while accurate, isn't complete. My system is actually running two X servers - one for each monitor. That is probably relevant.

My system information, as reported by Steam:

Processor Information:
Vendor: GenuineIntel
Speed: 3401 Mhz
8 logical processors
4 physical processors
HyperThreading: Supported
FCMOV: Supported
SSE2: Supported
SSE3: Supported
SSSE3: Supported
SSE4a: Unsupported
SSE41: Supported
SSE42: Supported

Network Information:
Network Speed:

Operating System Version:
Ubuntu 12.04.1 LTS (64 bit)
Kernel Name: Linux
Kernel Version: 3.2.0-35-generic
X Server vendor: The X.Org Foundation
X Server release: 11103000

Video Card:
Driver: NVIDIA Corporation GeForce GTX 460/PCIe/SSE2

Driver Version:  4.3.0 NVIDIA 310.14
Desktop Color Depth: 24 bits per pixel
Monitor Refresh Rate: 59 Hz
VendorID:  0x10de
DeviceID:  0xe22
Number of Monitors:  1
Number of Logical Video Cards:  1
Primary Display Resolution:  1920 x 1200
Desktop Resolution: 1920 x 1200
Primary Display Size: 21.65" x 13.50"  (25.51" diag)
                                        55.0cm x 34.3cm  (64.8cm diag)
Primary Bus: PCI Express 16x
Primary VRAM: 1023 MB
Supported MSAA Modes:  2x 4x 8x 16x 

Sound card:
Audio device:

Memory:
RAM: 16027 Mb

Miscellaneous:
UI Language: English
LANG: en_GB.UTF-8
Microphone: Not set
Total Hard Disk Space Available: 1378032 Mb
Largest Free Hard Disk Block: 527812 Mb

Installed software:

Recent Failure Reports:

AAypok 2013-01-17 github

It's seems that I've found a quick solution to this problem. Simply change to TTY1 (I assume any other TTY will do) and then return to the Xserver - it's magically fixed. From listening to the sound, it's fixed once I change away from the Xserver (the sound stops stuttering and resumes playing correctly).

Perhaps that means the issue is with the Xserver itself and not TF2 or Steam.

While this issue is still happening, it's certainly happening a lot less frequently. I've only had it two or three times since I made the original post. Back then, it was happening once or twice per hour.

Mmikesart 2013-01-25 github

From an nVidia engineer: Could be vidmem starvation on the X side; OpenGL takes priority so TF2 can hog up a large amount of vidmem for buffers. X can then fail to allocate pixmaps in vidmem and having to resort to SW fallbacks, which are really slow. While it's busy doing that any blocking requests for input or whatever will hog the game as well.

Running two X servers is also a bad idea in this case (and in general), since the second X server will think it's all alone and that it has all of the vidmem to itself for acceleration purposes and use it liberally, which will take out a good chunk upfront.

He also recommends updating to the 313 drivers.

Not sure there is much else we can do in TF2 about this though, so I'm going to close this out. Thanks.

PPlagman 2013-01-25 github

After you update to 313.18 and if the issue persists, I recommend logging the output of 'nvidia-smi' while you're playing to see if your memory usage correlates with your performance problems.

The fact that VT-switching temporarily fixes your issue is consistent with this theory as it causes all GPU memory to be flushed away.

Thanks!

Eeisbehr 2013-01-29 github

While TF2 bugs out and drops to ~10FPS:

==============NVSMI LOG==============

Timestamp : Tue Jan 29 14:22:53 2013
Driver Version : 313.18

Attached GPUs : 1
GPU 0000:01:00.0
Memory Usage
Total : 1023 MB
Used : 289 MB
Free : 734 MB

While TF2 runs normally it looks like this:

==============NVSMI LOG==============

Timestamp : Tue Jan 29 14:18:51 2013
Driver Version : 313.18

Attached GPUs : 1
GPU 0000:01:00.0
Memory Usage
Total : 1023 MB
Used : 934 MB
Free : 89 MB

So, clearly something happens to the video memory.

PPlagman 2013-01-30 github

I'm a little confused by your output, elsbehr. You'd expect the buggy case to correlate with the card being low on memory, not the other way around. Did you swap the logs, by any chance?

Thanks!

Eeisbehr 2013-01-30 github

I did not swap them. The "normal" one was taken earlier when I started the game, the buggy one later after I managed to get the performance to go down.

Maybe it fills up the vram and then goes into some fallback from ram, which also makes the performance very bad?

EDIT: Some additional memory output http://pastebin.com/BWaCq7aZ

Nothing extracted yet.