Gentoo Wiki


This article is part of the Hardware series.
Laptops TV Tuner Cards Wireless Servers Storage Other Hardware Motherboards Related

This document is licensed under the Creative Commons Attribution-ShareAlike 3.0 License Image:cc-somerights.png

This document describes the kernel configuration and Gentoo user-space settings to maximize the use of the hardware components found on Intel's G33, G35, and Q33-based chipsets.

Intel G33 Block Diagram




Graphics Yes
Ethernet Yes
Sound Yes
Firewire untested
Sensors Yes
ACPI partlyThere is no support for 'Fan' and 'Thermal Zone'

Specific Components

The specific system this article is loosely based on has the following components:

Detailed Listing

Code: lspci
00:00.0 Host bridge: Intel Corporation DRAM Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation PCI Express Port 1 (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 92)
00:1f.0 ISA bridge: Intel Corporation LPC Interface Controller (rev 02)
00:1f.3 SMBus: Intel Corporation SMBus Controller (rev 02)
00:1a.0 USB Controller: Intel Corporation USB UHCI Controller #4 (rev 02)
00:1a.7 USB Controller: Intel Corporation USB2 EHCI Controller #2 (rev 02)
00:1f.2 SATA controller: Intel Corporation 4 port SATA AHCI Controller (rev 02)
03:07.0 FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)
00:02.1 Display controller: Intel Corporation Integrated Graphics Controller (rev 02)
00:02.0 VGA compatible controller: Intel Corporation Integrated Graphics Controller (rev 02)
00:1b.0 Audio device: Intel Corporation HD Audio Controller (rev 02)
02:00.0 IDE interface: JMicron Technologies, Inc. JMB368 IDE controller
03:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet (rev 10)

BIOS settings

Kernel 2.6.27 Realtime Configuration

Listed below is a lean static kernel configuration with only those options necessary to enable the following features:

not enabled:

All settings not shown in this listing should be disabled. Download the full .config here: Kernel 2.6.27.

General Settings

Linux Kernel Configuration: General Settings
General setup  --->
[*] Prompt for development and/or incomplete code/drivers
[*] Automatically append version information to the version string
[*] System V IPC
(16) Kernel log buffer size (16 => 64KB, 17 => 128KB) 
[ ] Optimize for size (Look out for broken compilers!)
[*] Enable concurrent radix tree operations (EXPERIMENTAL)
[*]   Enabled optimistic locking (EXPERIMENTAL)
Choose SLAB allocator (SLUB (Unqueued Allocator))

[ ] Enable loadable module support

[*] Enable the block layer  --->
  [*]   Block layer SG support v4 (EXPERIMENTAL)
        IO Schedulers  --->
        [*] CFQ I/O scheduler

Processor Settings

Code: cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
model name      : Intel(R) Core(TM)2 CPU          4400  @ 2.00GHz

processor       : 1
vendor_id       : GenuineIntel
model name      : Intel(R) Core(TM)2 CPU          4400  @ 2.00GHz
Linux Kernel Configuration: Processor
Processor type and features  --->
[*] Tickless System (Dynamic Ticks)
[*] High Resolution Timer Support
    Processor family (Intel Core2 / newer Xeon)
<*> /dev/cpu/*/msr - Model-specific register support
<*> /dev/cpu/*/cpuid - CPU information support
[*] MTRR (Memory Type Range Register) support
[*] Symmetric multi-processing support
[*]   Multi-core scheduler support
Preemption Mode (Preemptible Kernel (Low-Latency Desktop))
RCU implementation type: (Preemptible RCU)
[*] Enable priority boosting of RCU read-side critical sections
(2) Maximum number of CPUs (2-256)
[*] Provide RTC interrupt
[*] Machine check support
[*]   Intel MCE features
[*] Sparse Memory virtual memmap 
[*] MTRR (Memory Type Range Register) support
[*]   MTRR cleanup support
(1)     MTRR cleanup enable value (0-1)
(1)     MTRR cleanup spare reg num (0-7)
[*]   x86 PAT support
Timer frequency (1000 HZ)

