# USB Mouse, nVidia GeForce 2 Video Card.. not uncommon..

## frachel

This is a very common setup. Exactly what to I need to do to get Gentoo working with X?

----------

## karl11

Hey. It's not an uncommon setup at all. In fact, I share the same setup and have the whole thing working. Unfortunately, I am currently on an SGI O2 at work instead of my Gentoo Linux box at home. When I get home tonight, I will post important parts of my XF86Config file along with an explanation of how to use xf86config to make one for your own computer. I am assuming you have x installed. For right now though, to get the nvidia card working, please do the following:

emerge nvidia-kernel && nvidia-glx

and add the following line to /etc/modules.autoload:

NVdriver

I am looking forward to helping you out on this one!

Karl Abbott

----------

## frachel

Thanks, I'll do those 2 things tonight and see how it goes.

----------

## karl11

Please note that doing the above instructions will only install the driver and the NVidia GLX extensions, they will not automatically fix your X woes. Should have more within the next 6-7 hours.

Karl

----------

## frachel

Yeah figured that.. If only XFree86 -configure would be able to create a working file (can never find mouse)..

I'll be checking for updates   :Very Happy: 

Thanks,

Frank

----------

## karl11

Frank,

   This is long...please bear with it...You might want to print it out.

Here is my mouse section:

Section "InputDevice"

  Driver        "mouse"

  Identifier    "Mouse[1]"

  Option        "Device"        "/dev/input/mouse0"

  Option        "Emulate3Buttons"       "on"

  Option        "Name"          "AutoDetected"

  Option        "Protocol"      "imps/2"

  Option        "Vendor"        "AutoDetected"

  Option        "ZAxisMapping"  "4 5"

EndSection

The ZAxisMapping is for the wheel mouse and /dev/input/mouse0 is for a usb mouse, /dev/psaux is a ps2 mouse

This is my video driver section for the GeForce2:

Section "Device"

  BoardName     "AutoDetected"

  Driver        "nvidia"

  Identifier    "Device[0]"

  Option        "dpms"

  VendorName    "AutoDetected"

EndSection

And now, an explanation on using xf86config to generate /etc/X11/XF86Config

run /usr/X11R6/bin/xf86config

At the first screen, it talks about the program. Press Enter Here.

At the second screen, it asks about a mouse. Since you are going to replace the mouse section with the above later on, it doesn't matter much, but to get going, pick option "4" --Ps/2 mouse (yes i know it's usb...it still uses the ps/2 architecture)

The next question is Emulate3Buttons? Answer y here.

The next question is Mouse Device? Answer /dev/input/mouse0 for a usb mouse or /dev/psaux for a pure ps/2 mouse...but again, you can just use my mouse section from above.

The next question: Enter a Number to choose a keyboard.  5 always works for me...just pick something appropriate here...it's kind of hard to mess this part  up.

The Next Question: Enter a Number to choose a country: (self explanatory) I use option 1 (US English) here.

The Next Question: Please enter a variant name for 'us' layout. Or just press enter

for default variant (Pressing Enter is fine)

The Next Question: Please answer the following question with either 'y' or 'n'.

Do you want to select additional XKB options (group switcher,

group indicator, etc.)? (Most likely you will answer N to this) I pick N.

The Next Question: Press enter to continue.... (Press Enter....there will be text talking about the monitor)

