# Xorg/Nvidia Hang and Crash



## pprocacci (Dec 6, 2015)

Trying to get Xorg w/with the Nvidia drivers working and I'm having a terrible time.

I'm running 10.2-STABLE as of a few hours ago.

nvidia-driver-346.96
xorg-7.7_2

Do note I need an Xorg config due to having multiple cards.  Without it, I'd get no screens found:
Xorg configuration:  http://pastebin.ca/3274747

When kern.vty is set to "sc", Xorg works, but hangs when exiting the X11 session.  It also hangs when trying to switch to console via ATL+F1, etc.  Everything becomes unresponsive.

When kern.vty is set to "vt", Xorg fails to load, simply rendering a blank screen, with no way to exit from it.

Both cases require a reboot to get the machine responsive again.

Xorg.log is completely absent of errors when this happens.

Does anyone have any ideas?


----------



## good-beastie (Dec 6, 2015)

Is the nvidia.ko kernel module loading? Try `kldstat` to show all loaded modules.


----------



## pprocacci (Dec 6, 2015)

good-beastie said:


> Is the nvidia.ko kernel module loading? Try `kldstat` to show all loaded modules.



Yep sorry.  I neglected to mention that.

nvidia.ko is loaded just fine.

In fact, I'm typing this message to you from the same machine with kern.vty=sc currently set.   If I exit this session ...blam.  Changing it to "=vt" prevents X from starting entirely.

Loaded Modules
------------------------------
http://pastebin.ca/3274931

`dmesg`
-------------------------------
http://pastebin.ca/3274933

/boot/loader.conf
----------------------------------
http://pastebin.ca/3274934

/etc/sysctl.conf
-----------------------------------
http://pastebin.ca/3274937

/etc/rc.conf
-----------------------------------
http://pastebin.ca/3274943

`pkg info | awk ' { print $1 } '`
-----------------------------------
http://pastebin.ca/3274940


Thanks for writing back so quickly.  I'm eager to solve this.


----------



## good-beastie (Dec 6, 2015)

post: 305622 said:
			
		

> Yep sorry.  I neglected to mention that.
> 
> nvidia.ko is loaded just fine.
> 
> ...


You are welcome pprocacci. Did you install x11/nvidia-driver after the update to current 10.2-STABLE? Could you also post your /etc/ttys.


----------



## pprocacci (Dec 6, 2015)

good-beastie said:


> You are welcome pprocacci. Did you install x11/nvidia-driver after the update to current 10.2-STABLE?



Yes.  I always recompile kernel modules after a new kernel/world gets installed.


----------



## good-beastie (Dec 6, 2015)

pprocacci said:


> Yes.  I always recompile kernel modules after a new kernel/world gets installed.


Ok, I notice the x11/slim login manager in your rc.conf and that may need a setting in /etc/ttys. Or try to start Xorg without x11/slim using `startx`.


----------



## pprocacci (Dec 6, 2015)

good-beastie said:


> Ok, I notice the slim login manager in your rc.conf and that may need a setting in /etc/ttys. Or try to start Xorg without slim using `startx`.



With slim(1) disabled, and starting X via `startx` resulted in the exact same problems mentioned above.  However, I do have another interesting thing I came across ...

The problem isn't Xorg... but I still don't know what the problem is.
While on the console (hadn't ran startx(1) yet) and with vt(4) enabled, simply trying to change virtual terminals via ALT+F2, etc hung the machine.
Yet with sc(4) enabled, switching worked just fine .... `startx` worked ... yet exiting Xorg hung the machine.

So even with Xorg not in the picture, the problem exists.

Edit:  I assume this is a bug in the Nvidia card.  After extensive reading, it appears that Nvidia has been mucking things up with the 3xx series of drivers.  I think I'm going to give up on Nvidia.


----------



## good-beastie (Dec 6, 2015)

pprocacci said:


> With slim(1) disabled, and starting X via `startx` resulted in the exact same problems mentioned above.  However, I do have another interesting thing I came across ...
> 
> The problem isn't Xorg... but I still don't know what the problem is.
> While on the console (hadn't ran startx(1) yet) and with vt(4) enabled, simply trying to change virtual terminals via ALT+F2, etc hung the machine.
> ...


Hold on, some infomation here: https://www.freebsd.org/news/status/report-2014-04-2014-06.html#Updated-vt(4)-System-Console. And more info here: https://wiki.freebsd.org/Newcons. And vga(4) may work with sc(4).


----------



## protocelt (Dec 7, 2015)

pprocacci, just to cover the all the bases here since your building the OS from source, are you sure that kernel and world are in sync? It can sometimes cause mysterious issues if they are not.


----------

