4

I experience weird fps drops while playing games, mostly with Wine.

Some tested games:

  • Hearthstone - fps drops happens pretty often; interesting fact is that while browsing cards every page needs to be loaded for few seconds and after that you can choose it without the delay - even after game restart; could also be true that the whole game works a bit better after restarting.
  • StarCraft 2 - fps drops do happen - sometimes while moving units for example;
  • Skyrim - problem shows up from time to time, for example while attacking;
  • Burnout Paradise - works really well.
  • Teleglitch - without Wine - that's totally weird for me, but fps drops did appear and it's rather simple game;
  • Trine - without Wine - works pretty well, but sometimes I do experience the problem;
  • FEZ - without Wine - works ok;
  • DotA 2 - without Wine - works really well, except few bugs.

After all tests I suspect this may be related to the CPU, rather then the GPU: I can clearly see the CPU usage drop when fps drop appears (at least while playing Hearthstone). Changing the GPU with prime-select did not change much really. I tried changing CPU to performance mode with indicator-cpufreq, but it did not solve the problem.

The most surprising thing is, that while testing something happened and I experienced extreme boost. Everything worked so well that I couldn't believe it. Sadly after a reboot a few hours later that was gone, but now I know it must be possible!

What's the problem about really? What could happen that this boost appeared?

I just would like to not experience this fps drops.

Software data:

  • Ubuntu 14.04.1;
  • Wine 1.6.2 from default repositories;
  • nvidia-331 with nvidia-prime from default repositories.

Hardware data:

  • GPU: Nvida GT 650M 2GB and Intel - Optimus technology;
  • CPU: Intel Core i5-3210M 2.5GHz - 2 cores, 4 threads;
  • RAM: 16GB;
  • 16GB swap partition;
  • 116.1 GB total partition space, 2.1GB free.

Speedtest.net: ping 57ms, 9.81 Mbps download speed, 0.84 Mbps upload speed.

Output of free and df: http://pastebin.com/c4eAwEAg .

kcpr
  • 1,433
  • FWIW, I had to revert to the 304 family drivers on my GT520 after a 331 point release in December 2014; there was apparently a major glitch that prevented GPU computation tasks from detecting the GPU. That might also affect some games, depending whether they use the GPU for something beyond just updating the screen. – Zeiss Ikon Jan 17 '15 at 13:17
  • @ZeissIkon so You suggest reinstalling drivers to 304 version? I still don't understand why this boost happend - using 331 drivers. – kcpr Jan 17 '15 at 13:28
  • The question is still too long, but it's much better already and now you've got (at least one) answer to get cracking! ;-) Oh, and please: DO NOT accept any answer (you can upvote) until the bounty period is over and you have thoroughly tested everything! (and please delete all your comments below my answer) – Fabby Jan 17 '15 at 13:56
  • @kcpr I found another answer somewhere (possibly here on AskUbuntu) that led me to install nvidia-modprobe. I had to do that with the 304 driver active, since 331-updates showed broken packages, but once nvidia-modprobe was installed, I was able to reinstate 331.113 and have full CUDA operation. Can't test with your games, sorry, and no idea what caused the boost you report, unless it was just the 331 driver working correctly for a short time... FWIW, I used the Driver Manager (I'm on Kubuntu 14.04.1) to make the driver changes; quick and painless. – Zeiss Ikon Jan 17 '15 at 14:50
  • @ZeissIkon as far as I know I do not use CUDA. DO You think it could be a source of problem? I tried a lot of different drivers before. As I remember 304, these from xorg.edgers, 340... non of them solved the problem. I just installed nvidia-modprobe. It does not really seem to help. – kcpr Jan 17 '15 at 17:28
  • I don't know how your games are designed. Most games use the GPU only for actual graphics, animations, etc., but if there's a bug in the driver, who knows what it could affect. If neither the 304 nor 340 drivers helps, there's probably a subtle setup sensitivity, some setting you hit on that one time but didn't have fully saved, so it fell off when you rebooted. – Zeiss Ikon Jan 18 '15 at 11:49
  • Have you tried Wine 1.7? – John Scott Jan 22 '15 at 21:12
  • @FuzzyToothpaste I did. But couldn't launch Hearthstone with Wine 1.7. in normal way. Anyway as far as I know Play On Linux somehow uses Wine 1.7. to run Hearthstone and even there the problem occurred. – kcpr Jan 23 '15 at 01:57

