# xorg not working with 11.2



## doughy (Jul 6, 2018)

I'm trying to get X up and running but I get a no screens found error when I try to start it.  I noticed the Build Operating System is FreeBSD 11.1-RELEASE-p11 amd64.  I tried all available drivers but have not had any success getting it to run.


----------



## Maxnix (Jul 6, 2018)

To start: which graphic card do you have?


----------



## doughy (Jul 6, 2018)

nvidia Quadro K620


----------



## scrappywan (Jul 6, 2018)

It's a known issue with FreeBSD 11.2. The packaged Nvidia driver is built for FreeBSD 11.1 and will fail to work with Xorg. As a workaround, you can build the Nvidia driver from the ports collection and it should work.


----------



## doughy (Jul 6, 2018)

scrappywan, I tried that and it still won't start. Also, what driver should I install? there's a few of them.


----------



## shkhln (Jul 6, 2018)

doughy said:


> I'm trying to get X up and running but I get a no screens found error when I try to start it.



Was it working before? Is that a new install?



> xorg not working with 11.2





doughy said:


> FreeBSD 11.1-RELEASE-p11 amd64.



That bit needs clarification.


----------



## doughy (Jul 6, 2018)

It is a new install.  I just installed 11.2 and tried to install xorg and in the error output it says 

```
Build Operating System: FreeBSD 11.1-RELEASE-p11 amd 64
```


----------



## shkhln (Jul 6, 2018)

`pkg info nvidia-driver`,  `dmesg | grep nvidia`?


----------



## scottro (Jul 6, 2018)

Ok, you said you tried that. Do you know that you have the right NVidia driver?  There is the nvidia driver and also the nvidia-340 driver for older NVidia cards.  (And some other drivers for even older cards.)
However, while I see Quadro 600 listed under legacy, I don't know if that includes the K620.  I don't see anything about that card.

Also, the port requires, I think, having the FreeBSD source code installed. Have you done that? You don't have to run make buildworld but you do have to check out the source code.  NVidia could make the information easier to find, but it seems as if it might take the most current driver, which would be x11/nvidia-driver port as on http://www.nvidia.com/Download/Find.aspx it showed the K620 as certified for the 390.67 if I read the page correctly.

You can install that with your favorite ports tool, or just

```
cd /usr/ports/x11/nvidia/driver; make install clean
```
 as root or using sudo.

I personally find it easiest to also install the x11/nvidia-xconfig port and then run nvidia-xconfig which writes the configuration to /etc/X11/xorg.conf (it may call it nvidia-xorg.conf or similar) and then run startx.

So, question 1.  Do you have the source code installed.  Gotten by running (on the US east coast--this will work for other locations but you probably want one near you


```
svnlite co https://svn0.us-east.freebsd.org/base/releng/11.2 /usr/src
```

I assume, as you said you tried it, that you have the ports tree installed. Try the nvidia-driver port, and the nvidia-xconfig port.  If that doesn't work, then try the nvidia-340 port.


----------



## doughy (Jul 6, 2018)

what info do you want from that?


----------



## shkhln (Jul 6, 2018)

scottro said:


> However, while I see Quadro 600 listed under legacy, I don't know if that includes the K620.  I don't see anything about that card.


It's a Maxwell card according to the Wikipedia page.


----------



## doughy (Jul 6, 2018)

I tried all of your suggestions. Still no luck


----------



## shkhln (Jul 6, 2018)

doughy said:


> what info do you want from that?



Package version and origin (locally built port vs repo), whether kernel driver was or wasn't successfully loaded. And don't even think about retelling your impression of the command(s) output, it should be provided verbatim, otherwise you are wasting everyone's time.


----------



## shkhln (Jul 6, 2018)

shkhln said:


> locally built port vs repo



To be fair, I have no idea whether pkg actually records that information. I was thinking it would be listed somewhere, but it isn't .


----------



## doughy (Jul 6, 2018)

I tried all the combinations of the drivers that would work.  I'm hoping someone finds a fix for this soon as it's been said it's a well known issue.  Do you think it would work if I installed 11.1, installed x and then upgraded?

Is there a way to "rollback" to 11.1?

I'm open to suggestions.


----------



## shkhln (Jul 7, 2018)

shkhln said:


> To be fair, I have no idea whether pkg actually records that information. I was thinking it would be listed somewhere, but it isn't .



Ok, it should be `pkg info -A nvidia-driver`.


----------



## doughy (Jul 7, 2018)

The output of that command is:

```
nvidia-driver-390.48:
    FreeBSD_version: 1102000
```


----------



## shkhln (Jul 7, 2018)

And `dmesg | grep nvidia`?


----------



## doughy (Jul 7, 2018)

dmesg | grep nvidia

```
nvidia0: <Quadro K620> on vgapci0
vgapci0: child nvidia0 requested -ci_enable-io
vgapci0: child nvidia0 requested pci_enable_io
nvidia-modeset: Loading NVIDIA kernel Mode Setting Driver for UNIX platforms 390.48 Wed Mar 21 23:42:12 PDT
```

I thought it might be worth mentioning that these cards have two ports (one dp port and one dvi)


----------



## shkhln (Jul 7, 2018)

That part looks ok. Can you post complete Xorg output?


----------



## doughy (Jul 7, 2018)

I'm going to install 11.1 and see if it works. I'll let you know in about 15 minutes if it works.


----------



## shkhln (Jul 7, 2018)

doughy said:


> I'm going to install 11.1 and see if it works. I'll let you know in about 15 minutes if it works.



That's completely unnecessary and, obviously, invalidates diagnostic steps you already done (waste of time again).


----------



## doughy (Jul 7, 2018)

I'll post the Xorg output. It's just tricky because I can't transfer the file from FreeBSD to my windows computer (the one I'm on now).
it was said earlier that this is the result of the fact the old drivers won't work on the newer version of FreeBSD.  That was my logic in trying 11.1.  It's a fresh install so I don't mind reinstalling.  If you think it's easier this way, I'll try to get the Xorg file over to windows using ssh or something.


