Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
1000 HZ kernel causes Doom3/Prey/Quake4 slowdown
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
apeitheo
Apprentice
Apprentice


Joined: 09 Jan 2004
Posts: 222

PostPosted: Wed Aug 26, 2009 8:38 pm    Post subject: 1000 HZ kernel causes Doom3/Prey/Quake4 slowdown Reply with quote

I would like to set the timer frequency of my kernel to 1000 HZ (as id software suggests to run Enemy Territory: Quake Wars at its full potential), but doing so causes any of the games that use the Doom 3 engine to slow down with the FPS rapidly fluctuating. ETQW's performance is increased, however.

When the timer frequency is 250 HZ, I am able to get 63 FPS (seems to be where it's capped at) 99% of the time on Doom 3 even with 16AA & 16AF. Setting the timer frequency to anything higher than 250 HZ causes the slowdown (even setting it to 300 HZ causes the same problem). The FPS rapidly fluctuates around 20-50 FPS, even while standing still.

I've noticed that setting CONFIG_HIGH_RES_TIMERS=y in the kernel even with 250 HZ will cause this same problem as well, but I don't know what to make of it.

What's even stranger is that the windows Doom 3 client works fine under Wine even when 1000 HZ is set (60+ FPS). :x

Am I using the wrong timer or something? Any information at all to push me in the right direction would be highly appreciated.

Thank you

------------------------------

AMD Athlon II X2 250
EVGA Nvidia 9800 GTX+
2X2GB DDR3 1066 RAM


Last edited by apeitheo on Sun Sep 06, 2009 8:05 am; edited 2 times in total
Back to top
View user's profile Send private message
shazeal
Apprentice
Apprentice


Joined: 03 May 2006
Posts: 206
Location: New Zealand

PostPosted: Wed Aug 26, 2009 9:54 pm    Post subject: Reply with quote

1000hz is for single CPU, you should use 250 for dual core. I have seen some patches in ZEN? that have a better timer for dual core.

The hz rating is per core, so if you set 1000hz you are actually running 2000hz, IIRC that is.
Back to top
View user's profile Send private message
darklegion
Guru
Guru


Joined: 14 Nov 2004
Posts: 468

PostPosted: Fri Aug 28, 2009 8:13 am    Post subject: Reply with quote

Yeah, it's 432hz for a dual core in zen, 216hz for a quad core, and 864hz for a single core.
Back to top
View user's profile Send private message
Hyper_Eye
Guru
Guru


Joined: 17 Aug 2003
Posts: 462
Location: Huntsville, AL.

PostPosted: Sat Aug 29, 2009 3:00 am    Post subject: Reply with quote

I am very curious to find out if you have learned anything more about this. In particular... 1) what frequency ultimately worked better for you and 2) Did you find it better to enable or disable high res timers? Just to see if there is any discernible difference I am trying Zen sources right now and I am trying out the 216Hz frequency.
_________________
Gentoo Gaming Videos
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Sat Aug 29, 2009 4:21 am    Post subject: Reply with quote

Is there any doc about the right freq to use ?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Aug 29, 2009 5:13 am    Post subject: Reply with quote

Smoothness is achievable in single-player, with:
Code:
set com_fixedtic 1
set com_syncgameframe 1

Which kinda indicates that it's a problem with the doom3 & quake4 engines, rather than Linux's scheduling.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Sep 04, 2009 7:39 pm    Post subject: Reply with quote

The 7.5.1 release notes for mesa have this line:
Quote:
Fixed swapbuffers jerkiness in Doom3/etc in Intel drivers.

Whatever that means :?
Back to top
View user's profile Send private message
apeitheo
Apprentice
Apprentice


Joined: 09 Jan 2004
Posts: 222

PostPosted: Sun Sep 06, 2009 4:45 am    Post subject: Reply with quote

I found a solution..

I had to change my clocksource to "jiffies." I didn't find this fix anywhere online.. I was just playing around with everything I could find and then all of a sudden it worked when I changed this.

For those who are having the same problem:

Code:
# echo "jiffies" >/sys/devices/system/clocksource/clocksource0/current_clocksource


If this doesn't work, there are other ones to try:

Code:
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource


The default on my system was tsc, and I tried the other two that were available (hpet and acpi_pm), but neither fixed the problem. You can set it at boot time by setting the kernel parameter 'clocksource=jiffies'

Why?

