How to set-up Nvidia graphics card on FreeBSD 11.1?

The log shows you can use the vesa driver. The nvidia driver fails to load the glx part for some reason, so I'd just make a line Driver "Vesa" in the appropriate device section to have X running and then look what's wrong with nvidia.
But as I already said, I seem apparently incompetent to get X running without xorg.conf on many hardware combinations, so I am looking forward to SirDice's suggestions, too.
 
I mean, I deleted the xorg.conf.d directory, and the driver-nvidia.conf file.
That's not what I said, remove /usr/local/etc/X11/xorg.conf or /etc/X11/xorg.conf and create the /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf file as I showed above. Then run startx and if that fails post the Xorg.0.log. The last log shows X starts properly but is using the vesa(4) driver.
 
Ok, good. Now it's loading the correct driver:
Code:
[   280.983] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[   281.045] (II) Module nvidia: vendor="NVIDIA Corporation"
[   281.045] 	compiled for 4.0.2, module version = 1.0.0
[   281.045] 	Module class: X.Org Video Driver
But....
Code:
[   281.077] (EE) No devices detected.
[   281.077] (EE) Fatal server error:
[   281.077] (EE) no screens found(EE)
Are you sure this machine actually has an NVidia card? Because the logs are telling me there's no NVidia card to be found. Can you post the output of pciconf -lf?
 
Are you sure this machine actually has an NVidia card? Because the logs are telling me there's no NVidia card to be found. Can you post the output of pciconf -lf?

pciconf -l gave me following output:
Code:
hostb0@pci0:0:0:0:   class=0x060000 card=0x07071028 chip=0x19048086 rev=0x08 hdr=0x00
vgapci0@pci0:0:2:0:   class=0x030000 card=0x07071028 chip=0x19168086 rev=0x07 hdr=0x00
none0@pci0:0:4:0:   class=0x118000 card=0x07071028 chip=0x19038086 rev=0x08 hdr=0x00
xhci0@pci0:0:20:0:   class=0x0c0330 card=0x07071028 chip=0x9d2f8086 rev=0x21 hdr=0x00
none1@pci0:0:20:2:   class=0x118000 card=0x07071028 chip=0x9d318086 rev=0x21 hdr=0x00
none2@pci0:0:21:0:   class=0x118000 card=0x07071028 chip=0x9d608086 rev=0x21 hdr=0x00
none3@pci0:0:21:1:   class=0x118000 card=0x07071028 chip=0x9d618086 rev=0x21 hdr=0x00
none4@pci0:0:22:0:   class=0x078000 card=0x07071028 chip=0x9d3a8086 rev=0x21 hdr=0x00
ahci0@pci0:0:23:0:   class=0x010400 card=0x07071028 chip=0x282a8086 rev=0x21 hdr=0x00
pcib1@pci0:0:28:0:   class=0x060400 card=0x07071028 chip=0x9d108086 rev=0xf1 hdr=0x01
pcib2@pci0:0:28:6:   class=0x060400 card=0x07071028 chip=0x9d168086 rev=0xf1 hdr=0x01
pcib3@pci0:0:28:7:   class=0x060400 card=0x07071028 chip=0x9d178086 rev=0xf1 hdr=0x01
pcib4@pci0:0:29:0:   class=0x060400 card=0x07071028 chip=0x9d1a8086 rev=0xf1 hdr=0x01
isab0@pci0:0:31:0:   class=0x060100 card=0x07071028 chip=0x9d488086 rev=0x21 hdr=0x00
none5@pci0:0:31:2:   class=0x058000 card=0x07071028 chip=0x9d218086 rev=0x21 hdr=0x00
hdac0@pci0:0:31:3:   class=0x040300 card=0x07071028 chip=0x9d708086 rev=0x21 hdr=0x00
none6@pci0:0:31:4:   class=0x0c0500 card=0x07071028 chip=0x9d238086 rev=0x21 hdr=0x00
vgapci1@pci0:1:0:0:   class=0x030200 card=0x07071028 chip=0x139b10de rev=0xa2 hdr=0x00
alc0@pci0:2:0:0:   class=0x020000 card=0x10280707 chip=0xe0a11969 rev=0x10 hdr=0x00
none7@pci0:3:0:0:   class=0x028000 card=0x15351a56 chip=0x003e168c rev=0x32 hdr=0x00
 