----------



## doughy (Jul 7, 2018)

I also forgot to mention that I've gone over these steps with people on irc


----------



## doughy (Jul 7, 2018)

X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: FreeBSD 11.1-RELEASE-p11 amd64
Current Operating System: FreeBSD dojo1-fbsd_server.antilogy.us 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
Build Date: 23 June 2018  08:10:56AM
Current version of pixman: 0.34.0
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri Jul  6 23:32:18 2018
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.


----------



## shkhln (Jul 7, 2018)

Anything interesting in /etc/X11/xorg.conf? Try using nvidia-xconfig package for generating configuration.


----------



## doughy (Jul 7, 2018)

I tried that before but did a second time to be sure. No luck


----------



## shkhln (Jul 7, 2018)

Xorg log should contain lines similar to:

```
[   358.509] (II) LoadModule: "glx"
[   358.510] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[   358.572] (II) Module glx: vendor="NVIDIA Corporation"
[   358.572]    compiled for 4.0.2, module version = 1.0.0
[   358.572]    Module class: X.Org Server Extension
[   358.572] (II) NVIDIA GLX Module  396.24  Wed Apr 25 23:20:56 PDT 2018
[   358.573] (II) LoadModule: "nvidia"
[   358.574] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[   358.580] (II) Module nvidia: vendor="NVIDIA Corporation"
[   358.580]    compiled for 4.0.2, module version = 1.0.0
[   358.580]    Module class: X.Org Video Driver
[   358.581] (II) NVIDIA dlloader X Driver  396.24  Wed Apr 25 23:01:24 PDT 2018
[   358.581] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
```




doughy said:


> I tried that before but did a second time to be sure. No luck



`cat /etc/X11/xorg.conf`?


----------



## doughy (Jul 7, 2018)

I attached the xorg.conf file


----------



## shkhln (Jul 7, 2018)

That looks like Xorg should at least attempt to load nvidia_drv.so. Are sure you didn't overlook that part of the Xorg log? Also you should recheck your connection just in case: DisplayPort might not work properly with your gpu+cable+monitor combo (that doesn't appear to be the case since you can see the console, but still), you might have the monitor cable plugged into a motherboard video port (happens to me occasionally), etc.


----------



## drhowarddrfine (Jul 7, 2018)

Nvidia points to this driver for FreeBSD on their web site which is covered by x11/nvidia-driver. You should `cd /usr/ports/x11/nvidia-driver`, then `make clean deinstall install clean`.

Make sure to put `nvidia_load="YES"` in /boot/loader.conf and reboot.

This should install the proper driver from ports without conflict with packages. As scottro mentioned, those two ports he mentions are very helpful.


----------



## rigoletto@ (Jul 7, 2018)

drhowarddrfine said:


> Make sure to put  nvidia_load="YES" in /boot/loader.conf and reboot.



Or `nvidia-modeset_load="YES"` instead (eventually both, don't ask me why).

Also:

/usr/local/etc/X11/xorg.conf.d/20-nvidia.conf

```
Section "Device"
   Identifier     "nVidia Card"
   Driver     "nvidia"
   VendorName     "nVidia Corporation"
   BoardName     "GeForce GT 630"
EndSection
```


----------



## scottro (Jul 7, 2018)

I believe it's the newer driver they will be using so in this case, probably nvidia-modeset_load rather than nivida_load.


----------



## angelvg (Jul 16, 2018)

I recently in FreeBSD 11.2 RELEASE try install the binary nvidia-driver (previous to the 340.107) and it did not work

The reason is that the old binary needed update to work in 11.2

My solution was make my own updated binary that work with 11.2 in poudriere
x11/nvidia-driver-340

This created the binary package 'nvidia-driver-340-340.107.txz' correct for 11.2

Once the updated binary was installed, I used my xorg.conf

$ freebsd-version
11.2-RELEASE

$ pkg info | grep nvidia-driver
nvidia-driver-340-340.107      NVidia graphics card binary drivers for hardware OpenGL rendering

And use this new xorg.conf

$ cat /usr/local/etc/X11/xorg.conf.d/xorg-Multiple_Display_Devices_on_One_X_Screen.conf

https://pastebin.com/mK5TKdvq

Good luck!


----------



## Chris_H (Jul 24, 2018)

OK I haven't used anything BUT Nvidia cards on FreeBSD for some 12yrs now. FWIW I'll share my experiences in hopes it gets you where you're going. Once I figured out the "quirks" I've never had a problem. 
Firstly; Nvidia does NOT perform/function well with vt(4). So do the following in loader.conf(5):

```
boot_verbose="YES"
kern.vty=sc
linux_load="YES"
nvidia_load="YES"
```
I added the verbose line for you as well. As dmesg(8) will be more informative. Giving you a better idea of what's going on with your card.
That done. REMOVE/RENAME the file generated by the nvidia-xconfig. This is old-skool, and no longer supported in your version of X11 on your version of FreeBSD. All copies of it. Both the one in your home directory, and, if applicable, in /etc/X11/. Perhaps rename it/them to _xorg.conf_.
Now. After booting with your new loder.conf(5) in place. Your now ready to attempt to load Xorg. Try starting it. By simply running the following command from your home directory:
startx -retro.
This will likely barf. But it will provide you with some necessary information. Namely; the BUS ID your Nvidia card lives in. Something like the following should show up in /var/log/Xorg.0.log

```
(--) PCI:*(0:0:13:0) 10de:03d0:1462:7309
```
If this turns out NOT to be the case. That's OK. We can still get that information.
Create the following file, and place it in:
/usr/local/etc/X11/xorg.conf.d/
Name the file driver-nvidia.conf

```
# /usr/local/etc/X11/xorg.conf.d/
Section "Device"
    Option    "DRI"    "True"
    Identifier    "Card0"
    Driver        "nvidia"
    #BusID    "PCI:0:2:0:0"
EndSection
```
NOTE: BusID (commented). You'll need to replace the number with the one you get from Xorg.0.log once you've obtained it. Then UNcopmment that line. 

That should do it. If not. Post back with any pertinent info, and I can fix it for you.

HTH!

--Chris


----------



## rigoletto@ (Jul 24, 2018)

You can workaround the vt(4) problem with `hw.vga.textmode="1"`.


----------



## scottro (Jul 24, 2018)

I too, ran into the BUSID issue today. I was setting up a new workstation, and though Linux had no problem, FreeBSD wouldn't start X.  I took the drive and card and put them in another machine and there was no problem, (similar, but not identical).  I wasn't getting any info from Xorg.log, save that no screens were found. Eventually, turned up the debugging,, googled a bit more, and for the first time in 20 years or so, I had to add a busid entry to xorg.conf. (Which I let nvidia-xconfi create.) 

In my googling, I found no mention of it as a FreeBSD issue, only in Linux.  Not that means anything, after a few hours, I was getting frustrated.  I also have to say that this is the first time in years that I've had an issue with FreeBSD and NVidia cards, and have no idea why this particular machine didn't get a BusID entry, when it seems (from looking at some other machines) that nvidia-xconfig usually creates it automatically. And, as mentioned, I took the drive and the video card, put them in another machine (before tracking down the BusID issue) and X worked without a problem. So, I guess it is only needed sometimes--I'd never noticed it before--sometimes, startx wouldn't work, so I'd then install and run nvidia-xconfig and then it would work. My guess, now, is that it usually created a BusID entry.


----------



## Chris_H (Jul 24, 2018)

scottro 
Until, or unless the Nvidia driver has 1) been installed, and 2) has been properly loaded. The system, and thereby X have no idea what that thing on BusID is. So X dutifully initiates what the system sees as a standard VGA device. Which ultimately (for obvious reasons) fails. Also, given that it's not uncommon for the MB manufacturers to have Video card/chipsets on the MB itself *along* with the (nicer) video card you've chosen as your "daily driver", *and* what with APUS being the "thing" these days. It becomes increasingly hard for X to just "get it right". Without a little help from `BusID`. Of course. That's no reason not to run 2, or more cards _simultaneously_. X can do that too. But again. `BusID` needs to be leveraged. Being forced to use a "blob" doesn't help, either. 

All the best to you, scottro !

--Chris


----------



## scottro (Jul 25, 2018)

Thanks Chris, I am aware of that. However, until this one machine, it's never affected me.  Either it would work out of the box, once the NVidia driver was installed, or, it wouldn't work, I'd run nvidia-xconfig, and it would then work. I never paid very close attention to the file created.  As I said, looking at a couple of machines, apparently, nvidia-xconfig also (usually) adds in the BusID, but didn't on this machine. And, on the other machine where I tried the disk, X started (as it often does, at least for me) without a BusID in the config file. At work, I use multiple monitors, and on my old machine, where I had multiple cards, I see that again, nvidia-xconfig gave me BusIDs for all cards.

Anyway, my only point was that this was the first time a missing BusID was the problem, and it was a simple fix once I figured it out.
Usually, the nvidia-xconfig supplies it.

I should add that there are various ways to find it, but pciconf -lvB|grep -B 1 NVIDIA will give it.  (It will show pci0:1:0:1 and you want the last three, the 1:0:1),


----------



## Chris_H (Jul 25, 2018)

scottro
I didn't mean to insinuate you didn't know. Just expanding on the details. In hopes it might help others with the same, or similar (Nvidia) trouble(s)). 

--Chris


----------



## scottro (Jul 25, 2018)

I've been married more than once so insults roll off me. Thanks again, I didn't think you were criticizing, but I appreciate you taking the time to clarify.


----------



## Chris_H (Jul 25, 2018)

scottro said:


> I've been married more than once


You too? Heh, took me two times to get it "right". 


> ... so insults roll off me.


Boy! Can I relate. Well, with my first, anyway.


> Thanks again, I didn't think you were criticizing, but I appreciate you taking the time to clarify.


Good to know. Thanks for responding, scottro ! 

--Chris


----------



## Kalero (Sep 2, 2018)

Does this known bug also apply to nvidia-driver-340? I'm going to install FreeBSD-11.2-RELEASE and I have an NVIDIA GeForce 210, so I have to install nvidia-driver-340. Thanks.


----------



## Kalero (Sep 2, 2018)

Kalero said:


> Does this known bug also apply to nvidia-driver-340? I'm going to install FreeBSD-11.2-RELEASE and I have an NVIDIA GeForce 210, so I have to install nvidia-driver-340. Thanks.



Well, while I was waiting for an answer, I installed FreeBSD-11.2-RELEASE, installed nvidia-driver-340 from ports and, to check if the binary package also worked, removed the port with "make deinstall clean" and installed the nvidia-driver-340 binary package with pkg. My surprise was it works, so after reading the comment #10 in Bug 228536 - x11/nvidia-driver: 11.2-BETA3 - fails to operate correctly, I don't understand why after deinstalling the port and installing the binary package it's working.


----------



## yo9fah (Sep 29, 2018)

I own a laptop asus x55vd and give me the same error at startx:

```
Fatal server error:
[ 330.574] (EE) no screens found(EE)
[ 330.575] (EE)
```
I deleted xorg.conf and it goes, but ... is that good?


----------



## Minbari (Sep 29, 2018)

On modern version of FreeBSD there is no need to configure xorg manually unless you have difficulties. That being said if your sistem works ok without xorg.conf then it's all OK.



> *Tip: *
> 
> Video cards, monitors, and input devices are  automatically detected and do not require any manual  configuration.  Do not create xorg.conf  or run a -configure step unless automatic  configuration fails. - FreeBSD Handbook.


----------

