LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games
User Name
Password
Linux - Games This forum is for all discussion relating to gaming in Linux.

Notices


Reply
  Search this Thread
Old 02-29-2004, 11:27 AM   #1
purplecow
Member
 
Registered: Aug 2003
Location: Finland
Distribution: Mandriva
Posts: 102

Rep: Reputation: 15
Tweaking linux for gaming, how?


Let's make this a general tweaking thread, not Gentoo vs. the world, k?

I'll start off with my specs:
Athlon xp 1800+, 512 ram (DDR 333), Geforce FX5600 128Mb, ASUS A7V333 (VIA KT333 chipset). Currently running Mandrake 9.2 with 2.4.22-10mdk kernel.
Nvidia drivers are version number 5336.

I know that Mandrake is not generally viewed as a speedy distro, but switching distros is not the answer we're looking for here.

What have you noticed that has a noticeable impact on gaming speed? (read: OpenGL)
Self-compiled kernel? Different Nvidia (or ATI) drivers? Alsa vs. oss?

We all know that KDE and Gnome eat resources, no need to point that out.

I'm personally looking for a way to improve my fps in UT2k4, they're really bad right now. (look for details in ut2k4-thread)

Does GLXGears give comparative results? ( I get around 3000fps )

What are your experiences in linux gaming speeds between different distros, kernel versions, driver versions etc. ?
"Try 2.6.3" is really not enough. At least the 2.6.2-rc1 from Cooker I tried did not make this machine any faster (And broke wacom support, more on that in hardware-forum)

Ideas? If anything, post your GLXGears score and hardware info.
 
Old 02-29-2004, 12:24 PM   #2
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
6K fps in glxgears on Suse 9.0. GeForce4 Ti 4200. It is an agpart card. Don't know what yours is. This is with the stock nvidia driver and settings. In Redhat 8.0, I got around 7K fps. There are tweaks you can make, that I made to the input section of the nvidia driver that got me to around 12K fps in Redhat 8.0. I haven't retried these in Suse yet. NOTE: These are not things to just 'try' for any newbie reading this. Make sure you know what you are doing, and whether your card can understand these settings.

http://s.bouncybouncy.net/nvidia_debs/tuning.html
http://yanc.sourceforge.net/doc/doc-en.html
http://www.sorgonet.com/linux/nvoption/

The next biggest thing is to make sure that you have the fasted DMA mode on for your hard drive. For example, my 2 HDs are in Ultra DMA mode 100.
linux:/root # hdparm -t /dev/hda
/dev/hda:
Timing buffered disk reads: 170 MB in 3.02 seconds = 56.20 MB/sec

http://www.justlinux.com/nhf/Hardwar...for_Linux.html

You have more than enough RAM. Disable uneeded services, and then, run the game with a negative NICE command. Note, this requires the game to be started as root, which may not be allowed, or a security risk, however, it does mean the game gets as much CPU as it needs above everything and anything else EXCEPT ext3 or reiserfs updates.

nice --19 <game>

highest priority available. I use that setting for xmms, and I have NEVER been able to cause a skip, even compiling, downloading or transferring huge files from CD to HD.

Hope that helps.

R.O.
 
Old 02-29-2004, 12:53 PM   #3
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
Cool, got to thinking about the nice command, and something occurred to me.
You can get a regular user to start a game, or any app, with the highest
priority and bypass any security concerns about running as root.
As root, I just...

nice --19 su - steve -c 'export DISPLAY=localhost:0.0;xmms'
and ps -ef |grep xmms gives
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5196 steve 0 -19 928 928 772 S 0.0 0.4 0:00.02 su

Notice the -19 NI(ce) level. I already updated my link to xmms to work this
way.
NOTE: For Suse, the display is not carried over with the su, that is the reason for the localhost:0.0 specification.

RO
 
Old 02-29-2004, 03:07 PM   #4
John-e
LQ Newbie
 
Registered: Feb 2004
Distribution: SuSE 8.2 Professional
Posts: 15

Rep: Reputation: 0
lets see:

on a PIII 450 with 192 MB SDRAM + geforce 256 DDR 32 MB running SuSE 8.2 Professional and KDE 3.1 with 2 virtual desktops at 1280x1024x16bit

Several browsers open, downloading, I run glxgears and output is:


