Friday, January 2, 2009

Linux and the Nvidia GeForce 6050/7050 IGP - getting rid of the X11 flicker

The goal was a new dual core machine that would be quiet and cheap. Oh I like to have 4G of ECC RAM, too.

So, I installed Ubuntu 8.04 AMD64 many months ago and all went. Almost. It recognized the 4G of ECC RAM. In fact everything was perfect except that when I started up X11, the screen would flicker randomly every few seconds. It's a brief tearing as if there is memory contention (recall that an integrated graphics chipset shares main memory with the rest of the system). It made the system unusable. My hardware is an Asus Socket 939 M/B using the Nvidia GeForce 6050/430 chipset; AMD Athlon 64 X 2 3800+, Kingston unbuffered ECC DDR2 PC4200 RAM, Seagate HDD.

I found that Slackware 12.1 which is based on a 32 bit kernel would not recognize any more than 3G of RAM, though it didn't have the flickering. But I didn't install 4GB to only get 3GB. And besides, I was trying to move away from the big Slack.

Back to Ubuntu....I tried the latest Nvidia drivers of which there are many and not labeled in any coherent fashion. I tried reconfiguring X11 fifteen different ways, I tried searching on Google and LKML, I tried looking at header files and everything I could think of. Eventually I just gave up and let that machine sit. And sit.

It's now 8+ months later and as a Christmas project, I installed Ubuntu 8.10 and again all goes well except the screen still flickers. Not as much but it's still there.

Hunting through the internet, somebody finally nails the problem down for me. In a post not on what caused the problem. Thank you, thank you.

When the CPU changes clock speed, the screen flickers.

The recent Ubuntu releases make use of CPU governors, which dictate if/when the CPU changes speed. The dynamic freq governors, which slow down the CPU when there isn't much load and speed it up when there is are "ondemand", and "conservative". The default is "ondemand". AMD desktop CPUs seem to have the following 3 frequencies they can run at: nominal (max performance), 1.8GHz and 1.00 GHz.

So I changed the governor to "powersave" which simply runs at the slowest speed all the time. (If you know anything about CPU performance, you typically don't lose that much normal performance by halving the speed .. say around 30-35%, unless you are doing CPU intensive computations like floating point). And I get a cooler CPU. On a second system based on the BE-2300 (45W) Athlon X2 3800, the CPU heatsink is barely warm running at the slowest frequency.

How to do this


# As root
% cpufreq-selector -g powersave

# As an administrator
% sudo cpufreq-selector -g powersave


To see the available and current both governors and cpu speed look in /sys/devices/system/cpu/cpu0/cpufreq/

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
powersave

% ls /sys/devices/system/cpu/cpu0/cpufreq/
affected_cpus related_cpus scaling_governor
cpuinfo_cur_freq scaling_available_frequencies scaling_max_freq
cpuinfo_max_freq scaling_available_governors scaling_min_freq
cpuinfo_min_freq scaling_cur_freq scaling_setspeed
ondemand scaling_driver stats

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
userspace ondemand powersave conservative performance

1 comment:

Unknown said...

Thank you for this information!

I have been pulling my hair out about my
onboard Nvidia C51G (Geforce 6100), which
was flickering the same way. Using the
cpufreq-selector command to fix the processor
speed solved the problem!