index ] [ cedega ] [ code ] [ emacs-wiki ] [ ewiki-bits ] [ key ] [ shots ] [ thinkpad-x40 ] [ wireless ]

Tuning for Cedega performance (with an emphasis on Half-Life 2)

Keywords: Linux, Cedega, Transgaming, NVIDIA Geforce 6600GT, agpgart, nvagp

Introduction
My system
The kernel
Transgaming
Xorg configuration
NVIDIA drivers
Overclocking my card
The Half-Life 2 command line

Introduction

I've spent quite a while trying to improve the performance of Cedega running Half-Life 2. To be fair, it was mostly playable straight out of the box anyway, but there's no such thing as fast enough!

I'm writing this to bring together everything I did to improve the performance I was getting. When I started I was getting around 10 FPS from Half-Life 2 (and about 3500 FPS from glxgears); now I'm getting about 30-50 FPS from Half-Life 2 and about 7500 FPS from glxgears. If you know any tricks I haven't included here, I'd appreciate hearing them.

My system

The kernel

I was originally running 2.6.11, but I was having trouble getting the agpgart module to work nicely. I ended up compiling 2.6.14.5 instead, and just compiled all of the AGP stuff in (instead of as modules). From the config:

<*> /dev/agpgart (AGP Support)
<*>   ALI chipset support
<*>   ATI chipset support
<*>   AMD Irongate, 761, and 762 chipset support
<*>   AMD Opteron/Athlon64 on-CPU GART support
<*>   Intel 440LX/BX/GX, I8xx and E7x05 chipset support
<*>   NVIDIA nForce/nForce2 chipset support
<*>   SiS chipset support
<*>   Serverworks LE/HE chipset support
<*>   VIA chipset support
<*>   Transmeta Efficeon support              

I also changed my kernel preemption model to "Low-latency desktop". The option for this was under "Processor type and features".

Transgaming

At the time of writing, I'm using Cedega 5.0.3. The interesting bits of my Half-Life 2 configuration file are:

  [transgaming]
  "renice_wineserver" = "N"
  "working_directory" = ""
  "alsa_radio" = "Y"
  "oss_radio" = "N"
  "scheduler_value" = "Default"
  "cmdline" = ""
  
  [x11drv]
  "AllocSystemColors" = "100"
  "CopyDefaultColors" = "0"
  "PrivateColorMap" = "N"
  "PerfectGraphics" = "N"
  "Managed" = "Y"
  "Desktop" = "No"
  "UseDGA" = "N"
  "UseXShm" = "Y"
  "DXGrab" = "Y"
  "UseXVidMode" = "Y"
  "UseXRandR" = "N"
  "DesktopDoubleBuffered" = "Y"
  "TextCP" = "0"
  "ShowFPS" = "N"
  "ShowMem" = "N"
  "VideoRam" = "128"
  "AGPVertexRam" = "64"
  "NV_VAR" = "Y"
  "ARB_VBO" = "Y"
  
  [d3dgl]
  "AnisotropicTextureFiltering" = "N"
  "VertexShaders" = "Y"
  "PixelShaders" = "Y"
  "ClipSpaceFix" = "Y"
  "DynamicVBO" = "Y"
  "IndexVBO" = "Y"
  "FBO" = "N"
  "PixelShadersLevel" = "1.3"
  "FixedProgram" = "Auto"
  "FragmentOffset" = "Auto"
  "RectangleTextures" = "Auto"
  
  [opengl]
  "FixedGLExtensionBuffer" = "N"
  "GLExtensionBuffer" = ""
  
  [Wineserver]
  "SHMWineserver" = "Y"
  "Scheduler" = "Yes"
  
  [WinMM]
  "Drivers" = "winealsa.drv"
  "WaveMapper" = "msacm.drv"
  "MidiMapper" = "midimap.drv"

Xorg configuration

The device section of my xorg.conf looks like this:

  Section "Device"
          Identifier      "geforce 6600gt"
          Driver          "nvidia"
          VideoRam        131072
          Option          "NvAGP" "3"
          Option          "NoLogo" "1"
          Option          "RenderAccel" "1"
  EndSection

NVIDIA drivers

I'm using version 8178 of the NVIDIA drivers with the kernel agpgart module (not NvAGP). Here's the command line I use to load the module:

  modprobe nvidia NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1 NVreg_ReqAGPRate=8 NVreg_EnableVia4x=1

After you start X, /proc/driver/nvidia/agp/status should indicate that AGP is working:

  $ cat /proc/driver/nvidia/agp/status
  Status:          Enabled
  Driver:          AGPGART
  AGP Rate:        8x
  Fast Writes:     Enabled
  SBA:             Enabled

Overclocking my card

I got a fair performance boost by overclocking my card using the nvclock utility. Here's the command line I use:

  nvclock -m 1025 -n 560

The Half-Life 2 command line

Finally, here's the command line I'm using to launch Half-Life 2:

  cedega -winver win98 STEAM.exe -- \
         -applaunch 220 \
         +map_background none \
         -width 1280 -height 1024 \
         -heapsize 512000 \
         +cl_showfps 2