# [SOLVED] -msse2 on AthlonXP is bad for your sanity (kdm &..)

## dr_nailz

Edit: title was 'kdm fails to start w/ nvidia.ko', then nvidia kernel module loading but not enabled

I recently updated from gentoo-sources-2.6.15 to 2.6.16, and started having errors loading the nvidia kernel module from 'nvidia-kernel' in portage.

Following the advice of some other threads in the forums, I unmasked 'nvidia-kernel' and 'nvidia-glx', emerged and loaded nvidia, which completed successfully.

Now when kdm (via xdm) starts on boot, the screen goes black for a few seconds, then drops to the console.

If I log into the console and run /etc/init.d/xdm restart, I get the nvidia logo and can see a mouse cursor for a second before it drops back to the console.

I'm not sure how to go about debugging this, so please let me know if there's more info required, or where else to look.

tail /var/log/kdm.log

```
KCrash: Application 'kdmgreet' crashing...

Warning: connect() failed: : No such file or directory

KCrash cannot reach kdeinit, launching directly.

krootimage: Fatal IO error: client killed
```

The line about connect() sticks out for me.  which kdeinit gives: /usr/kde/3.5/bin/kdeinit

tail /var/log/messages

```
Jun 21 16:03:09 nailz-h init: Activating demand-procedures for 'A'

Jun 21 16:03:09 nailz-h NVRM: not using NVAGP, an AGPGART backend is loaded!

Jun 21 16:03:14 nailz-h kdm: Abnormal termination of greeter for display :0, code 125, signal 0
```

(I have a VIA chipset, not NForce, and agpgart module is loaded.)

/var/log/Xorg.0.log has nothing interesting AFAICT.

dmesg also contains the line about NVAGP, but nothing else interesting AFAICT.Last edited by dr_nailz on Thu Jun 22, 2006 3:50 pm; edited 2 times in total

----------

## neokin

It's easy when you upgraded your kernel your modules changed format to match, you should re-emerge the nvidia-kernel and glx packages and any other kernel based drivers compiled before the update

----------

## dr_nailz

Thanks for your reply.

After I updated the kernel I ran module-rebuild (which included nvidia-kernel), along with the other regular stuff like splash_geninitramfs.  Also, as I said, after I started having trouble with that, I emerged the latest versions of nvidia-kernel and nvidia-glx.  (Actually, I've tried several versions of them, rebooted many times since, including running modules-update).

I also didn't forget to copy the bzImage over and update grub.conf.

FWIW, I'm using vesafb-tng, because I had heard there's problems using nvidiafb or rivafb with the nvidia drivers.

----------

## dr_nailz

Re-emerged my kernel and modules, no joy.

Perhaps someone knows of a logfile I'm not checking or debug technique I'm not using?

----------

## dr_nailz

OK here's something interesting... xdm works!  It allows me to log in and my KDE session is started correctly.

If I shut that down and start kdm (also tried '/etc/init.d/xdm start'), it still doesn't work.  One more thing, once it drops back to the console, the kdm process is still running.

Edit: running 'startx' as a user also correctly starts kde.

----------

## gilya

 *dr_nailz wrote:*   

> OK here's something interesting... xdm works!  It allows me to log in and my KDE session is started correctly.
> 
> If I shut that down and start kdm (also tried '/etc/init.d/xdm start'), it still doesn't work.  One more thing, once it drops back to the console, the kdm process is still running.
> 
> Edit: running 'startx' as a user also correctly starts kde.

 

Try downgrade freetype. This helped for me.

Look here for more info: https://forums.gentoo.org/viewtopic.php?p=3395128

----------

## dr_nailz

Hmm I'm using the current stable freetype-2.1.9-r1, not unstable 2.1.10 like in that thread, but I re-emerged the same version to check and no go.  The error messages are a bit different too.

----------

## dr_nailz

Urgh I remembered something.... I have recently added -msse2 to my CFLAGS.  I remember some people saying that this might be bad, and some people saying shut up they don't know what they're talking about.  I've been using on my laptop for a few months so I added it to my desktop (the system in question) recently.  Please tell me that's not what could be causing this =S

----------

## dr_nailz

OK I think I'm closer.  It makes all the difference when you know what keywords to search for.  In this case I think my problem was loading 'agpgart' and 'nvidia' together, and having Option "NvAgp" "1".

I have now removed that line (so the default is to try agpgart and fall back to nvagp), and agpgart is compiled as a module.

Then there's this:

cat /proc/driver/nvidia/agp/status

```
Status:    Disabled
```

Please help!  I've had about 2 days downtime, and I feel I'm very close to solving this!

To sum up:

The nvidia drivers no longer worked when I updated my kernel (errors about missing symbols).

I cannot get the newer nvidia drivers to work.

----------

## dr_nailz

Last post about cat /proc/driver/nvidia/agp/status was a herring - it only shows details when X is active.  Seeing as 'startx' works for me, I tried this and it shows the details correctly.

I give up.  I'll log in at the terminal and use startx to load KDE from now on.  I've wasted too much time on this.

----------

## dr_nailz

I can now confirm that the problems were caused by the -msse2 CFLAG.  As I've now realised (and according to this), -msse2 might be safe for my Centrino laptop, but not for my AthlonXP.  Beware... beeeewwaaaaaare.

----------

## frenkel

 *dr_nailz wrote:*   

> I can now confirm that the problems were caused by the -msse2 CFLAG.  As I've now realised (and according to this), -msse2 might be safe for my Centrino laptop, but not for my AthlonXP.  Beware... beeeewwaaaaaare.

 

Athlon XP doesn't have sse2 instruction set, so it can't be used on Athlon XP.

----------

## dr_nailz

Shouldn't this be a bug?  I would have expected GCC to refuse to compile (when not cross compiling), rather than output faulty binaries.  If not that, then perhaps Gentoo could examine CFLAGS (and maybe others) and cross reference them against the architecture and print errors or warnings about their use.

----------

## frenkel

 *dr_nailz wrote:*   

> Shouldn't this be a bug?  I would have expected GCC to refuse to compile (when not cross compiling), rather than output faulty binaries.  If not that, then perhaps Gentoo could examine CFLAGS (and maybe others) and cross reference them against the architecture and print errors or warnings about their use.

 

How should it know you are not cross compiling?

Just use -march=athlon-xp and all the instruction sets your cpu have are enabled (sse, 3dnow, 3dnow-ext, mmx, mmx-ext). It's not needed to enable them by hand with -msse, -m3dnow and so on.

----------