Power Saving and Monitoring Features

Linux Kernel Configuration: Power management
Power management options  ---> 
[*] Power Management support
[ ] Suspend to RAM and standby
ACPI (Advanced Configuration and Power Interface) Support  --->
[*]   Deprecated /proc/acpi files
[*]   Deprecated /proc/acpi/event files
<*>   Button
<*>   Processor
<*>     Thermal Zone
[*]   Power Management Timer Support

CPU Frequency scaling  --->
[*] CPU Frequency scaling 
Default CPUFreq governor (performance) 
<*>   'ondemand' cpufreq policy governor
<*>   ACPI Processor P-States driver

CPU idle PM support  --->
[*]   'menu' governor

Device Drivers --->
I2C support  --->
<*>   I2C device interface
*]   Autoselect pertinent helper modules
I2C Hardware Bus support  --->
  <*> Intel 82801 (ICH)

Device Drivers --->
[*] Hardware Monitoring support  --->
[*]   Intel Core (2) Duo/Solo temperature sensor

Bus Settings

Intel's SATA AHCI implementation supports message signaled interrupts. "this enables a device to generate an interrupt using an inbound Memory Write on its PCI bus instead of asserting a device IRQ pin." [Kernel 2.6.23]. We'll want to take advantage of this feature, shown below:

Code: cat /proc/interrupts
           CPU0       CPU1       
  0:        101          9   IO-APIC-edge      timer
  1:       8610       8640   IO-APIC-edge      i8042
  7:          0          0   IO-APIC-edge      lpptest
  8:          0          1   IO-APIC-edge      rtc
317:        375        371   PCI-MSI-edge      ahci
NMI:          0          0 
LOC:    2023669    2499122 
ERR:          0
Linux Kernel Configuration: Bus options
Bus options (PCI etc.)  --->
[*] PCI support
[*]   Support mmconfig PCI config space access
[*]   Support for DMA Remapping Devices (EXPERIMENTAL)
[*]   PCI Express support
[*]   PCI Express ASPM support(Experimental)
[*]   Message Signaled Interrupts (MSI and MSI-X) 

Serial and Parallel ATA Drivers

Code: lspci
SATA controller: Intel Corporation 4 port SATA AHCI Controller
IDE interface: JMicron Technologies, Inc. JMB368 IDE controller 
Linux Kernel Configuration: ATA Drivers
Device Drivers  --->
SCSI device support  --->
<*>   SCSI disk support
<*>   SCSI CDROM support
<*> SCSI generic support

[*] Serial ATA (prod) and Parallel ATA (experimental) drivers --->
<*> AHCI SATA support
[*] JMicron PATA support 

Network Drivers

Code: lspci
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet 
Linux Kernel Configuration: Network Drivers
Device Drivers  --->
[*] Network device support  --->
[*]   Ethernet (1000 Mbit)  --->
[*]   Realtek 8169 gigabit ethernet support 

Graphics Drivers

Code: lspci
Display controller: Intel Corporation Integrated Graphics Controller
VGA compatible controller: Intel Corporation Integrated Graphics Controller 

See this guide.

Sound Drivers

Code: lspci
Audio device: Intel Corporation HD Audio Controller
Linux Kernel Configuration: General Settings
Device Drivers  --->
Sound  --->
<*> Sound card support
<*> Advanced Linux Sound Architecture
  [*]   RTC Timer support
  PCI devices  --->
  <*> Intel HD Audio
   [*]   Enable generic HD-audio codec parser
   [*]   Aggressive power-saving on HD-audio
   (1)     Default time-out for HD-audio power-save mode
  [*] Intel/SiS/nVidia/AMD/ALi AC97 Controller
  [*] AC97 Power-Saving Mode
  (1)   Default time-out for AC97 power-save mode

USB Drivers

Code: lspci
USB Controller: Intel Corporation USB2 EHCI Controller
USB Controller: Intel Corporation USB UHCI Controller 
Linux Kernel Configuration: USB Drivers
Device Drivers  --->
USB support  --->
[*] Support for Host-side USB
[*]   USB device filesystem
[*]   USB selective suspend/resume and wakeup (EXPERIMENTAL)
<*>   EHCI HCD (USB 2.0) support
[*]     Full speed ISO transactions (EXPERIMENTAL)
<*>   UHCI HCD (most Intel and VIA) support
<*>   USB Printer support
<*> USB Mass Storage support

Device Drivers  --->
[*] HID Devices  --->
[*]   USB Human Interface Device (full HID) support 

User-space Configuration

GMA 3100 Setup

The GMA 3100 chipset is supported in MESA >= 7.0.2.


In your /etc/make.conf file, set the VIDEO_CARDS variable to "i810" and optionally add opengl, dri, and xv to your USE flags:

File: /etc/make.conf
USE="opengl dri xv" 

Emerge xorg-x11 and mesa

echo media-libs/mesa >> /etc/portage/package.keywords
emerge --sync
emerge -DNuav xorg-server


As root, edit /etc/X11/xorg.conf:

File: /etc/X11/xorg.conf
Section "Module"
    Load       "glx"
    Load       "dri"
Section "Device"
        Driver          "intel"
        Option          "DRI"                     "true"
        Option          "UseFBDev"                "true"
        Option          "PageFlip"                "true"
        Option          "TripleBuffer"            "true"
        Option          "XAANoOffscreenPixmaps"   "true"
        Option          "FramebufferCompression"  "false"
        # Enable offload of Motion Compensation (XvMC)
        Option          "LinearAlloc"             "16384"
        Option          "Cachelines"              "2048"
        Option          "XvMCSurfaces"            "7"
Section "Extensions"
    Option "Composite" "true"

Section "DRI"
    Group        0
    Mode         0666

Check if OpenGL and Direct Rendering are working by starting X and executing:

glxinfo | grep rendering

should you tell you "yes".

Tear-Free Video Playback

When combined, the following xorg, dri, and mplayer settings have been tested to minimize CPU usage and prevent screen tearing.

X-Org Configuration

Start by locking down your screen's vertical refresh using gtf to generate a sane modeline. This should be equal to the exact native refresh rate of your device (usually 60hz for LCD). Some LCD's accept and sync at >60 Hz but still physically refresh at 60Hz, and this difference can result in tearing.

For a typical LCD screen or HDTV lock this down to 60.00 Hz as shown in this example:

gtf 1280 1024 60.00
# 1280x1024 @ 60.00 Hz (GTF) hsync: 63.60 kHz; pclk: 108.88 MHz
Modeline "1280x1024_60.00"  108.88  1280 1360 1496 1712  1024 1025 1028 1060  -HSync +Vsync

Place the generated Modeline in the Monitor and Screen sections in your xorg.conf:

File: /etc/X11/xorg.conf
Section "Monitor"
         Modeline "1280x1024_60.00"  108.88  1280 1360 1496 1712  1024 1025 1028 1060 -HSync +Vsync

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
                Viewport  0 0
                Depth     24
                Modes     "1280x1024_60.00"

DRI Configuration

The most important setting here is vblank_mode, which, when set to 3, forces opengl to sync its output with the screen refresh rate.

File: /etc/drirc
    <device screen="0" driver="i915">
        <application name="all">
            <option name="force_s3tc_enable" value="true" />
            <option name="fthrottle_mode" value="2" />
            <option name="vblank_mode" value="3" />
            <option name="allow_large_textures" value="1" />

Provided you are now also using the above fixed modeline in xorg.conf, you can now check this using glxgears:

 libGL warning: 3D driver claims to not support visual 0x6e
 301 frames in 5.0 seconds = 60.072 FPS
 299 frames in 5.0 seconds = 59.762 FPS
 301 frames in 5.0 seconds = 60.072 FPS
 299 frames in 5.0 seconds = 59.762 FPS

Good enough. A nice side effect is CPU usage will drop for applications that would normally render more frames than your monitor can actually display.

Ensure this DRI configuration takes effect for all the users on your system by removing their personal .drirc files (check with them first). As root, execute:

ls /home/*/.drirc ~/.drirc | xargs rm -i

Mplayer Configuration

Finally, we must configure mplayer to use opengl to render video along with some performance tweaks to make sure 720p and 1080p videos are playable without dropping frames.

echo media-video/mplayer mad a52 dts -mp2 X aac alsa dvd dvdread gif\
-gtk iconv -ipv6 jpeg lzo -mad opengl png -rtc sdl speex sse sse2 sse3 \
theora truetype unicode vorbis win32codecs x264 xv xvid >> /etc/portage/package.use
emerge -DNuav mplayer
File: /etc/mplayer/mplayer.conf
# really-quiet=true

#  Subtitles
ffactor="1"             # black outline
sub-bg-alpha="0"        # background color ala closed captions
sub-bg-color="0"        # black to white
subpos="90"             # By default subtitles are too low
spuaa=4                 # Anti-alias subs. (4: best and slowest)
sub-fuzziness=1         # Find subtitle files.
subfont-autoscale=2     # Set font size. (2: proportional to movie width)
subfont-blur=2.0        # Set font blur radius. (default: 2)
subfont-outline=2.0     # Set font outline thickness. (default: 2)
subfont-text-scale=4.4  # Set autoscale coefficient. (default: 5)
subfont-osd-scale=4.4   # Set autoscale coefficient. (default: 6) 

Some users will have their own mplayer configuration files which may incorrectly override the video-output option in the system configuration. Check this as root with the following:

ls /home/*/.mplayer/config ~/.mplayer/config | xargs grep vo

Make.conf Settings

The follow CFLAGS have been tested to produce optimized binaries for the Core2 architecture, while the LDFLAGS reduce load times by minimizing and sorting the dynamic links withing the binary.

File: /etc/make.conf
CFLAGS="-march=core2 -O3 -funroll-all-loops -mfpmath=sse -mno-ieee-fp -fomit-frame-pointer -pipe"
FEATURES="-sandbox parallel-fetch"
INPUT_DEVICES="keyboard mouse evdev"

(*) Note GLIBC will not build with -mfpmath=sse, so you'll need to manually remove (and later re-add) it for this one package. Fortunately glibc is a low-level library that's rarely upgraded.

Power Saving Settings

The following apply kernel parameters and user-space daemon settings to minimize the frequency of CPU wake-ups. To test these settings, emerge and run powertop as root:


File: powertop output
< Detailed C-state information is only available on Mobile CPUs (laptops) >
Wakeups-from-idle per second : 21.7     interval: 10.0s

Top causes for wakeups:
  69.4% ( 12.0)   <kernel module> : usb_hcd_poll_rh_status (rh_timer_func)
  11.6% (  2.0)     <kernel core> : clocksource_register (clocksource_watchdog)
   5.8% (  1.0)           fluxbox : schedule_timeout (process_timeout)
   1.7% (  0.3)      krcupreemptd : schedule_timeout (process_timeout)
   1.2% (  0.2)       <interrupt> : eth2, uhci_hcd:usb4
   1.2% (  0.2)          ifconfig : __netdev_watchdog_up (dev_watchdog)

sysctl settings

The bootmisc init.d script runs sysctl, which configures the settings in /etc/sysctl.conf. First, make sure bootmisc is enabled:

rc-update show | grep bootmisc
bootmisc | boot

Then update your /etc/sysctl.conf as shown below:

File: /etc/sysctl.conf
#  minimize swapping while putting additional pressure
#  on the VFS to flush out old data and inode cache entries
vm.vfs_cache_pressure = 100000
vm.swappiness = 0
vm.overcommit_memory = 2
vm.overcommit_ratio = 200

