# nvidia driver without xorg.conf?



## rhish (Dec 9, 2012)

Is it possible to tell X to use the nvidia driver, without using the 
	
	



```
/etc/X11/xorg.conf
```
 file to do so?

If I [cmd=]startx[/cmd] without the 
	
	



```
xorg.conf
```
 file, everything works correctly, but it uses nv driver.
X use to work with this laptop, but the values which use to work, now result in a distorted bleached out display.

So, to cut to the chase, I want to let X auto configure everything, without an 
	
	



```
xorg.conf
```
 file. But, I also want it to use the nvidia driver, as opposed the nv driver.

The alternative is a long drawn out thread about various HorizSyn/VertRefresh values not working. Posting all sorts of config files and logs, et al. Which, I'm trying to avoid.

Thanks


----------



## cpm@ (Dec 9, 2012)

Quoting handbook section X11 Configuration:


> *Xorg* can often work without any further configuration steps  by simply typing at prompt:
> 
> % startx



To use nVidia driver instead nv(4x) driver, follow instructions that can be found under: http://www.freebsd.org/doc/en/articles/compiz-fusion/nvidia-setup.html.


----------



## rhish (Dec 9, 2012)

cpu82 said:
			
		

> Instructions can be found under: http://www.freebsd.org/doc/en/articles/compiz-fusion/nvidia-setup.html.



Can you explain? please


----------



## cpm@ (Dec 9, 2012)

According to the handbook section, you should follow this steps:

First, be sure you have update ports tree.

Then, install x11/nvidia-driver as follow way:

```
# cd /usr/ports/x11/nvidia-driver
# make install clean
```

Add the following line to the /boot/loader.conf file:

```
nvidia_load="YES"
```

To load the module without having to reboot, simply type:
`# kldload nvidia`

Now it depends if you want to create xorg.conf or not.

If you decide to create xorg.conf, do the following:

```
# Xorg -configure
# cp xorg.conf.new /etc/X11/xorg.conf
```

Verifies in Section "Device",  that recognized nVidia driver:

```
Driver      "nvidia"
```

Further information about configuring xorg.conf, check out http://www.freebsd.org/doc/en/articles/compiz-fusion/xorg-configuration.html.

To test that everything is working properly, just type:
`#  startx`

If you have any doubt, I will try to help you


----------



## rhish (Dec 10, 2012)

Oh, yeah, the whole point of my post was to ask if there is a way of forcing X to use the nvidia driver Without using an xorg.conf file. I should have been more clear. The laptop runs perfect without an xorg.conf file. X auto configures everything and it works. But it auto configures to using the nv driver instead of the nvidia driver.
I was asking if there is a way of telling X to use the nvidia driver, and not the nv driver, specifically without having to use an xorg.conf file.

sorry for the confusion.

Edit: by the way, I have everything pretty much configured the way you've outlined. The noted exception being, I want X to use the nvidia driver without having to tell it to do so with an xorg.conf file. Once I do so, mayhem ensues.


----------



## cpm@ (Dec 10, 2012)

This requires change in /etc/X11/xorg.conf:

```
Driver      "nv"
```
Change it to:

```
Driver      "nvidia"
```

For that change work, xorg.conf use is necessary.


----------



## Martillo1 (Dec 14, 2012)

To free you from hassle, use x11/nvidia-xconfig. It will generate a suitable xorg.conf file which you can use directly.


----------



## kpedersen (Dec 14, 2012)

Perhaps you can physically remove the nv kernel module and X11 might fallback to nvidia?

Perhaps there is a way to write an xorg.conf file which only has the nvidia line and nothing else?


----------



## SirDice (Dec 14, 2012)

The nv driver doesn't have a kernel module.


----------



## kpedersen (Dec 14, 2012)

Well perhaps I will keep on with my wild guesses then 

Uninstall the x11-drivers/xf86-video-nv?


----------



## adamk (Dec 14, 2012)

As with your previous wild guess, you are wrong. Vanilla Xorg will *never* load the nvidia driver without some sort of configuration file specifying the driver.


----------



## SirDice (Dec 14, 2012)

Here's a basic config for use with the NVidia driver:

```
Section "ServerLayout"
        Identifier      "Default Layout"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
        ModulePath   "/usr/local/lib/xorg/modules"
        FontPath     "/usr/local/lib/X11/fonts/misc/"
        FontPath     "/usr/local/lib/X11/fonts/TTF/"
        FontPath     "/usr/local/lib/X11/fonts/OTF"
        FontPath     "/usr/local/lib/X11/fonts/Type1/"
        FontPath     "/usr/local/lib/X11/fonts/100dpi/"
        FontPath     "/usr/local/lib/X11/fonts/75dpi/"
        FontPath     "/usr/local/lib/X11/fonts/bitstream-vera/"
        FontPath     "/usr/local/lib/X11/fonts/cyrillic/"
        FontPath     "/usr/local/lib/X11/fonts/webfonts/"
        FontPath     "/usr/local/lib/X11/fonts/dejavu/"
        FontPath     "/usr/local/lib/X11/fonts/terminus-font/"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option      "Device" "/dev/sysmouse"
        Option      "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Device"
        Identifier  "Card0"
        Driver      "nvidia"
        VendorName  "nVidia Corporation"
        BoardName   "G73 [GeForce 7600 GT]"
        Screen      0
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection

Section "ServerFlags"
  Option "AutoAddDevices"  "off"
EndSection
```


----------



## wblock@ (Dec 14, 2012)

All that should be required is the Device section:

```
Section "Device"
        Driver      "nvidia"
EndSection
```

The rest should be auto-configuring.


----------



## rhish (Dec 15, 2012)

So, I should be able to create an xorg.conf file, with just the content you listed, and it should auto configure everything else?

I think the problem is the nvidia driver then. Because, nv works, well, by itself, no xorg.conf file.

But, as soon as I switch to the nvidia driver, with everything else still auto configured, I get screen distortion. really harsh screen distortion. 

I thought maybe it was me, messing something up in the xorg.conf file. But, I know xorg can auto configures itself and work well. Its just when the nvidia driver is used.


----------



## rhish (Dec 15, 2012)

Using just the content you listed, I had to include Identifier to get it to parse, but just what you posted, and then adding Identifier, and nothing else in the file, I get the harsh screen distortion upon startx.

If I completely remove the xorg.conf file, and let everything be auto configured, x works well and the desktop comes up.

I need to set some things up to get the Xorg.0.log off the laptop, then ill post the logs.

thanks everyone.


----------



## cpm@ (Dec 15, 2012)

Please, show output:
`# pciconf -lv | grep device`


----------



## rhish (Dec 15, 2012)

The logs are longer than what is allowed, and their file extension isn't allowed to be uploaded.

I'm just going to stick to nv driver for now. I might try and load an older nvidia and see how it goes.

Thanks anyway for all the help everyone.


----------



## cpm@ (Dec 15, 2012)

Put them on pastebin.com and post the URL. It's enough


----------