Oops, I meant to say pciconf -l[B]v[/B]
Code:
hostb0@pci0:0:0:0:   class=0x060000 card=0x07071028 chip=0x19048086 rev=0x08 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers'
    class      = bridge
    subclass   = HOST-PCI
vgapci0@pci0:0:2:0:   class=0x030000 card=0x07071028 chip=0x19168086 rev=0x07 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'HD Graphics 520'
    class      = display
    subclass   = VGA
none0@pci0:0:4:0:   class=0x118000 card=0x07071028 chip=0x19038086 rev=0x08 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem'
    class      = dasp
xhci0@pci0:0:20:0:   class=0x0c0330 card=0x07071028 chip=0x9d2f8086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP USB 3.0 xHCI Controller'
    class      = serial bus
    subclass   = USB
none1@pci0:0:20:2:   class=0x118000 card=0x07071028 chip=0x9d318086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP Thermal subsystem'
    class      = dasp
none2@pci0:0:21:0:   class=0x118000 card=0x07071028 chip=0x9d608086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP Serial IO I2C Controller'
    class      = dasp
none3@pci0:0:21:1:   class=0x118000 card=0x07071028 chip=0x9d618086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP Serial IO I2C Controller'
    class      = dasp
none4@pci0:0:22:0:   class=0x078000 card=0x07071028 chip=0x9d3a8086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP CSME HECI'
    class      = simple comms
ahci0@pci0:0:23:0:   class=0x010400 card=0x07071028 chip=0x282a8086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801 Mobile SATA Controller [RAID mode]'
    class      = mass storage
    subclass   = RAID
pcib1@pci0:0:28:0:   class=0x060400 card=0x07071028 chip=0x9d108086 rev=0xf1 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib2@pci0:0:28:6:   class=0x060400 card=0x07071028 chip=0x9d168086 rev=0xf1 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib3@pci0:0:28:7:   class=0x060400 card=0x07071028 chip=0x9d178086 rev=0xf1 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP PCI Express Root Port'
    class      = bridge
    subclass   = PCI-PCI
pcib4@pci0:0:29:0:   class=0x060400 card=0x07071028 chip=0x9d1a8086 rev=0xf1 hdr=0x01
    vendor     = 'Intel Corporation'
    class      = bridge
    subclass   = PCI-PCI
isab0@pci0:0:31:0:   class=0x060100 card=0x07071028 chip=0x9d488086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP LPC Controller'
    class      = bridge
    subclass   = PCI-ISA
none5@pci0:0:31:2:   class=0x058000 card=0x07071028 chip=0x9d218086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP PMC'
    class      = memory
hdac0@pci0:0:31:3:   class=0x040300 card=0x07071028 chip=0x9d708086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP HD Audio'
    class      = multimedia
    subclass   = HDA
none6@pci0:0:31:4:   class=0x0c0500 card=0x07071028 chip=0x9d238086 rev=0x21 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Sunrise Point-LP SMBus'
    class      = serial bus
    subclass   = SMBus
vgapci1@pci0:1:0:0:   class=0x030200 card=0x07071028 chip=0x139b10de rev=0xa2 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'GM107M [GeForce GTX 960M]'
    class      = display
    subclass   = 3D
alc0@pci0:2:0:0:   class=0x020000 card=0x10280707 chip=0xe0a11969 rev=0x10 hdr=0x00
    vendor     = 'Qualcomm Atheros'
    device     = 'Killer E2400 Gigabit Ethernet Controller'
    class      = network
    subclass   = ethernet