#  disable laptop mode and the NMI watchdog timer
kernel.nmi_watchdog = 0
vm.laptop_mode = 0

# Use up to 95% of free memory to buffer floods of writes
vm.dirty_ratio = 95

# But start writing soon after the cache starts filling
vm.dirty_background_ratio = 0

# Don't periodically flush; Let the above memory settings dictate writes
vm.dirty_writeback_centisecs = 27640520
fs.xfs.xfsbufd_centisecs = 27640520

# Send all new writes into the memory buffers for output
vm.dirty_expire_centisecs = 0

# These ensure that TIME_WAIT ports either get reused or closed quickly.
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_tw_recycle = 1

# TCP memory
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2

# Give a little more memory to each socket to allow large buffer fills
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 4194304

# Use most of the system's memory
vm.min_free_kbytes = 512

Kernel Boot Parameters

The following are kernel command-line arguments passed via the bootloader.

File: /boot/grub/grub.conf
   kernel /bzImage-2.6.27 ro usbcore.autosuspend=1 snd_ac97_codec.power_save=1 acpi_irq_balance=0 nmi_watchdog=0 root=/dev/sdb5

Local Start Settings

The following settings:

File: /etc/conf.d/local.start
# enable process scheduling optimized for multicore processors
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings

#  Sets the ondemand governor for one or more CPUs or cores.
cd /sys/devices/system/cpu/
for c in cpu*/cpufreq/; do
  echo ondemand > $c/scaling_governor
  cat  $maxfreq > $c/scaling_max_freq
  echo   333333 > $c/ondemand/sampling_rate
  echo       40 > $c/ondemand/up_threshold

# Disable wake-on-LAN because it draws power
ethtool -s eth0 wol d

# make the system more responsive to mouse actions
# 2 = 500hz
# 1 = 1000Hz
echo 2 > /sys/module/usbhid/parameters/mousepoll

# Enable USB auto-suspend for all USB devices
for state in $(find /sys -name autosuspend -type f); do echo 1 > $state; done

# Enable SATA link power management
for i in /sys/class/scsi_host/host*/link_power_management_policy; do echo min_power > $i; done

# enable soundcard power savings, which requires inputs to be muted
amixer set Line mute nocap
amixer set Mic mute nocap
echo Y > /sys/module/snd_ac97_codec/parameters/power_save
echo 1 > /sys/module/snd_hda_intel/parameters/power_save

# increase read-ahead and set spin-down timeout to 10 minutes
hdparm -A1 -a $ahead -W1 -S240 /dev/sda
hdparm -A1 -a $ahead -W1 -S240 /dev/sdb
hdparm -A1 -a $ahead -W1 -S242 /dev/sdc
for i in /sys/block/*/queue/read_ahead_kb; do echo $ahead > $i; done
for i in /sys/block/*/queue/nr_requests; do echo 32 > $i; done

Filesystem Table (fstab) Settings

The commit settings in the following example decrease the file-system driven commit rate to once every 12 hours, which effectively allows your disks to spin down. Writes to the filesystem are now fully driven by the VM system and only occur when pressure on the dirty forces eviction to disk. Without this, the filesystem will wake up every 5 seconds and flush.

Note that the commit setting for XFS filesystems is globally set in sysctl.conf, and not per-filesystem in fstab.

File: /etc/fstab
# <fs>                  <mountpoint>    <type>          <opts>                       <dump/pass>
/dev/sda5               /               reiserfs        noatime,commit=43200         0 1
/dev/sdb1               /home           ext3            noatime,commit=43200         0 1
/dev/sda3               /data           xfs             noatime,nodiratime,logbufs=8,logbsize=32768 0 1

Network Settings

Stretch out the frequency that the interface plug daemon, ifplugd, polls for a cable (or lack of cable) by increasing the poll-time variable to once every 15 seconds, in /etc/conf.d/net:

File: /etc/conf.d/net
Retrieved from ""

Last modified: Sat, 11 Oct 2008 03:15:00 +0000 Hits: 19,337