The Next Question: Enter Your Choice: (there are different monitor types here...a brief explanation as I can't answer what's best for you:

Find the monitor choice that best matches your monitor's highest resolution...4 and 8 are very common. I personally use option 4.

The Next Question: Enter Your choice: (Information on Vertical Sync Ranges pops up. As a safety, go with 1...else consult your monitor documentation. 1 usually works well for both type 4 and 8 monitors from the previous question.

The Next Question: The strings are free-form, spaces are allowed.

Enter an identifier for your monitor definition: (Enter whatever text you want...I say gentoo)

Next Question: Do you want to look at the card database? Say yes and pick 322...not the nvidia geforce 2, but it's easy to change when it's over.

Next Question: How much video memory do you have on your video card: .....

Enter your choice: Pick 6 for other...I am assuming you have 32, but will give the numbers for 16 mb, 32 mb, 64 mb, and 128 mb.

Next Question: Amount of video memory in Kbytes:

Use the following table

RAM           Value in Kb

16 MB   --  16384

32 MB   --  32768

64 MB   --  65536

128 MB --  131072

The Next Question: The strings are free-form, spaces are allowed.

Enter an identifier for your video card definition:  (again, call it whatever...this is really unimportant unless you start running multiple cards)

The Next Question: Enter your choice: (there is information on the modes...if you will be using 16 bit, then pick option 2...if you wish to use 24 bit, then pick option 3. I personally prefer and use 16 bit)

The Next Question: Which modes? (Look at the above list and pick your modes...it works best to pick the mode you want to run all the time in first, and then to not pick any higher resolution modes. For instance: 341 would cause undesirable results...That's modes 3, then 4, then 1...yes you can run them together like that. In my configuration, I always use 432)

The Next Question: Do you want a virtual screen that is larger than the physical screen?

Chances are you'll want to say no here. Saying yes can cause undesirable results unless you want a larger virtual screen than your monitor. To be safe, pick n.

The Next Question: Back to the same modes question about changing the modes...pick 4 to continue)

The Next Question: Enter a number to choose the default depth. ( I use 16 bit, option # 4...it works really well, it is up to you whether or not to use 24 bit, option 5. It all depends on what you just set up in the last few steps.)

The Next Question: Shall I write it to /etc/X11/XF86Config?  y and enter will do this.

You are now done running xf86config!

Find the following section in /etc/X11/XF86Config and replace it with my mouse section from above:

"

# **********************************************************************

# Core Pointer's InputDevice section

# **********************************************************************

Section "InputDevice"

# Identifier and driver

    Identifier  "Mouse1"

    Driver      "mouse"

    Option "Protocol"    "PS/2"

    Option "Device"      "/dev/input/mouse0"

# When using XQUEUE, comment out the above two lines, and uncomment

# the following line.

#    Option "Protocol"  "Xqueue"

# Baudrate and SampleRate are only for some Logitech mice. In

# almost every case these lines should be omitted.

#    Option "BaudRate"  "9600"

#    Option "SampleRate"        "150"

# Emulate3Buttons is an option for 2-button Microsoft mice

# Emulate3Timeout is the timeout in milliseconds (default is 50ms)

    Option "Emulate3Buttons"

#    Option "Emulate3Timeout"    "50"

# ChordMiddle is an option for some 3-button Logitech mice

#    Option "ChordMiddle"

EndSection

# **********************************************************************

"

Then find this section in /etc/X11/XF86Config and replace it with my video information from above: 

# Device configured by xf86config:

Section "Device"

    Identifier  "nv"

    Driver      "nv"

    #VideoRam    32768

    # Insert Clocks lines here if appropriate

EndSection

Now go edit /etc/rc.conf and set the following:

DISPLAYMANAGER=xdm 

Note, at first this line will be commented, remove the comment. When you get kde or gnome, you can later change this to kdm or gdm depending on preference.

Also, set this line:

XSESSION=Xsession

This will give you something to work with on startx.... Change it to KDE or Gnome once you install either one...I think rc.conf is well commented. 

Save this file and then do the following:

startx /usr/X11R6/bin/xterm

If you get x with an xterm then you are in business. At this point run glxgears and check and make sure that in the default mode your fps is above 700. If so, then your card is running well...I average in the 800s. (running 1024X768 at 16bit....frame rates will vary based on resolution)

I don't know much of what else to tell you if you follow these instructions to the core. They should be enough to get you up and running. So essentially I just wrote the guide to X with an Nvidia card from scratch. And an:

emerge kdelibs kde

- or - 

emerge gnome

- or - 

emerge fluxbox

or whatever you use would strongly be recommended here. Afterwards, edit the /etc/rc.conf accordingly and then execute this statement if you would like to add the graphical login at boot instead of text login:

rc-update add xdm default

Hope this helps  :Smile: 

Karl Abbott

----------

## frachel

Wow, thanks for the detailed help. I'm printing it now and will go try it!

----------