none7@pci0:3:0:0:   class=0x028000 card=0x15351a56 chip=0x003e168c rev=0x32 hdr=0x00
    vendor     = 'Qualcomm Atheros'
    device     = 'QCA6174 802.11ac Wireless Network Adapter'
    class      = network
I have the card :p
 
Yep, but you also have an Intel video card. You appear to have one of those laptops that uses Optimus where the system automatically switches between the Intel and the NVidia card. This used to be impossible to get working, not sure what the current status is, I do believe there are some tricks to enable/disable one of the cards. You may also have that option in the BIOS.
 
Yep, but you also have an Intel video card. You appear to have one of those laptops that uses Optimus where the system automatically switches between the Intel and the NVidia card. This used to be impossible to get working, not sure what the current status is, I do believe there are some tricks to enable/disable one of the cards. You may also have that option in the BIOS.

I looked up, there is not an option to disable one card in BIOS. What should be my next move now?
 
That's a good Wiki indeed, I find myself on it quite frequently. Not sure if the same Optimus trick can be applied to FreeBSD though. But hang around, I'm quite sure we have some other users on the board that may know the exact answer.
 
When you have problems with esoteric hardware, it often pays off to visit the ArchLinux community-supported wiki.
That's a good Wiki indeed, I find myself on it quite frequently. Not sure if the same Optimus trick can be applied to FreeBSD though. But hang around, I'm quite sure we have some other users on the board that may know the exact answer.

