# fglrx and Radeon HD 3850 : Tearing and locks up

## leludo

Hi!

I'm having some troubles with getting fglrx working smoothly...After hours of searching over forums i am not able fix it myself, so that's why i'm posting here.

I have an Ati Radeon HD 3850 (RV670) PCI-Express and manage to install fglrx but it does not seems to be working as expected. 

Everything seems fine but :

there is tearing when moving windows in Kde and in video playback with vlc. vlc often reports "main warning: late picture skipped" but hardware acceleration seems activated (better quality in full screen)

text scrolling in konsole is slow when emerging

from time to time screen freezes/locks up and the UI not responsive. Happens in video playback, when activating a window, selecting text, etc

I tried with and without framebuffer support built in kernel. I have no kernel DRI and AGP support. My kernel is customized to include only what is necessary (and some other things i don't know if I need them  :Wink: . Actually I wonder if it could not come from a bad kernel config...? but I don't have these problems with the open source driver radeonhd. I need fglrx because I'd like to run compiz and opengl games.

Here are some info :

Installed versions (using ~x86 keyword)

media-libs/mesa-7.0.3 

x11-base/xorg-server-1.4.2

x11-apps/ati-drivers-8.501

x11-base/xorg-x11-7.3

x11-drivers/xf86-input-keyboard

x11-drivers/xf86-input-mouse

x11-drivers/xf86-video-radeonhd

x11-libs/libXrender-9.4

x11-libs/pixman-0.11.8

x11-libs/xtrans-1.2.1

x11-proto/renderproto-0.9.3 

x11-proto/xf86driproto-2.0.4

```
# uname -srvmpio

Linux 2.6.25-tuxonice-r7 #2 SMP Sun Aug 3 17:18:23 CEST 2008 i686 Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz GenuineIntel GNU/Linux
```

```
# cat /var/log/Xorg.0.log | grep rendering

(II) fglrx(0): Direct rendering enabled
```

```
# glxinfo | grep rendering

direct rendering: Yes
```

```
# fglrxinfo

display: :0.0  screen: 0

OpenGL vendor string: ATI Technologies Inc.

OpenGL renderer string: ATI Radeon HD 3850

OpenGL version string: 2.1.7659 Release
```

```
# glxgears

79099 frames in 5.0 seconds = 15819.642 FPS

80720 frames in 5.0 seconds = 16143.984 FPS

81422 frames in 5.0 seconds = 16284.253 FPS
```

```
# fgl_glxgears

Using GLX_SGIX_pbuffer

17151 frames in 5.0 seconds = 3430.200 FPS

22655 frames in 5.0 seconds = 4531.000 FPS

22483 frames in 5.0 seconds = 4496.600 FPS
```

glxgears and fgl_glxgears both use 100% CPU. They also freeze/lock sometimes and then, animation continue like if something 

In /var/log/Xorg.0.log there are errors loading evdev module. Strange because I removed it from make.conf (INPUT_DEVICES="keyboard mouse"). I also got some warnings about AIGLX when acivated but nothing important I think (AIGLX: 3D driver claims to not support visual 0x...)

I tried lots of xorg.conf variants, from the most simple where only the minimum is set up (monitor, screen, and driver) to more complicated where settings are forced (AIGLX, composite, render, ...). No change at all.

As nothing seems wrong in fglrx installation and configuration, I have no clue what to do...Please help!

----------

## pappy_mcfae

Just to save you some time, the slow going in konsole happens with slower machines (P-II, P-III) running kernel version >2.6.22.x. That can be cured by going down to a kernel version where that isn't a problem, or using any other terminal, like xterm, or the terminal that comes with XFCE.

As for the rest of your problem, it sounds like a driver issue. However, take that with a grain of salt. I don't have any machines with ATI cards (thank the goddess). I'll let someone who knows ati drivers better deal with that part of your problem.

Blessed be!

Pappy

----------

## leludo

Thanks Pappy for answering.

Actually I am not using Konsole but yakuake, which i think uses Konsole (not sure). I could live with slow text  scrolling, i don't really mind if it slows down builds a bit. I pointed this out because it seems to depends on CPU usage as it is not always so slow (not all emerging use 100% CPU on both cores). As you can see in my first post glxgears and fgl_glxgears use 100% CPU (only one core) and i'm not sure it should if hardware acceleration was fully functionnal.

I suppose correcting other problems should resolve this one too. I'll make some test with xterm to see if i works better.

If someone has a clue where to look for, some tests, I would be happy to try! I'm really running out of idea...

This evening , I'll build a generic x86 kernel from gentoo-sources and tell you what it does.

----------

## pappy_mcfae

When you're working on your kernel, turn off fair CPU scheduling, and crank the timer frequency to 1000hz. Those should help with speed. 

If you're interested, I could check out your kernel and give it the Pappy touch. Just post your present kernel .config, the results of lspci -n and cat /proc/cpuinfo. 

Blessed be!

Pappy

----------

## leludo

Thanks a lot for helping me.

Timer is already set to 1000Hz, I will disable fair CPU scheduling (FAIR_GROUP_SCHED I suppose?). Should I keep GROUP_SCHED too? I'm gonna give it a try following your advice and if there is no noticeable change, build a "stock" kernel. I'll keep you informed.

Here is what you asked for, hope you find something :

Kernel config : http://myfreefilehosting.com/f/0ac3487aba_0.05MB

```
# lspci -n

00:00.0 0600: 8086:29c0 (rev 02)

00:01.0 0604: 8086:29c1 (rev 02)

00:1a.0 0c03: 8086:2937 (rev 02)

00:1a.1 0c03: 8086:2938 (rev 02)

00:1a.2 0c03: 8086:2939 (rev 02)

00:1a.7 0c03: 8086:293c (rev 02)

00:1b.0 0403: 8086:293e (rev 02)

00:1c.0 0604: 8086:2940 (rev 02)

00:1c.5 0604: 8086:294a (rev 02)

00:1d.0 0c03: 8086:2934 (rev 02)

00:1d.1 0c03: 8086:2935 (rev 02)

00:1d.2 0c03: 8086:2936 (rev 02)

00:1d.7 0c03: 8086:293a (rev 02)

00:1e.0 0604: 8086:244e (rev 92)

00:1f.0 0601: 8086:2916 (rev 02)

00:1f.2 0104: 8086:2822 (rev 02)

00:1f.3 0c05: 8086:2930 (rev 02)

01:00.0 0300: 1002:9505

01:00.1 0403: 1002:aa18

02:00.0 0200: 11ab:4364 (rev 12)
```

```
# cat /proc/cpuinfo

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 6

model           : 23

model name      : Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz

stepping        : 6

cpu MHz         : 4365.369

cache size      : 6144 KB

physical id     : 0

siblings        : 2

core id         : 0

cpu cores       : 2

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 10

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 lahf_lm

bogomips        : 8734.64

clflush size    : 64

processor       : 1

vendor_id       : GenuineIntel

cpu family      : 6

model           : 23

model name      : Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz

stepping        : 6

cpu MHz         : 4365.369

cache size      : 6144 KB

physical id     : 0

siblings        : 2

core id         : 1

cpu cores       : 2

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 10

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr sse4_1 lahf_lm

bogomips        : 8730.44

clflush size    : 64

```

----------

## leludo

Just did a make clean, remove the .config, built the kernel (using genkernel) with the default x86 config, reboot...but still no luck....

Checked log files, DRI is activated but I got the same symptoms as before.  :Crying or Very sad: 

----------

## pappy_mcfae

OK, make sure you have your old .config stashed away somewhere nice and safe, as in anywhere but in the /usr/src/linux-2.6.25-tuxonice-r7 directory. Run make mrproper in said directory. Copy my .config, compile it, and see how it works. Don't forget to recompile your video drivers after the compiling.

Your .config wase fairly well tweaked. You only missed a few things, but they were important. I usually have to do a lot more work to get one in shape. This is only my second tuxonice kernel. I didn't mess with any of that, since I know nothing about it. So, as long as it was working previous, it should still work.

Anyway, the .config is here. Please let me know how it works. 

Thanks.

Blessed be!

Pappy

----------

## leludo

Hi Pappy!

Thanks a lot for taking time to tweak my kernel, that's really great.

I can't test it right now as I'm at work but as soon as I'll be back home, I recompile my kernel with you .config.

I've just made a diff between your config and mine, and If you don't mind I think I'll reactivate some things I need like

- Jmicron ata controller : deactivated in bios but I may need it to plug an old IDE drive.

- Multi LUN scan on SCSI devices is needed to detect all slot on my multi memory card reader

- IEEE1394 also disabled in bios but may be usefull to plug external drives

- CPUFreq should stay as a module because it only works if my CPU is not overclocked and most of time it is.... I keep this in case my computer will be running for a long period as a server for remote access.

I have a question about MTD : Is it needed to access memory cards or ram block device? I actually use a RAM block device to mount portage temp directory, it works faster and when it fails because there's not enough space I simply unmount it and it uses the temp directory on hard drive.

There are some other options I'll check in menuconfig as I can't tell what it is, but I'll try to stay very close from your config.

I'll first try your config with no or very few modification and then re-enabled things one at a time.

I'll let you know.

Thanks again!

----------

## pappy_mcfae

 *leludo wrote:*   

> Hi Pappy!
> 
> Thanks a lot for taking time to tweak my kernel, that's really great.
> 
> I can't test it right now as I'm at work but as soon as I'll be back home, I recompile my kernel with you .config.

 

You're welcome. To think the first time I setup and compiled my own kernel, I was scared I was going to kill my machine...which I promptly did. Then I figured it out, then I practiced on four different machines.

 *Quote:*   

> I've just made a diff between your config and mine, and If you don't mind I think I'll reactivate some things I need like
> 
> - Jmicron ata controller : deactivated in bios but I may need it to plug an old IDE drive.
> 
> - Multi LUN scan on SCSI devices is needed to detect all slot on my multi memory card reader
> ...

 

While I'd prefer you try mine as is, it's your machine, and you are welcome to do with it as you please. 

 *Quote:*   

> I have a question about MTD : Is it needed to access memory cards or ram block device? I actually use a RAM block device to mount portage temp directory, it works faster and when it fails because there's not enough space I simply unmount it and it uses the temp directory on hard drive.

 Memory cards. The virtual memory system (tmpfs) of which you speak is a different option in the kernel, and it's set properly

 *Quote:*   

> There are some other options I'll check in menuconfig as I can't tell what it is, but I'll try to stay very close from your config.
> 
> I'll first try your config with no or very few modification and then re-enabled things one at a time.
> 
> I'll let you know.
> ...

 

You're welcome. The .config I made will be up for the next month, and I have a copy of it on this machine, so if there's a big ooops, I can send the .config to you again.

Happy Gentooing!

Blessed be!

Pappy

----------

## leludo

Hi Pappy,

I tested your .config file yesterday evening....still and always the same...

I wonder if the problem does not come from the driver. Maybe it can not handle properly my hardware configuration.

I'm thinking about contacting ati, they should be able to help, supposing they agree.

I don't think my hardware is broken as it used to work well under windows (can't test again, trial period expired). I'll try to see if there are bios updates available for my motherboard and the graphic card but i have doubts it could fix the issue.

I'm planning to do a stage 4 re-installation to get rid of the integrated RAID controller (ICH9R) and use AHCI with linux software RAID instead in the coming weeks. If there is a compatibility issue betwenn IHC9 Raid driver and fglrx reproducible only with this hardware config, as it is not a very common one, it could explain why I was'nt able to find anything about this bug in the hundred threads i read in forums. yeah i know i may seem desperate (and actually I am), I just want to consider every potential cause.

So if someone over there got ideas (even more silly than mine!) I'll take them all.

Thanks again Pappy for your help, I at least have a cleaner and better tweaked kernel!

----------

## pappy_mcfae

Hope you find the resolution. I use intel video chipsets, so I have no real experience forcing an errant nvidia or AYI video card.

Good luck.

Blessed be!

Pappy

----------