I think tsc, hpet, and acpi_pm are hardware timers (correct me if I'm wrong). According to this, "jiffies" is a variable that's incremented each timer interrupt (every 1ms for 1000 HZ I think), so it should be a reliable clocksource. (Side note: If you have a dynamic ticks (CONFIG_NO_HZ=y) set in the kernel, jiffies will cause problems with system time (or so I've heard) if you go into suspend, since the variable won't be updated in suspend, unlike the hardware timers.)

Does anyone have any idea why the hardware timers are causing a problem? My hardware is brand new, so I'm wondering if it's a bug in the kernel, something I configured incorrectly, or...? I'm glad to have these games running smooth (very smooth, actually... it's faster than even my original configuration of 250 HZ/tsc), but I'd like more information as to why I have to use jiffies. If anyone has any knowledge about this at all, or any ideas what's going on, I'd really appreciate it.

Thanks for the help. :D
Back to top
View user's profile Send private message
Hyper_Eye
Guru
Guru


Joined: 17 Aug 2003
Posts: 462
Location: Huntsville, AL.

PostPosted: Sun Sep 06, 2009 6:17 am    Post subject: Reply with quote

You should take the solved off so this thread doesn't get ignored. I would really love more information about your clocksource and why it solved your issue.
_________________
Gentoo Gaming Videos
Back to top
View user's profile Send private message
apeitheo
Apprentice
Apprentice


Joined: 09 Jan 2004
Posts: 222

PostPosted: Sun Sep 06, 2009 8:07 am    Post subject: Reply with quote

Hyper_Eye wrote:
You should take the solved off so this thread doesn't get ignored. I would really love more information about your clocksource and why it solved your issue.

Good idea. I just removed it.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Sep 06, 2009 8:31 am    Post subject: Reply with quote

apeitheo, it sounds like something wonky with your motherboard. Which particular motherboard model do you have?
Back to top
View user's profile Send private message
apeitheo
Apprentice
Apprentice


Joined: 09 Jan 2004
Posts: 222

PostPosted: Sun Sep 06, 2009 5:03 pm    Post subject: Reply with quote

PaulBredbury wrote:
apeitheo, it sounds like something wonky with your motherboard. Which particular motherboard model do you have?

GIGABYTE GA-MA770T-UD3P.

It's on NewEgg here if you want to look at the specs.
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Sun Sep 06, 2009 7:31 pm    Post subject: Reply with quote

*subscribes*

interesting topic

I think I might need to experiment with my clocksource-setting too and see whether that fixes some jerkiness ...
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
Aphax
Tux's lil' helper
Tux's lil' helper


Joined: 16 Jan 2006
Posts: 75

PostPosted: Mon Sep 07, 2009 6:30 am    Post subject: Reply with quote

I'm very happy I ran into this thread, I've been having jerkiness in Doom3/Quake4/ETQW for such a long time and tried so many things to solve it I had mostly given up. Long ago Doom3 ran really well on my PC, but somewhere along the way I got the same jerkiness issue. Interestingly I got this on at least 2 mostly different PCs I tried (one amd, one intel CPU, one with ATI graphics, the other Nvidia...), what made it worse was that I couldn't find much through google about this specific issue (or rather, tons of 'noise' from of people with seemingly unrelated FPS problems).

I spent considerable time trying to figure out what causes it, trying dozens of different timer-related kernel options, different kernel versions and so on, and I only got Doom3 running smoothly again using either <2.6.24 for 64bit, or <2.6.20 for 32bit, interestingly these were also the versions in which they introduced the tickless kernel thing (I may have incorrectly remembered the exact kernel versions mentioned here). Simply disabling dynamic ticks didn't help though, but still it seemed something related to the timing code changed that must somehow subtly break Doom3's timing code for me.

Anyway, this thread has given me a few more things to try (since I don't really want to run an ancient kernel version), so thanks :p

PS. I just tried changing clocksource to jiffies, but that seems to just make my machine to freeze after a few seconds (I guess this is because I actually have dynamic ticks enabled at the moment). I'll try a few things and let you know if I manage to fix it


EDIT: Well that's just damn typical.. tried various combinations of the things mentioned in this thread (250 and 300Hz kernels, different clock sources) and none seemed to help. I could not however try 'jiffies' as clocksource because the second I set it to that, my machine locks up again, even though I have dynamic ticks turned off (I double checked /proc/config.gz just in case I forgot to actually boot the new kernel, which happens sometimes).
Meh :cry:
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Sep 07, 2009 12:13 pm    Post subject: Reply with quote

Sounds like Con's new scheduler helps too:
Quote:
Games like Doom 3 and such don't "freeze" periodically for small amounts of time
Back to top
View user's profile Send private message
apeitheo
Apprentice
Apprentice


Joined: 09 Jan 2004
Posts: 222

PostPosted: Mon Sep 07, 2009 4:57 pm    Post subject: Reply with quote

Aphax wrote:
I could not however try 'jiffies' as clocksource because the second I set it to that, my machine locks up again, even though I have dynamic ticks turned off (I double checked /proc/config.gz just in case I forgot to actually boot the new kernel, which happens sometimes).

Are you changing it through /sys or setting it as a boot parameter? Maybe switching while your system is running is causing some kind of problem for you. If so, adding an extra entry in your lilo.conf/menu.lst to set clocksource=jiffies at boot time might not cause the freezing problem for you. Just make sure you keep your original boot entry, just in case you need to switch back.

As a last resort, you could try running it in wine (I have 1.1.29, the latest development release). That seems to work for me regardless of my timer frequency or clocksource for at least Doom 3/Prey (I haven't tried Quake 4, but I imagine it'd work). All I had to do, if I remember, was upgrade to the latest patches for both the games before they ran perfectly in wine.
Back to top
View user's profile Send private message
kernelOfTruth
Watchman
Watchman


Joined: 20 Dec 2005
Posts: 6111
Location: Vienna, Austria; Germany; hello world :)

PostPosted: Mon Sep 07, 2009 7:23 pm    Post subject: Reply with quote

Aphax wrote:


EDIT: Well that's just damn typical.. tried various combinations of the things mentioned in this thread (250 and 300Hz kernels, different clock sources) and none seemed to help. I could not however try 'jiffies' as clocksource because the second I set it to that, my machine locks up again, even though I have dynamic ticks turned off (I double checked /proc/config.gz just in case I forgot to actually boot the new kernel, which happens sometimes).
Meh :cry:


++

:(

I'll try setting it during boot, like apeitheo suggested

thanks !
_________________
https://github.com/kernelOfTruth/ZFS-for-SystemRescueCD/tree/ZFS-for-SysRescCD-4.9.0
https://github.com/kernelOfTruth/pulseaudio-equalizer-ladspa

Hardcore Gentoo Linux user since 2004 :D
Back to top
View user's profile Send private message
Aphax
Tux's lil' helper
Tux's lil' helper


Joined: 16 Jan 2006
Posts: 75

PostPosted: Tue Sep 08, 2009 9:14 am    Post subject: Reply with quote

Success! I was indeed setting it through /sys, so as you suggested I tried setting it as a boot parameter which worked, and now together with a tickrate of 250HZ (didn't try jiffies with 100/300/1000HZ yet) Doom3 runs smoothly at last :D

EDIT: Just for the record, even with 1000HZ Doom 3 is smooth now, simply passing clocksource=jiffies in my bootparams is all it really takes for me


Last edited by Aphax on Sun Sep 13, 2009 2:55 am; edited 2 times in total
Back to top
View user's profile Send private message
saint_abroad
n00b
n00b


Joined: 08 Nov 2002
Posts: 53
Location: England, UK

PostPosted: Tue Sep 08, 2009 10:45 am    Post subject: Reply with quote

BTW, are you using CPUFREQ? What about dynamic ticks?
_________________
I work for fun. But only as a means to an end.
Back to top
View user's profile Send private message
Aphax
Tux's lil' helper
Tux's lil' helper


Joined: 16 Jan 2006
Posts: 75

PostPosted: Tue Sep 08, 2009 11:43 am    Post subject: Reply with quote

saint_abroad wrote:
BTW, are you using CPUFREQ? What about dynamic ticks?


I do use cpufreq (ondemand governor), but I have dynamic ticks turned off. From what I understand, jiffies as clocksource wouldn't work with dynamic ticks
Back to top
View user's profile Send private message
Aphax
Tux's lil' helper
Tux's lil' helper


Joined: 16 Jan 2006
Posts: 75

PostPosted: Sun Sep 05, 2010 4:19 am    Post subject: Reply with quote

Small update, 'jiffies' as clocksource causes timer problems on my new pc (Core i7 870, Gigabyte GA-P55-USB3 mobo), as time now seems to 'pass' too slowly (affecting everything including things like keyrepeat rate). So I'm back to square one :/ Not that I really run any D3 based games anymore, but it still kind of bugs me
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Sep 05, 2010 6:46 am    Post subject: Reply with quote

I suggest you use pf-sources then. It's what I use.
Back to top
View user's profile Send private message
Ivan The Viking
Tux's lil' helper
Tux's lil' helper


Joined: 14 Apr 2003
Posts: 78
Location: Connecticut, USA

PostPosted: Sun Sep 05, 2010 1:23 pm    Post subject: Reply with quote

I am using pf-sources with the BF scheduler, no issues as mentioned here with 1000hz ticks.
When I try gentoo-sources I get the 'stuttering' in doom3 and quake 4.
I recommend trying pf-sources out, or to patch in that scheduler.
Back to top
View user's profile Send private message
whig
l33t
l33t


Joined: 27 Nov 2004
Posts: 973
Location: New Zealand

PostPosted: Sun Sep 05, 2010 8:39 pm    Post subject: Reply with quote

I solved etqw jerkiness and crashes, progressively getting worse, by deleting ~/.etqwcl.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Wed Sep 08, 2010 8:50 am    Post subject: Re: 1000 HZ kernel causes Doom3/Prey/Quake4 slowdown Reply with quote

apeitheo wrote:
Doom 3... Nvidia 9800

I forgot about the special nvidia environment variables:

export __GL_DOOM3=1
export __GL_YIELD="NOTHING" # Try this also, for the hell of it
doom3

Worth a go.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum