# xorg.conf and /usr/local/etc/X11/xorg.conf.d/nvidia-driver wont work.



## clawhammer (Jul 27, 2018)

Whenever I create one of these files from the countless posts about how to get nvidia cards to work x server wont boot for me. I have a 7th gen intel chip and a nvidia gtx1060 card. I used 
	
	



```
drm-next-kmod driver.
```
 I added 
	
	



```
kld_list="/boot/modules/i915kms.ko"
```
 to rc.conf. If I remove the xorg config files I can boot into KDE (I am assuming with intel integrated graphics). But once I add a xorg conf and run nvidia-xconfig the xserver wont boot. I would really like to use this card. It shows up as recognized 
	
	



```
vgapci0@pci0:1:0:0: class=0x030000 card=0x11d71462 chip=0x1c2010de rev=0xa1 hrd=0x00
vender = 'NVIDIA Corporation'
device = 'GP106M [GeForce GTX 1060 Mobile]'
class    = display
subclass = VGA
```

Ive tried a bunch of things off the forums. Im on 11.2 release. Thank you.

The error I get when xserver tries to start is 

```
kdm[639]: X server died during startup.
kdm[639]: X server for display :0 cannot be started, session disable.
```


----------



## otapamo (Jul 27, 2018)

First: Have you installed the nvidia-driver-390.67 with pkg?

The i915kms.ko is for intel graphics. The kernel module for nvidia is something else. I believe to use this add: nvidia_load="YES" to /etc/loader.conf

and for xorg, use /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf and add something like:


```
Section "Device"
        Identifier "Nvidia Card"
        Driver "nvidia"
        VendorName "NVIDIA Corporation"
        BoardName "GeForce GTX 1060"
EndSection
```


----------



## clawhammer (Jul 27, 2018)

otapamo said:


> First: Have you installed the nvidia-driver-390.67 with pkg?
> 
> The i915kms.ko is for intel graphics. The kernel module for nvidia is something else. I believe to use this add: nvidia_load="YES" to /etc/loader.conf
> 
> ...



I used the nvidia-driver. It said in the documentation that it is the correct one for the newer cards. I also did the configuration file setup you said and it makes xserver not boot.

I tried the nvidia graphics card before I did the i915kms.ko so I dont think its interfering.


----------



## otapamo (Jul 27, 2018)

OK. Have you removed the xorg.conf you had from before, and have you removed the line from rc.conf which loads the i915kms.ko?


----------



## clawhammer (Jul 28, 2018)

otapamo said:


> OK. Have you removed the xorg.conf you had from before, and have you removed the line from rc.conf which loads the i915kms.ko?



I did the driver-nvidia.conf. and I modified the rc.conf to not have i915kms.ko but x wont start. It only starts if I delete driver-nvidia.conf and add i915kms.ko to rc.conf.

also in kde when I go to nvidia x server settings is say 
	
	



```
You do not appear to be using the nvidia x driver. Please edit your X configuration file (just run 'nvidia-xconfig' as root), and restart the x server.
```
 but if I do that x server wont start.


----------



## otapamo (Jul 28, 2018)

Hmm. I believe I did a mistake. Should be /boot/loader.conf not /etc/loader.conf.

If you use the nvidia_load="YES" line in /boot/loader.conf and run kldstat, what is the output? Does it list some nvidia module to be loaded?


----------



## scottro (Jul 28, 2018)

You'll be better off keeping this to one thread, as right now, you have people trying to help in two threads.  You've been given answers about what to put in /boot/loader.conf (not /etc/, though you can put them in /etc/rc.conf) in the other thread.

https://forums.freebsd.org/threads/howto-setup-xorg-with-nvidias-driver.52311/   (Mostly, I think, on page 2)


----------



## ilikesci (Jul 29, 2018)

When I installed nvidia-driver it said that it is missing a dependency: lame. I thought I would mention that.


----------



## clawhammer (Jul 29, 2018)

Can someone take a look at my Xorg log file? I am still having the same problems.


```
[     8.508]
X.Org X Server 1.18.4
Release Date: 2016-07-19
[     8.508] X Protocol Version 11, Revision 0
[     8.508] Build Operating System: FreeBSD 11.1-RELEASE-p11 amd64
[     8.508] Current Operating System: FreeBSD home 11.2-RELEASE FreeBSD 11.2-RELEASE #0 r335510: Fri Jun 22 04:32:14 UTC 2018     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
[     8.508] Build Date: 07 July 2018  09:21:37AM
[     8.508] 
[     8.508] Current version of pixman: 0.34.0
[     8.508]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[     8.508] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[     8.508] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Jul 29 01:27:48 2018
[     8.510] (==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
[     8.510] (==) No Layout section.  Using the first Screen section.
[     8.510] (==) No screen section available. Using defaults.
[     8.510] (**) |-->Screen "Default Screen Section" (0)
[     8.510] (**) |   |-->Monitor "<default monitor>"
[     8.511] (==) No device specified for screen "Default Screen Section".
    Using the first device section listed.
[     8.511] (**) |   |-->Device "NVIDIA Card"
[     8.511] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[     8.511] (==) Automatically adding devices
[     8.511] (==) Automatically enabling devices
[     8.511] (==) Not automatically adding GPU devices
[     8.511] (==) Max clients allowed: 256, resource mask: 0x1fffff
[     8.514] (==) FontPath set to:
    /usr/local/share/fonts/misc/,
    /usr/local/share/fonts/TTF/,
    /usr/local/share/fonts/OTF/,
    /usr/local/share/fonts/Type1/,
    /usr/local/share/fonts/100dpi/,
    /usr/local/share/fonts/75dpi/
[     8.514] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[     8.514] (II) The server relies on devd to provide the list of input devices.
    If no devices become available, reconfigure devd or disable AutoAddDevices.
[     8.514] (II) Loader magic: 0x80fc90
[     8.514] (II) Module ABI versions:
[     8.514]     X.Org ANSI C Emulation: 0.4
[     8.514]     X.Org Video Driver: 20.0
[     8.514]     X.Org XInput driver : 22.1
[     8.514]     X.Org Server Extension : 9.0
[     8.514] (!!) More than one possible primary device found
[     8.514] (--) PCI: (0:0:2:0) 8086:591b:1462:11d7 rev 4, Mem @ 0xdd000000/16777216, 0xb0000000/268435456, I/O @ 0x0000f000/64, BIOS @ 0x????????/65536
[     8.514] (--) PCI: (0:1:0:0) 10de:1c20:1462:11d7 rev 161, Mem @ 0xde000000/16777216, 0xc0000000/268435456, 0xd0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/65536
[     8.515] (II) LoadModule: "glx"
[     8.515] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[     8.565] (II) Module glx: vendor="NVIDIA Corporation"
[     8.565]     compiled for 4.0.2, module version = 1.0.0
[     8.565]     Module class: X.Org Server Extension
[     8.565] (II) NVIDIA GLX Module  390.67  Thu May 31 22:47:14 PDT 2018
[     8.566] (II) LoadModule: "nvidia"
[     8.566] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[     8.570] (II) Module nvidia: vendor="NVIDIA Corporation"
[     8.570]     compiled for 4.0.2, module version = 1.0.0
[     8.570]     Module class: X.Org Video Driver
[     8.570] (II) NVIDIA dlloader X Driver  390.67  Thu May 31 22:22:58 PDT 2018
[     8.570] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[     8.571] (--) Using syscons driver with X support (version 2.0)
[     8.571] (--) using VT number 9

[     8.598] (EE) No devices detected.
[     8.598] (EE)
Fatal server error:
[     8.598] (EE) no screens found(EE)
[     8.598] (EE)
Please consult the The X.Org Foundation support
     at http://wiki.x.org
for help.
[     8.598] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[     8.598] (EE)
[     8.615] (EE) Server terminated with error (1). Closing log file.
```

loader.conf


```
#linux_load="YES"
nvidia_load="YES"
nvidia_name="nvidia"
nvidia_modeset_load="YES"
nvidia_modeset_name="nvidia-modeset.ko"
kern.vty=vt
```

rc.conf


```
hostname="home"
ifconfig_alc0="DHCP"
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
kld_list="nvidia-modeset.ko"
dbus_enable="YES"
hald_enable="YES"
kdm4_enable="YES"
#kld_list="nvidia-modeset"
```

driver-nvidia.conf


```
Section "Device"
    Identifier "NVIDIA Card"
    VendorName "NVIDIA Corporation"
    Driver "nvidia"
    BusID "PCI:0:1:0:0"
    Screen 0
EndSection
```


----------



## Phishfry (Jul 29, 2018)

Didn't I cover this already some other thread? You have your colon misplaced here. Dunno if that's the problem.


clawhammer said:


> BusID "PCI:0:1:0:0"


*PCI0:1:0:0*


----------



## clawhammer (Jul 29, 2018)

Phishfry said:


> Didn't I cover this already some other thread? You have your colon misplaced here. Dunno if that's the problem.
> 
> *PCI0:1:0:0*





Phishfry said:


> Didn't I cover this already some other thread? You have your colon misplaced here. Dunno if that's the problem.
> 
> *PCI0:1:0:0*



I changed it but its still the same error.


```
[    24.567] 
X.Org X Server 1.18.4
Release Date: 2016-07-19
[    24.567] X Protocol Version 11, Revision 0
[    24.567] Build Operating System: FreeBSD 11.1-RELEASE-p11 amd64 
[    24.567] Current Operating System: FreeBSD home 11.2-RELEASE FreeBSD 11.2-RELEASE #0 r335510: Fri Jun 22 04:32:14 UTC 2018     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
[    24.567] Build Date: 07 July 2018  09:21:37AM
[    24.567]  
[    24.567] Current version of pixman: 0.34.0
[    24.567]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[    24.567] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    24.567] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Jul 29 02:17:42 2018
[    24.567] (==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
[    24.567] (==) No Layout section.  Using the first Screen section.
[    24.567] (==) No screen section available. Using defaults.
[    24.567] (**) |-->Screen "Default Screen Section" (0)
[    24.567] (**) |   |-->Monitor "<default monitor>"
[    24.567] (==) No device specified for screen "Default Screen Section".
    Using the first device section listed.
[    24.567] (**) |   |-->Device "NVIDIA Card"
[    24.567] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[    24.567] (==) Automatically adding devices
[    24.567] (==) Automatically enabling devices
[    24.567] (==) Not automatically adding GPU devices
[    24.567] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    24.567] (==) FontPath set to:
    /usr/local/share/fonts/misc/,
    /usr/local/share/fonts/TTF/,
    /usr/local/share/fonts/OTF/,
    /usr/local/share/fonts/Type1/,
    /usr/local/share/fonts/100dpi/,
    /usr/local/share/fonts/75dpi/
[    24.567] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[    24.567] (II) The server relies on devd to provide the list of input devices.
    If no devices become available, reconfigure devd or disable AutoAddDevices.
[    24.567] (II) Loader magic: 0x80fc90
[    24.567] (II) Module ABI versions:
[    24.567]     X.Org ANSI C Emulation: 0.4
[    24.567]     X.Org Video Driver: 20.0
[    24.567]     X.Org XInput driver : 22.1
[    24.567]     X.Org Server Extension : 9.0
[    24.567] (!!) More than one possible primary device found
[    24.567] (--) PCI: (0:0:2:0) 8086:591b:1462:11d7 rev 4, Mem @ 0xdd000000/16777216, 0xb0000000/268435456, I/O @ 0x0000f000/64, BIOS @ 0x????????/65536
[    24.567] (--) PCI: (0:1:0:0) 10de:1c20:1462:11d7 rev 161, Mem @ 0xde000000/16777216, 0xc0000000/268435456, 0xd0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/65536
[    24.567] (II) LoadModule: "glx"
[    24.567] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[    24.572] (II) Module glx: vendor="NVIDIA Corporation"
[    24.572]     compiled for 4.0.2, module version = 1.0.0
[    24.572]     Module class: X.Org Server Extension
[    24.572] (II) NVIDIA GLX Module  390.67  Thu May 31 22:47:14 PDT 2018
[    24.572] (II) LoadModule: "nvidia"
[    24.572] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[    24.572] (II) Module nvidia: vendor="NVIDIA Corporation"
[    24.572]     compiled for 4.0.2, module version = 1.0.0
[    24.572]     Module class: X.Org Video Driver
[    24.572] (II) NVIDIA dlloader X Driver  390.67  Thu May 31 22:22:58 PDT 2018
[    24.572] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[    24.572] (--) Using syscons driver with X support (version 2.0)
[    24.572] (--) using VT number 9

[    24.593] (EE) No devices detected.
[    24.593] (EE) 
Fatal server error:
[    24.593] (EE) no screens found(EE) 
[    24.593] (EE) 
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
[    24.593] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    24.593] (EE) 
[    24.610] (EE) Server terminated with error (1). Closing log file.
```


----------



## Phishfry (Jul 29, 2018)

clawhammer said:


> PCI: (0:0:2:0) 8086:591b


I think what is happening is it is defaulting to the first found video adapter. Which is the onboard video.
Disabling this might help.
Optimus laptops take some extra work.


