Today, I remove the nvidia.ko and emerge xorg-server with VIDEO_CARDS="nvidia".
Now I can load the nvidia module finally

But it still failed to startx because of "No devices detected".
I have already installed udev in runlevel sysinit and started it, but there is no /dev/nvidia* filesThe CONFIG_SYSVIPC is also "y" in my kernel configure.
I am google-ing ! Just post the progress here for updating and looking forward to more guidance.
Thanks all !

But perhaps I don't understand your problem ..._________________.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)

Further more, the tutorial said I should change the Driver line to "nvidia" in /etc/X11/xorg.conf
But I can't find the xorg.conf file anywhere.
The latest version of xorg doesn't need this file anymore ?

If you don't have a xorg.conf but use an NVidia card, that could be the problem. At least for me x doesn't start without a xorg.conf. Fortunately, the programm nvidia-xconfig (run in terminal, might have to go to /opt/bin ) will provide one without much trouble. You can edit it, but I found it works right away._________________Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest

If you don't have a xorg.conf but use an NVidia card, that could be the problem. At least for me x doesn't start without a xorg.conf. Fortunately, the programm nvidia-xconfig (run in terminal, might have to go to /opt/bin ) will provide one without much trouble. You can edit it, but I found it works right away.

thanks, I will try this way later.

I just so confused that, when I run

Code:

emerge -pv xorg-drivers

the value of VIDEO_CARDS has three parts :
1. some red letters such as "nvidia intel fbdev vesa", which I set in make.conf
2. some blue letters such as "-virtualbox -vmware "
3. some green letters such as "-intel* -fbdev* -vesa*"

I have no idea where those green letters comes from and how to unset them

Everything you specifically tell portage to install by typing emerge foo will be recorded in the world file, thus will be considered for every world update. Normally, you don't specifically put stuff in there, that is only a dependency of something you want to install. Thus you would, for example, type "emerge gnome" and not "emerge gnome, gnome-vfs, gnome-games …"
It's not really bad if you have those in your world file, afaik. I know I have some packages that are actually only dependencies in my worldfile.

Anyway, to avoid having them there, you can use emerge -1 foo, where 1 is the number one. This way portage won't put the package you installed into the world file.
As to the "some green letters such as "-intel* -fbdev* -vesa*" - you don't have to set that anywhere. If intel, fbdev and vesa aren't set in your make.conf or any other file that tells portage about use flags, they won't be activated. The * indicates that they were activated before, however. If you want to have these useflags enabled, you can add intel, fbdev and vesa to your make.conf' VIDEO_CARDS section.
Since you have an nvidia card, however, putting nvidia there should actually be enough - but you'll probably need to generate a xorg.conf (manually or with nvidia-xconfig). If you don't do that, but put fbdev, vesa and intel into your make.conf, this actually means that x will run either on some intel chip that might be on your motherboard/ in your intel processor or in software rendering mode, but not on your nvidia card._________________Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest

Everything you specifically tell portage to install by typing emerge foo will be recorded in the world file, thus will be considered for every world update. Normally, you don't specifically put stuff in there, that is only a dependency of something you want to install. Thus you would, for example, type "emerge gnome" and not "emerge gnome, gnome-vfs, gnome-games …"
It's not really bad if you have those in your world file, afaik. I know I have some packages that are actually only dependencies in my worldfile.

Anyway, to avoid having them there, you can use emerge -1 foo, where 1 is the number one. This way portage won't put the package you installed into the world file.
As to the "some green letters such as "-intel* -fbdev* -vesa*" - you don't have to set that anywhere. If intel, fbdev and vesa aren't set in your make.conf or any other file that tells portage about use flags, they won't be activated. The * indicates that they were activated before, however. If you want to have these useflags enabled, you can add intel, fbdev and vesa to your make.conf' VIDEO_CARDS section.
Since you have an nvidia card, however, putting nvidia there should actually be enough - but you'll probably need to generate a xorg.conf (manually or with nvidia-xconfig). If you don't do that, but put fbdev, vesa and intel into your make.conf, this actually means that x will run either on some intel chip that might be on your motherboard/ in your intel processor or in software rendering mode, but not on your nvidia card.