10504 frames in 5.0 seconds = 2100.800 FPS
10916 frames in 5.0 seconds = 2183.200 FPS
11033 frames in 5.0 seconds = 2206.600 FPS
10979 frames in 5.0 seconds = 2195.800 FPS
11780 frames in 5.0 seconds = 2356.000 FPS
12064 frames in 5.0 seconds = 2412.800 FPS
17951 frames in 5.0 seconds = 3590.200 FPS
17964 frames in 5.0 seconds = 3592.800 FPS
15173 frames in 5.0 seconds = 3034.600 FPS
17406 frames in 5.0 seconds = 3481.200 FPS
17950 frames in 5.0 seconds = 3590.000 FPS
17947 frames in 5.0 seconds = 3589.400 FPS
16001 frames in 5.0 seconds = 3200.200 FPS
17577 frames in 5.0 seconds = 3515.400 FPS
17773 frames in 5.0 seconds = 3554.600 FPS
17541 frames in 5.0 seconds = 3508.200 FPS
17235 frames in 5.0 seconds = 3447.000 FPS
16624 frames in 5.0 seconds = 3324.800 FPS
16985 frames in 5.0 seconds = 3397.000 FPS
17093 frames in 5.0 seconds = 3418.600 FPS
17111 frames in 5.0 seconds = 3422.200 FPS
17438 frames in 5.0 seconds = 3487.600 FPS
17667 frames in 5.0 seconds = 3533.400 FPS
17298 frames in 5.0 seconds = 3459.600 FPS
17202 frames in 5.0 seconds = 3440.400 FPS
16881 frames in 5.0 seconds = 3376.200 FPS
17301 frames in 5.0 seconds = 3460.200 FPS
16852 frames in 5.0 seconds = 3370.400 FPS
16372 frames in 5.0 seconds = 3274.400 FPS
16883 frames in 5.0 seconds = 3376.600 FPS
16367 frames in 5.0 seconds = 3273.400 FPS
15625 frames in 5.0 seconds = 3125.000 FPS
16451 frames in 5.0 seconds = 3290.200 FPS
17269 frames in 5.0 seconds = 3453.800 FPS
17322 frames in 5.0 seconds = 3464.400 FPS
17315 frames in 5.0 seconds = 3463.000 FPS
16560 frames in 5.0 seconds = 3312.000 FPS
16231 frames in 5.0 seconds = 3246.200 FPS
16385 frames in 5.0 seconds = 3277.000 FPS
16466 frames in 5.0 seconds = 3293.200 FPS
12874 frames in 5.0 seconds = 2574.800 FPS
15006 frames in 5.0 seconds = 3001.200 FPS


I wouldn't say it's too bad is it?? or should I be expecting 4-5k FPS??
 
Old 02-29-2004, 03:24 PM   #5
LavaDevil94
LQ Guru
 
Registered: Jul 2003
Distribution: Gentoo 2004.2: Who needs exmmpkg when you have emerge?
Posts: 1,795

Rep: Reputation: 47
glxgears: 3675.4 fps.

hardware: geforce FX 5700 ultra AGP 8X/4X 128mb
athlon xp 1.666 ghz
512mb ddr geil ram
alsa 1.0rc1

ill try some of those suggestions from rolledoat, now that i see that i can get SO much more out of my card. i have dma, but i havent tried ultra dma, since i dont know how to enable it, and i dont know what boot script to add initialization of dma to, so i have to start it manually.
 
Old 02-29-2004, 04:13 PM   #6
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
Quote:
Originally posted by LavaDevil94

ill try some of those suggestions from rolledoat, now that i see that i can get SO much more out of my card. i have dma, but i havent tried ultra dma, since i dont know how to enable it, and i dont know what boot script to add initialization of dma to, so i have to start it manually.
That was the nice thing about Yast, it has an HDParm tool built in. I could try Ultra DMA 133, it is an option, but with the performance I have now, I don't need much more transfer speed.

The good thing is though, it can be configured by hand, you don't start a runlevel or anything like that.

hdparm -i /dev/hda
/dev/hda:

Model=Maxtor 6E040L0, FwRev=NAR61EA0, SerialNo=E1P3W29E
Config={ Fixed }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=57
BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=80293248
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 udma6
AdvancedPM=yes: disabled (255) WriteCache=enabled
Drive conforms to: (null):

* signifies the current active mode

You will likely find that the fastest, or almost fasted is already set. This is a good way to verify is you need to change anything. I have not had to, only ever verfied the settings. If you want to or need to try changing it, man hdparm. You can change things, and until committed, can be cleared by a reboot.

NOTE: In Mandrake 9.1, I am sure there is a hardware query tool that can show/set up the DMA modes for your drives.

RO
 