Hi again. I am not into modern gaming (but I still love wolf3d; and I have asteroid [singular] on FreeBSD. But how should I get the "optimum performance" out of my current machine?
 
Well, hopefully you'll be able to disable one of the cards and configure Xorg to use the other one. Combining both the Intel and NVidia drivers is going to be tricky in any case because the NVidia driver also replaces a few Xorg libraries, those changes would interfere with the Intel driver because it expects the original Xorg libraries.
 
I guess you want first get X running again, and then afterwards look how you can optimize.
Your log showed that vesa seems to work. Lets use that for now. If that works, it might be easier to mix with Nvidia.
If I were you, I'd try out this xorg.conf:

Code:
Section "ServerFlags"
Option "DontZap" "false"
EndSection

Section "InputClass"
Identifier "Keyboard Defaults"
MatchIsKeyboard "yes"
Option "XKbOptions" "terminate:ctrl_alt_bksp"
EndSection

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection

Section "Files"
# FontPath "/usr/local/share/fonts/Droid/"
EndSection

Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "keyboard"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "vesa"
VendorName "MyMonitor"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080"
EndSubSection
EndSection

If it fails to start X, uninstall Nvidia drivers and try again (to make sure it didn't fail due to interferences SirDice mentioned in his last post).
Please tell the outcome and post log in case of fail. Then we can see what we can try next.
 
Well, hopefully you'll be able to disable one of the cards and configure Xorg to use the other one. Combining both the Intel and NVidia drivers is going to be tricky in any case because the NVidia driver also replaces a few Xorg libraries, those changes would interfere with the Intel driver because it expects the original Xorg libraries.
I guess you want first get X running again, and then afterwards look how you can optimize.
Your log showed that vesa seems to work. Lets use that for now. If that works, it might be easier to mix with Nvidia.
<some content removed>
If it fails to start X, uninstall Nvidia drivers and try again (to make sure it didn't fail due to interferences SirDice mentioned in his last post).
Please tell the outcome and post log in case of fail. Then we can see what we can try next.

Well, one log (post #24) is of the configuration in which I had deleted the xorg.conf.d directory, and the driver-nvidia.conf file. That is my current configuration as well.
The second log is with the xorg.conf.d directory, and the driver-nvidia.conf file. Currently, if I try to open "Nvidia X server settings" I get a pop-up stating "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."
 
I have a problem with nvidia driver on FreeBSD 11.1
graphical environment is ok, but If I switch to console (while a graphical environment is running) with control alt f1 f2 f3 monitor is black, the computer is responsive, for example if I run beep program, it works, but I can't see nothing at video

Is there a way to resolve the problem?
 
kiran
It won' t do any good using Nvidia utilities. Such special cases usually need be configured by hand. Sigh.

antolap
This is one of the problems I experienced with the vt console (which is still under development).
However I found out that many times it was helpful to switch forth and back graphics<>console a few times.
Most times changing 2 to 5 times were sufficient. Other times it didn't want to do, so I gave up and tried again later, often with success.

If such a system behavior annoys you, you might want to give the older, alternative sc console a try.
I use the sc console myself, which is mature and does not cause problems with the display like you experience, and supports suspend/resume with Nvidia.
However I read that the sc console is not recommended on UEFI computers. I have no UEFI computer and thus cannot say anything about that potential problem.
 
I have a problem with nvidia driver on FreeBSD 11.1
graphical environment is ok, but If I switch to console (while a graphical environment is running) with control alt f1 f2 f3 monitor is black, the computer is responsive, for example if I run beep program, it works, but I can't see nothing at video

Is there a way to resolve the problem?
Don't do that. When I switch from graphical to console via Ctrl-Alt-F2-3-4 it gets me to console all right, but can't get back to graphical. Have to kill it and restart then.
 
I was wondering why nobody from the board mentioned the Nvidia Optimus wiki for FreeBSD:
https://wiki.freebsd.org/OptimusVideoSupport
Would’n that be a good starting point to begin with ( for xmj's turn_off_nvidia.sh mentioned
in the wiki: https://gist.github.com/dch/992f445b9673aa49325d ).

Here is somebody claiming to make Optimus work recently, however not in a very user friendly way:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192617#c19 .
If this is a way to go, the steps could be put together in a shell script.

Besides, there is the option to try an BIOS update first, possibly obtaining the ability
to disable the INTEL graphics. Dell has an recent BIOS update available, dated 16 Aug 2017,
offering: Fixes & Enhancements - 3. Update Intel GOP and VBIOS.
https://www.dell.com/support/home/us/en/19/drivers/driversdetails?driverId=V8VVT
 
I have a problem with nvidia driver on FreeBSD 11.1
graphical environment is ok, but If I switch to console (while a graphical environment is running) with control alt f1 f2 f3 monitor is black, the computer is responsive, for example if I run beep program, it works, but I can't see nothing at video

Is there a way to resolve the problem?

I had similar problem on PC with nvidia - when I switched from graphical to console via Ctrl-Alt-F2-3-4 I got some big colored tetris-like figures, with no readable fonts.

Installation was: FreeBSD 11.1 +nVidia +BIOS (not UEFI) +UFS +entire disk ;
After hours of unsuccessfully trying many options, somewhere on this forum I read that in UEFI mode there is no such problem, and since that was fresh installation, I had nothing to lose, so I reinstalled system on UEFI mode. (as entire disk, ZFS), now nVidia-switch-to-console-and-back works fine.

[edit] typo
 
I had similar problem on PC with nvidia - when I switched from graphical to console via Ctrl-Alt-F2-3-4 I got some big colored tetris-like figures, with no readable fonts.
I always had exactly that phenomena after suspend/resume when I was using the vt console driver (with the defective vesa.ko module being pulled in automatically). (Sidenote: My PCs, older Z-series HP workstations, do not have UEFI)
Removing the vesa.ko module and switching to sc console always completely fixed that problem on the computers I used.

(Edit: Please also see my followup post, as I forgot to mention an essential step)
Installation was: FreeBSD 11.1 +nVidia +BIOS (not UEFI) +UFS +entire disk ;
After hours of unsuccessfully trying many options, somewhere on this forum I read that in UEFI mode there is no such problem, and since that was fresh installation, I had nothing to lose, so I reinstalled system on UEFI mode. (as entire disk, ZFS), now nVidia-switch-to-console-and-back works fine.
That is a highly interesting finding. Thank you very much!
Because, If it turns out that the problems with the vt console only happen on PCs without activated UEFI, that fact would show like a laser pointer what needs to be fixed in the code, presumably in the vesa.ko module.
 
Back
Top