Thanks for your interpretation! It really helps me to use the portage.
And I used to think the start(*) in green letters are wildcards which canceled out my settings in make.conf.
I will try nvidia-xconfig when I back home. Thanks a lot !

You're welcome.
I found "man emerge" and "man portage" to be quite helpful. Lots of stuff to learn about portage in there._________________Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest

You're welcome.
I found "man emerge" and "man portage" to be quite helpful. Lots of stuff to learn about portage in there.

Hi, I use nvidia-xconfig to generate a xorg.conf and now there is another problem.
When I run startx, the log says "failed to load module nvidia". While there is "nvidia" in the output of lsmod.
I googled and found a similar post in this forum, but the solution seems out of dated.

Module nvidia is the proprietary nVidia driver. The Nouveau driver is the open source driver for nVidia cards, but is not maintained or supported by nVidia Corporation. You must pick which one you wish to use. If you have nvidia-xconfig, then you are using the proprietary driver. If you want to continue to use the proprietary driver, then do not build Nouveau. If you want to use the open driver, then you should remove the proprietary driver from your system and build Nouveau.

Module nvidia is the proprietary nVidia driver. The Nouveau driver is the open source driver for nVidia cards, but is not maintained or supported by nVidia Corporation. You must pick which one you wish to use. If you have nvidia-xconfig, then you are using the proprietary driver. If you want to continue to use the proprietary driver, then do not build Nouveau. If you want to use the open driver, then you should remove the proprietary driver from your system and build Nouveau.

Do you mean the nvidia modules I load maybe the Nouveau one I installed before?
Could you tell me how to remove the Nouveau one? Should I just set VIDEO_CARDS="nvidia" and emerge xorg-server again? Thanks!

Module nvidia is the proprietary nVidia driver. The Nouveau driver is the open source driver for nVidia cards, but is not maintained or supported by nVidia Corporation. You must pick which one you wish to use. If you have nvidia-xconfig, then you are using the proprietary driver. If you want to continue to use the proprietary driver, then do not build Nouveau. If you want to use the open driver, then you should remove the proprietary driver from your system and build Nouveau.

Do you mean the nvidia modules I load maybe the Nouveau one I installed before?
Could you tell me how to remove the Nouveau one? Should I just set VIDEO_CARDS="nvidia" and emerge xorg-server again? Thanks!

I can load the nvidia module finally

But it still failed to startx because of "No devices detected".
I am google-ing ! Just post the progress here for updating and looking forward to more guidance.
Thanks all !

No, the noveau module is called noveau, so your nvidia module is the proprietary nvidia driver.
The nouveau module is built when you emerge xorg-drivers with the "nouveau" useflag.

If it is indeed a kernel mismatch, you could emerge xorg-drivers (not necessary, as far as I know) and nvidia-drivers (necessary) anew and see if it does the trick. Before doing that it is a good idea to check if your /usr/src/linux symling points to the kernel you're actually using. Type "uname -a "to see which kernel you're running and "eselect kernel list" to see where the symlink points to. If both match, re-emerge nvidia-drivers, modprobe nvidia and retry startx.

Edit: Oh, too late it seems._________________Kali Ma
Now it's autumn of the aeons
Dance with your sword
Now it's time for the harvest

No, the noveau module is called noveau, so your nvidia module is the proprietary nvidia driver.
The nouveau module is built when you emerge xorg-drivers with the "nouveau" useflag.

If it is indeed a kernel mismatch, you could emerge xorg-drivers (not necessary, as far as I know) and nvidia-drivers (necessary) anew and see if it does the trick. Before doing that it is a good idea to check if your /usr/src/linux symling points to the kernel you're actually using. Type "uname -a "to see which kernel you're running and "eselect kernel list" to see where the symlink points to. If both match, re-emerge nvidia-drivers, modprobe nvidia and retry startx.

Edit: Oh, too late it seems.

Thank you as same!
Now I am struggling with the "No devices detected".
Could you give me some tips?