----------



## ilikesci (Jul 29, 2018)

Hello, I have been trying to get xserver on 11.2 to work as well. I have a nvidia GeForce video card as well. I have been following the directions in the handbook and elsewhere. I have installed xorg mate gnome3 kde5 slim. I have myself part of the groups video and wheel. I have tried to configure it with Xorg -configure but get the same error as running startx. It says it is looking for the config files in /usr/local/share/etc/X11/?x?.conf.d   I also added the three items in loader.conf? moused, hald, and one other thing. I have installed the xf86-video-nv, vesa, scfb video drivers. Now with that all said. Can anybody help me to get this to work? I would really appreciate it. I wouldn't care if it was just the Vesa driver at first.


----------



## clawhammer (Jul 29, 2018)

Phishfry said:


> I think what is happening is it is defaulting to the first found video adapter. Which is the onboard video.
> Disabling this might help.
> Optimus laptops take some extra work.



alright. The nvidia gtx 1060 is better than the onboard one?


----------



## clawhammer (Jul 29, 2018)

clawhammer said:


> alright. The nvidia gtx 1060 is better than the onboard one?



What ive read is you cant disable the integrated graphics but have to not use the nvidia?


----------



## EmeraldBot (Jul 30, 2018)

May have found the OP's problem.

*[     8.508] Build Operating System: FreeBSD 11.1-RELEASE-p11 amd64*

and right below:

*Current Operating System: FreeBSD home 11.2-RELEASE FreeBSD 11.2-RELEASE*

If he also installed nvidia-driver through pkg, he's trying to use the 11.1 version on 11.2, and that might be breaking things because of the kernel change. If he builds it through ports, that'll compile it for his current kernel version. Unless I'm being silly and he already did this... ^~^"


----------



## ilikesci (Jul 30, 2018)

Hello, I found out I have a hybrid. I have a intel and nvidia cards. I read somewhere that the nvidia card will not work on 11.2 and that I have to recompile the kernel to get it to work? I am using the vesa driver and I can get some of the minimal desktops to work (afterstep, lumina, Window Maker, twm, fvmw, blackbox, fluxbox, xfce) but not the one I want. I want to use mate but mate, kde, and gnome will not work. It still says something like $DISPLAY is not set or cannot connect to the x server. I tried putting the BusID "pci0:0:2:0" and BusID "pci0:1:0:0" in the vesa conf file it did not help(not at the same time). Any help will be appreciated.


----------



## SirDice (Jul 31, 2018)

ilikesci said:


> I read somewhere that the nvidia card will not work on 11.2 and that I have to recompile the kernel to get it to work?


No, you just need to build x11/nvidia-driver by using the port. The package is currently built for 11.1 and won't work on 11.2.

That said, Optimus (the Intel/NVidia 'hybrid') is still problematic though. You may be able to use either the Intel or the NVidia card if you can disable one of them in the BIOS.


----------



## ilikesci (Aug 1, 2018)

I will try to compile the nvidia-driver and Thank You for that. I looked in the bios already and that was not an option to turn one off. FYI the sticker says it Nvidia GeForce GTX 860M.
Thanks Again.
Micah


----------



## clawhammer (Aug 1, 2018)

ilikesci said:


> I will try to compile the nvidia-driver and Thank You for that. I looked in the bios already and that was not an option to turn one off. FYI the sticker says it Nvidia GeForce GTX 860M.
> Thanks Again.
> Micah


I have intel hd graphics with an nvidia 1060 but no matter what i did it would recognize both gpus and i can only use the intel graphics for xserver. Theres no option in my bios to turn either one off.


----------



## SirDice (Aug 1, 2018)

ilikesci said:


> FYI the sticker says it Nvidia GeForce GTX 860M.


According to https://www.geforce.com/drivers you can use the 'regular' driver for that card; x11/nvidia-driver.

Don't download the driver from the NVidia site though, only use it to lookup which version you need. A driver downloaded from NVidia will work but won't be properly registered in the package system, making it rather difficult to keep track of the installed version.


----------



## alexseitsinger (Aug 2, 2018)

Doesn't the nvidia driver need linux compatibility enabled? If so, I would also make sure you have linux_load="YES" in loader.conf(), and linux_enable="YES" in rc.conf(). Also your fstab might need the required entries: linprocfs -> /compat/linux/proc, and tmpfs -> /compat/linux/dev/shm.


----------