Old 02-29-2004, 04:58 PM   #7
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Rep: Reputation: 45
purplecow:
I'd deffintely suggest you try out a self compiled 2.6.3 kernel, especially when you enable in it the new scheduler and preemptive capabilities. Those are basically the biggest advantages towards gaming. I don't recommend you using any pre-compiled 2.6.x kernel from your distribution, basically because of performance issues, that's right, they do compile it to be more compatible with any computer running their systems, but that sometimes (almost all the time) means sacrificing a little bit in the performance department in favor of reliablitiy. This is not a bad thing, but for gaming purposes, may hold you back. If you've never compiled a kernel before, there are lots of places where you may find information regarding that (even the own kernel readme file has information on how to build it!).
If you have your current official distro's kernel source installed (as I assume you have) you will have also a file containing the information upon which it was built under the /boot directory (/boot/config-<kernelversion>). Use that file as a guide line. To do so, just start the confiuguration program (as root) for your current kernel (cd /usr/src/linux-<current-kernel> && make xconfig), and load up the config file, on another VD and console start the same for the kenrel you are going to compile, and make sure you read the help entries of the items (all of them, if you can!) so you know what do they do and if you really need t/o compile them! A slim and slick kernel may be much more efficient than a monolithic, heav/y one!

Regarding ALSA Vs OSS, you'll find all over the place that ALSA's the Linux Audio future, however, it'll be a time until many developers/projects will incorporate it. Sure ALSA does have OSS emulation so you can enjoy both worlds, however since version 1 of ALSA there have been a couple of bugs with the OSS emulation algorithm. I'll have to try out the newly released (today 29/02/2004 [dd/mm/yy]) ALSA (1.0.3), however because of these you can either: stick to OSS or tolerate the little ALSA OSS emulation anoyances. Regarding performance ALSA does utilizes much better your hardware than the OSS (Free) drivers do, meaning a little performance boost (but hey, when gaming, everything's about performance, donnit?).
 
Old 02-29-2004, 07:53 PM   #8
LavaDevil94
LQ Guru
 
Registered: Jul 2003
Distribution: Gentoo 2004.2: Who needs exmmpkg when you have emerge?
Posts: 1,795

Rep: Reputation: 47
someone should make this sticky, because its one of those RARE, and i mean RARE threads that when you ask about performance, people dont point you to gentoo or killing your desktop environment!

PS: ive enabled ultra dma, and im amazed. 15 MBPS to 45 MBPS. but i still cant figure out how to get fastwrites and stuff enabled for my nvidia card.
 
Old 02-29-2004, 11:21 PM   #9
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Rep: Reputation: 45
Quote:
Originally posted by LavaDevil94
someone should make this sticky, because its one of those RARE, and i mean RARE threads that when you ask about performance, people dont point you to gentoo or killing your desktop environment!

Yeah! I second that!
Quote:
Originally posted by LavaDevil94
[BPS: ive enabled ultra dma, and im amazed. 15 MBPS to 45 MBPS. but i still cant figure out how to get fastwrites and stuff enabled for my nvidia card.
For FastWrites, I think the nVidia extensive Readme explains it. I don't know if there's still the PDF version of the document, last time I checked it was text only, but should be located at the driver's download site.
 
Old 03-01-2004, 12:30 AM   #10
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
Just activated FastWrites, and Sideband access. Added around 500 fps,
See if it is supported...
(NOTE: On mine, both now show enabled at the bottom, yours probably don't.)

>cat /proc/driver/nvidia/agp/*
Fast Writes: Supported
SBA: Supported
AGP Rates: 4x 2x 1x
Registers: 0x1f000217:0x1f000314
Host Bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge
Fast Writes: Supported
SBA: Supported
AGP Rates: 4x 2x 1x
Registers: 0x1f000217:0x00000314
Status: Enabled
Driver: AGPGART
AGP Rate: 4x
Fast Writes: Enabled
SBA: Enabled

NOTE: You want to make sure that the AGP Rate enabled is the MAX your card can support. As you can see, mine is 4x, but have read that even though other cards can support 8x, the usually get configured as 4x.

To enable fast writes and SBA, simply add the support variables that your card supports. JUST after
'alias char-major-195 nvidia' in /etc/modules.conf add one (or both if supported) add this line.
options nvidia NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1

Reboot and you should see them enabled when you do the cat shown above.

Now, Figured out where the 1K came from in Redhat 8.0. My monitor was not detected but Suse 9.0, but I went with the default vertical and horizontal. Got around to checking it, and the V refreash rate was only 85Hz. My monitor (Sun 21") can perform 1600X1200 at 160 Hz. After that, glxgears added 1K. Found out that this is due to Veritical sync is usually tied to the vertical refhresh rate of your monitor. So, if your monitor is NOT configured correctly, this can impact it. However, found a GL variable, which, when set before glxgears, does the same as increasing the refhresh rate. In a terminal

'The fourth line disables Vertical Sync, which can significantly enhance performance by allowing the card to update faster than the monitor refreshes.'

export __GL_SYNC_TO_VBLANK=0

then try glxgears. I am not sure where to set this so it is a system default, the links below never specify. Here are my latest tweaks. Note this is now at 1600x1200 24M colors.

38158 frames in 5.0 seconds = 7631.600 FPS
39639 frames in 5.0 seconds = 7927.800 FPS
39649 frames in 5.0 seconds = 7929.800 FPS

I did notice a HUGE improvement in sharpness of my display after setting the Monitor correctly, so I suspect that other variables, that reduce performance but increase the quality of the display are now active. In any event, I will keep posting as I 'relearn' performance changes. In the first link is a tool to overclock your card in Linux. Never done that, but I am sure many have.

Reference
http://www.brandonhutchinson.com/NVI...Hat_Linux.html
http://s.bouncybouncy.net/nvidia_debs/tuning.html

RO

P.S. Anyone else notive that glxgears drops after starting mozilla, even after you exit mozilla, it doesn't go back up? I always noticed that, wondered why, but never investigated.
 
Old 03-01-2004, 02:24 PM   #11
purplecow
Member
 
Registered: Aug 2003
Location: Finland
Distribution: Mandriva
Posts: 102

Original Poster
Rep: Reputation: 15
My /etc/modules.conf looks like this now:

Code:
yada yada...
alias /dev/nvidia*   nvidia
options nvidia NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1

Output from cat /proc/driver/nvidia/agp/* :
Code:
Fast Writes:     Supported
SBA:             Supported
AGP Rates:       4x 2x 1x
Registers:       0x1f000217:0x1f000314
Host Bridge:     VIA Technologies, Inc. VT8366/A/7 [Apollo KT266/A/333]
Fast Writes:     Supported
SBA:             Supported
AGP Rates:       4x 2x 1x
Registers:       0x1f000217:0x00000314
Status:          Enabled
Driver:          AGPGART
AGP Rate:        4x
Fast Writes:     Enabled
SBA:             Enabled
And no speed increase in GLXgears... UT2k4 doesn't seem any spiffier either.
Fastwrites is enabled in BIOS, couldn't find SBA in there though.


I have to get around that self-compiled kernel.. Not right now, I'll wait for Mandrake 10 to come along.

Oh, what's agpgart?
 
Old 03-01-2004, 03:14 PM   #12
LavaDevil94
LQ Guru
 
Registered: Jul 2003
Distribution: Gentoo 2004.2: Who needs exmmpkg when you have emerge?
Posts: 1,795

Rep: Reputation: 47
agpgart is the kernel-made alternative to nvidia's agp. nvagp is more stable, but a bit slower, so take agpgart if you can. btw, 8x agp is only available in 2.6 kernels, and even if i had one, i still wouldnt be able to use 8x, since my motherboard only supports 4x and lower. ill try that modules.conf edit. and, i have noticed a performance drop while mozilla is active, but i dont know if it stays. maybe mozilla didnt clean up after itself? ill also try that monitor trick, but my monitor is configured correctly (i guess) from the harddrake (its an NEC multisync XV17+, which ive been trying to get 1280/1600 res on for ages ).
 
Old 03-01-2004, 05:17 PM   #13
LavaDevil94
LQ Guru
 
Registered: Jul 2003
Distribution: Gentoo 2004.2: Who needs exmmpkg when you have emerge?
Posts: 1,795

Rep: Reputation: 47
i tried the edit, and now SBA is on, but fast writes is still off... maybe its my mobo that doesnt support it... i have an iwill xp333 ALI magik 1. ill peek in the bios a little later, in the meantime, ill try that trick with the monitor vsync.
 
Old 03-03-2004, 09:25 PM   #14
LavaDevil94
LQ Guru
 
Registered: Jul 2003
Distribution: Gentoo 2004.2: Who needs exmmpkg when you have emerge?
Posts: 1,795

Rep: Reputation: 47
any mod wanna make this sticky?
 
Old 03-04-2004, 09:10 AM   #15
sneak
LQ Newbie
 
Registered: Feb 2004
Posts: 21

Rep: Reputation: 15
pIII 450 192 mb ram GForce MX400 64 mb

Fast Writes: not supported
SBA: not supported
AGP Rates: 4x 2x 1x
Driver: NVIDIA (?)
AGP RATE: 2X

running 2.6.3 kernel with preemtive enabled, on slack 9.1 latest nvidia driver installed
fluxbox as window manager

glxgears does not go higher then 870

have already added
options nvidia NVreg_ReqAGPRate=4
to /etc/modules.conf

but AGP RATE still shows 2x, must agpart be a module for that to work?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tweaking the linux desktop titanium_geek Linux - News 3 11-02-2005 01:49 PM
help with tweaking Suse Linux 9.3 pro Lightdreamer Linux - Newbie 4 09-30-2005 04:10 PM
Anyway to make linux games go faster by tweaking opengl somehow? FocusedWolf Linux - Games 3 04-16-2005 06:20 AM
Tweaking Linux to run on a slow, old PC pmjmcim Linux - Newbie 2 09-01-2004 09:14 AM
Tweaking linux? Kage Linux - Software 5 10-07-2002 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games

All times are GMT -5. The time now is 01:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration