Solved Trying to get GTX 980 working with Xorg

Hey guys, I'm currently installing freebsd in a kvm virtual machine, with a gtx 980, however, I'm unable to get Xorg working as it errors with "no screens found (EE)" when i try startx.

Currently, I have done:

pkg install nvidia-driver
nano /etc/rc.conf
-> added the line kld_list="nvidia nvidia-modset"
-> added the line linux_enable="YES"

Xorg -configure
then tried startx, to get that error.
(tried rebooting)

Also, the display output is currently only showing in virt-manager, not on the screen that my gtx 980 is plugged into, I'm assuming this is a sideffect of the same misconfiguration. On my windows passthrough VM, the display output also shows on the monitor plugged into my gtx 980.

Sorry, I'm very new to freebsd - does anyone know what I've done wrong? Thank you.
 
Thank you for the welcome elgrande! I'll give that link a look, and follow it - hopefully that fixes the issue, and I'll report back on what it does
CuatroTorres, I am not sure what guest additions is, I have a linux host, and I am using a KVM virtual machine. My host has two graphics cards, and I am putting 1 in my virtual machine, the same way I do it with my windows virtual machine
I am using qemu/kvm so I'm not sure if that driver link is applicable to me, but the gtx 980 is still supported by nvidia's latest drivers which I have installed in the freebsd virtual machine.
 
I have just gone through this guide with the required steps (removing my previous Xorg -configure result) and sadly the same result still happens of no screens found
Is there any way I can see all the PCIE devices in freebsd, like I can in linux? Just to ensure the 980 is actually being picked up in the VM

Edit: I've just gone ahead and installed pciutils and ran lspci -nn and my gtx 980 is found, which is the expected output so I don't think that's the issue there
 

Attachments

  • 1698241192127.png
    1698241192127.png
    2.9 KB · Views: 71
I have just gone through this guide with the required steps (removing my previous Xorg -configure result) and sadly the same result still happens of no screens found
Did you create the /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf file?

Is there any way I can see all the PCIE devices in freebsd, like I can in linux?
pciconf -lv
 
Oh, I (we?) misread.
If it is running in KVM, the driver must fit the "virtual graphic card" KVM exposes (not the hosts graphic card).
 
Can you post your Xorg.0.log? cat /var/log/Xorg.0.log | nc termbin.com 9999
 
Oh, I (we?) misread.
If it is running in KVM, the driver must fit the "virtual graphic card" KVM exposes (not the hosts graphic card).

I'm trying to get the gtx 980 working inside of it - I have passed through the gtx 980 into the virtual machine so that it has full access to the gtx 980
It's seen in the VM as shown in my previous edit, but it's currently not doing anything otherwise I would also have a display on my secondary monitor (plugged into the gtx 980) rather than just the virt-manager spice display

My host has two graphics cards - an rtx 2080 ti and a gtx 980
I prevent the gtx 980 from being interacted with the host, and pass it through into the VM in which the VM now has full control of it
 
Can you post your Xorg.0.log? cat /var/log/Xorg.0.log | nc termbin.com 9999

Sure thing! It outputs this website link: https://termbin.com/ht2g

The content inside is:

Code:
[    19.443]
X.Org X Server 1.21.1.8
X Protocol Version 11, Revision 0
[    19.443] Current Operating System: FreeBSD freebsd 13.2-RELEASE-p4 FreeBSD 13.2-RELEASE-p4 GENERIC amd64
[    19.443] 
[    19.443] Current version of pixman: 0.42.2
[    19.443]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[    19.443] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    19.443] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Oct 25 15:05:56 2023
[    19.453] (==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
[    19.453] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[    19.453] (==) No Layout section.  Using the first Screen section.
[    19.453] (==) No screen section available. Using defaults.
[    19.453] (**) |-->Screen "Default Screen Section" (0)
[    19.453] (**) |   |-->Monitor "<default monitor>"
[    19.453] (==) No device specified for screen "Default Screen Section".
    Using the first device section listed.
[    19.453] (**) |   |-->Device "NVIDIA Card"
[    19.453] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[    19.453] (==) Automatically adding devices
[    19.453] (==) Automatically enabling devices
[    19.453] (==) Automatically adding GPU devices
[    19.453] (==) Automatically binding GPU devices
[    19.453] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    19.453] (==) 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/,
    catalogue:/usr/local/etc/X11/fontpath.d
[    19.453] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[    19.453] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[    19.453] (II) Module ABI versions:
[    19.453]     X.Org ANSI C Emulation: 0.4
[    19.453]     X.Org Video Driver: 25.2
[    19.453]     X.Org XInput driver : 24.4
[    19.453]     X.Org Server Extension : 10.0
[    19.453] (!!) More than one possible primary device found
[    19.453] (--) PCI: (0@0:2:0) 1b36:0100:1af4:1100 rev 5, Mem @ 0xf4000000/67108864, 0xf8000000/67108864, 0xfd0d8000/8192, I/O @ 0x0000c180/32, BIOS @ 0x????????/65536
[    19.453] (--) PCI: (0@0:9:0) 10de:13c0:10de:13c0 rev 161, Mem @ 0xfc000000/16777216, 0xe0000000/268435456, 0xf0000000/33554432, I/O @ 0x0000c080/128, BIOS @ 0x????????/65536
[    19.453] (II) LoadModule: "glx"
[    19.453] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[    19.463] (II) Module glx: vendor="X.Org Foundation"
[    19.463]     compiled for 1.21.1.8, module version = 1.0.0
[    19.463]     ABI class: X.Org Server Extension, version 10.0
[    19.463] (II) LoadModule: "nvidia"
[    19.463] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[    19.463] (II) Module nvidia: vendor="NVIDIA Corporation"
[    19.463]     compiled for 1.6.99.901, module version = 1.0.0
[    19.463]     Module class: X.Org Video Driver
[    19.463] (II) NVIDIA dlloader X Driver  535.104.05  Sat Aug 19 00:40:33 UTC 2023
[    19.463] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[    19.473] (--) Using syscons driver with X support (version 2.0)
[    19.473] (--) using VT number 9

[    19.473] (EE) No devices detected.
[    19.473] (EE)
Fatal server error:
[    19.473] (EE) no screens found(EE)
[    19.473] (EE)
Please consult the The X.Org Foundation support
     at http://wiki.x.org
 for help.
[    19.473] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    19.473] (EE)
[    19.473] (EE) Server terminated with error (1). Closing log file.
 
You probably need to add a BusID to the driver section. It finds two graphics cards and doesn't know which is which.

Code:
[    19.453] (!!) More than one possible primary device found
[    19.453] (--) PCI: (0@0:2:0) 1b36:0100:1af4:1100 rev 5, Mem @ 0xf4000000/67108864, 0xf8000000/67108864, 0xfd0d8000/8192, I/O @ 0x0000c180/32, BIOS @ 0x????????/65536
[    19.453] (--) PCI: (0@0:9:0) 10de:13c0:10de:13c0 rev 161, Mem @ 0xfc000000/16777216, 0xe0000000/268435456, 0xf0000000/33554432, I/O @ 0x0000c080/128, BIOS @ 0x????????/65536
 
I see, thank you for the information, that may be because there's also a built in VM 3d graphics driver (alongside the passed in gtx 980)? Also unsure how that would be pci, the 10de one is the gtx 980
Do you know any links that could should me how to add the BusID to the driver section?
 
Why would that be? My goal is to get the gtx 980 up and running
As far as I understand, you are running FreeBSD in a Virtual Machine.
That normally means, the guest does not access the host's graphic card. It accesses a virtual graphic card which the virtualization solution provides. (there are exceptions like having a dedicated graphics card only for a single virtual machine, but I do not guess this is the case here)
 
As far as I understand, you are running FreeBSD in a Virtual Machine.
That normally means, the guest does not access the host's graphic card. It accesses a virtual graphic card which the virtualization solution provides. (there are exceptions like having a dedicated graphics card only for a single virtual machine, but I do not guess this is the case here)
Oh i see what you mean, I am the latter case where I have a dedicated graphics card only for the single virtual machine, as mentioned before
 
Have a look at the FreeBSD Handbook: a good FreeBSD guide! (example 6):
Thanks for the link! I've gone through it, and added my BusID as pci0:0:9:0 (the one that the output told me was my 980) however it still complains about more than one primary device
Do i need to also add the VM igpu in there? I've currently only done the NVIDIA one since that's the only one I want to use (alternatively, is it possible to remove the spice graphics from the VM?)
 
Oh sorry, somewhere in the back of my mind I read VirtualBox. Does not apply.
Make sure the GPU is not used by the host.

For the future:

Furthermore:
 
Back
Top