2 Answers2

1

Some things to change , then reboot, then test again:

  • Turn off power management: gsettings set org.gnome.settings-daemon.plugins.power active false
  • Free up disk space: You need at least 10% free disk space, (20% would even be better) then look at this Q&A how to defragment your drive.
  • Install the xorg.edgers PPA
  • While rebooting, go into the BIOS and turn off any power management as well.

Advanced settings:

do a sudo nano /etc/sysctl.cfg and add the following parameters to the end:

vm.swappiness = 10
vm.vfs_cache_pressure = 75
vm.max-readahead = 2048
vm.min-readahead = 1024

For the explanation of these, see comments to keep answer uncluttered.

As discussed in chat, your Intel Corporation Centrino Advanced-N 6235 (rev 24) has a problem. Use a wired connection while you're solving this.

Fabby
  • 34,259
  • 1
    change "swappiness" from default 60 to 10 (theoretically only when RAM usage reaches around 80 or 90 percent)

    vm.swappiness = 10

    Good to improve sequential reads (stop stuttering in movie play)

    Can also be implemented per disk using udev rules

    vm.max-readahead=2048 vm.min-readahead=1024

    – Fabby Jan 20 '15 at 19:18
  • 1
    Lower to 75% (once cached, probably not immediately needed any more)

    This percentage value controls the tendency of the kernel to reclaim

    the memory which is used for caching of directory and inode objects.

    At the default value of vfs_cache_pressure=100 the kernel will attempt to

    reclaim dentries and inodes at a "fair" rate with respect to pagecache and

    swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer

    to retain dentry and inode caches.

    vm.vfs_cache_pressure = 75

    – Fabby Jan 20 '15 at 19:18
  • 1
    Sadly it still did not solve the problem. :/ And I do not really think it's about internet connection. My friend has not problems like that on Windows and we've got the same internet connection. If You really want, I can try to ping game server. Just give me some time. – kcpr Jan 20 '15 at 20:24
  • Can you do like 1 game server? Use the following strategy: stop all downloads, firefox, ... (Anything that uses Internet) Then start the ping 1.2.3.4 >> /tmp/PingServer.log, wait 30 seconds, log in, play a game, log out, wait 30 seconds, stop the ping. Post the output to pastebin. – Fabby Jan 20 '15 at 20:33
  • I do not really think it's about internet connection, because my friend does not have any problem like that on Windows and we're in the same network. I can do what You said if You really want, but give me few minutes at least. And by the way I truly feel like game's working a bit better after restarting or just after some time. On the other hand sometimes it works so horribly in random moments. – kcpr Jan 20 '15 at 20:44
  • That's pretty weird because ping google.com works without any problems, but ping eu.battle.net loss all packages. Maybe that's wrong address somehow... An of course website works well in Firefox or wherever. And friend got the same on Windows. – kcpr Jan 20 '15 at 20:58
  • Blizzard's servers actively deny ICMP, so you cannot test them. Do you have another game which has problems that you can ping the server of? Chat? Ubuntu General room? – Fabby Jan 20 '15 at 21:01
  • Not really. I only tested Hearthstone and Starcraft as online games. – kcpr Jan 20 '15 at 21:03
  • 1
    As I mentioned on chat this nework connection does not seem to be a source of problem. I've connected by Ethernet cable and the lags still exist. Here's my new ping test: http://pastebin.com/ZM59cgyd . – kcpr Jan 21 '15 at 01:30
  • I also tested DotA 2 and it works well. – kcpr Jan 22 '15 at 10:15
0

It finally seems I found the answer. It's pretty surprising for me really. It feels like... it's all about my hard drive!

Hard drive I used while asking this question just died few days ago. For now I'm forced to used my backup, which is stored on my external drive. I've got Ubuntu there and and I'm just using it. I tried playing Hearthstone and it just works brilliantly! Even using Intel graphics.

Anyway I'm not going to accept this as answer until I do some better tests. For now I just wanted to share this news as I'm pretty excited and maybe it could somehow help somebody. ;)

kcpr
  • 1,433