Solved X doesn't start with Nvidia (Optimus) GF 720m

Hi all,
I have a laptop Acer V5-573G that comes with nvidia GeFORCE GT 720M installed. I'm having issues starting X. I am sorry in advance for this long thread and I tried all what other people posted here but it didn't help a lot.

First I running FreeBSD 12
Code:
% uname -a
FreeBSD laptop-bsd 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 GENERIC  amd64
The pciconf command shows that there is an intel vga installed as well as the Nvidia (towards the bottom of the list).

%pciconf -lv
Code:
hostb0@pci0:0:0:0:    class=0x060000 card=0x079b1025 chip=0x0a048086 rev=0x09 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Haswell-ULT DRAM Controller'
    class      = bridge
    subclass   = HOST-PCI
vgapci0@pci0:0:2:0:    class=0x030000 card=0x079b1025 chip=0x0a168086 rev=0x09 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Haswell-ULT Integrated Graphics Controller'
    class      = display
    subclass   = VGA
hdac0@pci0:0:3:0:    class=0x040300 card=0x079b1025 chip=0x0a0c8086 rev=0x09 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Haswell-ULT HD Audio Controller'
    class      = multimedia
    subclass   = HDA
xhci0@pci0:0:20:0:    class=0x0c0330 card=0x079b1025 chip=0x9c318086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '8 Series USB xHCI HC'
    class      = serial bus
    subclass   = USB
hdac1@pci0:0:27:0:    class=0x040300 card=0x079b1025 chip=0x9c208086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '8 Series HD Audio Controller'
    class      = multimedia
    subclass   = HDA
pcib1@pci0:0:28:0:    class=0x060400 card=0x079b1025 chip=0x9c108086 rev=0xe4 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '8 Series PCI Express Root Port 1'
    class      = bridge
    subclass   = PCI-PCI
pcib2@pci0:0:28:2:    class=0x060400 card=0x079b1025 chip=0x9c148086 rev=0xe4 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '8 Series PCI Express Root Port 3'
    class      = bridge
    subclass   = PCI-PCI
pcib3@pci0:0:28:3:    class=0x060400 card=0x079b1025 chip=0x9c168086 rev=0xe4 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '8 Series PCI Express Root Port 4'
    class      = bridge
    subclass   = PCI-PCI
pcib4@pci0:0:28:4:    class=0x060400 card=0x079b1025 chip=0x9c188086 rev=0xe4 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '8 Series PCI Express Root Port 5'
    class      = bridge
    subclass   = PCI-PCI
ehci0@pci0:0:29:0:    class=0x0c0320 card=0x079b1025 chip=0x9c268086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '8 Series USB EHCI'
    class      = serial bus
    subclass   = USB
isab0@pci0:0:31:0:    class=0x060100 card=0x079b1025 chip=0x9c438086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '8 Series LPC Controller'
    class      = bridge
    subclass   = PCI-ISA
ahci0@pci0:0:31:2:    class=0x010601 card=0x079b1025 chip=0x9c038086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '8 Series SATA Controller 1 [AHCI mode]'
    class      = mass storage
    subclass   = SATA
none0@pci0:0:31:3:    class=0x0c0500 card=0x079b1025 chip=0x9c228086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '8 Series SMBus Controller'
    class      = serial bus
    subclass   = SMBus
ath0@pci0:4:0:0:    class=0x028000 card=0xe052105b chip=0x0034168c rev=0x01 hdr=0x00
    vendor     = 'Qualcomm Atheros'
    device     = 'AR9462 Wireless Network Adapter'
    class      = network
none1@pci0:5:0:0:    class=0xff0000 card=0x079b1025 chip=0x528710ec rev=0x01 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8411B PCI Express Card Reader'
re0@pci0:5:0:1:    class=0x020000 card=0x079b1025 chip=0x816810ec rev=0x14 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller'
    class      = network
    subclass   = ethernet
vgapci1@pci0:1:0:0:    class=0x030200 card=0x079b1025 chip=0x114010de rev=0xa1 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'GF117M [GeForce 610M/710M/810M/820M / GT 620M/625M/630M/720M]'
    class      = display
    subclass   = 3D

I looked up the driver in nvidia page (https://www.geforce.com/drivers/results/142959#) and worked out that I should install nvidia-driver (please correct me if I am wrong and need a legacy one) and also nvidia-settings, nvidia-xconfig.

I added to rc.conf
linux_enable="YES" kld_list="nvidia-modeset"
I used nvidia-xconfig to generate /etc/X11/xorg.conf
Code:
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    #BusID          "PCI:1:0:0"
EndSection

when I try to startx it gives me the below error
# cat Xorg.0.log
[ 213.690]
X.Org X Server 1.18.4
Release Date: 2016-07-19
[ 213.690] X Protocol Version 11, Revision 0
[ 213.690] Build Operating System: FreeBSD 12.0-RELEASE-p3 amd64
[ 213.690] Current Operating System: FreeBSD laptop-bsd 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 GENERIC amd64
[ 213.691] Build Date: 07 February 2019 09:16:52AM
[ 213.691]
[ 213.691] Current version of pixman: 0.34.0
[ 213.691] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 213.691] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 213.691] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Mar 17 21:44:23 2019
[ 213.692] (==) Using config file: "/etc/X11/xorg.conf"
[ 213.692] (==) ServerLayout "Layout0"
[ 213.692] (**) |-->Screen "Screen0" (0)
[ 213.692] (**) | |-->Monitor "Monitor0"
[ 213.692] (**) | |-->Device "Device0"
[ 213.692] (**) |-->Input Device "Keyboard0"
[ 213.692] (**) |-->Input Device "Mouse0"
[ 213.693] (==) Automatically adding devices
[ 213.693] (==) Automatically enabling devices
[ 213.693] (==) Not automatically adding GPU devices
[ 213.693] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 213.693] (==) 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/
[ 213.693] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[ 213.693] (**) Extension "Composite" is enabled
[ 213.693] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[ 213.693] (WW) Disabling Keyboard0
[ 213.693] (WW) Disabling Mouse0
[ 213.693] (II) Loader magic: 0x413020
[ 213.693] (II) Module ABI versions:
[ 213.693] X.Org ANSI C Emulation: 0.4
[ 213.693] X.Org Video Driver: 20.0
[ 213.693] X.Org XInput driver : 22.1
[ 213.693] X.Org Server Extension : 9.0
[ 213.694] (--) PCI:*(0:0:2:0) 8086:0a16:1025:079b rev 9, Mem @ 0xb3000000/4194304, 0xc0000000/268435456, I/O @ 0x00005000/64, BIOS @ 0x????????/65536
[ 213.694] (--) PCI: (0:1:0:0) 10de:1140:1025:079b rev 161, Mem @ 0xb2000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x00003000/128
[ 213.694] (II) LoadModule: "glx"
[ 213.695] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[ 213.706] (II) Module glx: vendor="NVIDIA Corporation"
[ 213.706] compiled for 4.0.2, module version = 1.0.0
[ 213.706] Module class: X.Org Server Extension
[ 213.707] (II) NVIDIA GLX Module 390.87 Tue Aug 21 15:49:05 PDT 2018
[ 213.707] (II) LoadModule: "nvidia"
[ 213.707] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[ 213.708] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 213.708] compiled for 4.0.2, module version = 1.0.0
[ 213.708] Module class: X.Org Video Driver
[ 213.708] (II) NVIDIA dlloader X Driver 390.87 Tue Aug 21 15:27:50 PDT 2018
[ 213.708] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[ 213.708] (--) Using syscons driver with X support (version 2.0)
[ 213.708] (--) using VT number 9

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

and once I add the busID in xorg.conf as (BusID "PCI:1:0:0") I get a different error
cat Xorg.0.log
[ 685.634]
X.Org X Server 1.18.4
Release Date: 2016-07-19
[ 685.634] X Protocol Version 11, Revision 0
[ 685.634] Build Operating System: FreeBSD 12.0-RELEASE-p3 amd64
[ 685.634] Current Operating System: FreeBSD laptop-bsd 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 GENERIC amd64
[ 685.635] Build Date: 07 February 2019 09:16:52AM
[ 685.635]
[ 685.635] Current version of pixman: 0.34.0
[ 685.635] Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[ 685.635] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 685.635] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Mar 17 21:52:15 2019
[ 685.636] (==) Using config file: "/etc/X11/xorg.conf"
[ 685.636] (==) ServerLayout "Layout0"
[ 685.636] (**) |-->Screen "Screen0" (0)
[ 685.636] (**) | |-->Monitor "Monitor0"
[ 685.636] (**) | |-->Device "Device0"
[ 685.636] (**) |-->Input Device "Keyboard0"
[ 685.636] (**) |-->Input Device "Mouse0"
[ 685.636] (==) Automatically adding devices
[ 685.636] (==) Automatically enabling devices
[ 685.636] (==) Not automatically adding GPU devices
[ 685.637] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 685.637] (==) 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/
[ 685.637] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[ 685.637] (**) Extension "Composite" is enabled
[ 685.637] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[ 685.637] (WW) Disabling Keyboard0
[ 685.637] (WW) Disabling Mouse0
[ 685.637] (II) Loader magic: 0x413020
[ 685.637] (II) Module ABI versions:
[ 685.637] X.Org ANSI C Emulation: 0.4
[ 685.637] X.Org Video Driver: 20.0
[ 685.637] X.Org XInput driver : 22.1
[ 685.637] X.Org Server Extension : 9.0
[ 685.638] (--) PCI:*(0:0:2:0) 8086:0a16:1025:079b rev 9, Mem @ 0xb3000000/4194304, 0xc0000000/268435456, I/O @ 0x00005000/64, BIOS @ 0x????????/65536
[ 685.638] (--) PCI: (0:1:0:0) 10de:1140:1025:079b rev 161, Mem @ 0xb2000000/16777216, 0xa0000000/268435456, 0xb0000000/33554432, I/O @ 0x00003000/128
[ 685.638] (II) LoadModule: "glx"
[ 685.639] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[ 685.649] (II) Module glx: vendor="NVIDIA Corporation"
[ 685.650] compiled for 4.0.2, module version = 1.0.0
[ 685.650] Module class: X.Org Server Extension
[ 685.650] (II) NVIDIA GLX Module 390.87 Tue Aug 21 15:49:05 PDT 2018
[ 685.650] (II) LoadModule: "nvidia"
[ 685.650] (II) Loading /usr/local/lib/xorg/modules/drivers/nvidia_drv.so
[ 685.651] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 685.651] compiled for 4.0.2, module version = 1.0.0
[ 685.651] Module class: X.Org Video Driver
[ 685.651] (II) NVIDIA dlloader X Driver 390.87 Tue Aug 21 15:27:50 PDT 2018
[ 685.651] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[ 685.652] (--) Using syscons driver with X support (version 2.0)
[ 685.652] (--) using VT number 9

[ 685.710] (II) Loading sub module "fb"
[ 685.710] (II) LoadModule: "fb"
[ 685.710] (II) Loading /usr/local/lib/xorg/modules/libfb.so
[ 685.739] (II) Module fb: vendor="X.Org Foundation"
[ 685.739] compiled for 1.18.4, module version = 1.0.0
[ 685.739] ABI class: X.Org ANSI C Emulation, version 0.4
[ 685.739] (II) Loading sub module "wfb"
[ 685.739] (II) LoadModule: "wfb"
[ 685.739] (II) Loading /usr/local/lib/xorg/modules/libwfb.so
[ 685.748] (II) Module wfb: vendor="X.Org Foundation"
[ 685.748] compiled for 1.18.4, module version = 1.0.0
[ 685.748] ABI class: X.Org ANSI C Emulation, version 0.4
[ 685.748] (II) Loading sub module "ramdac"
[ 685.748] (II) LoadModule: "ramdac"
[ 685.748] (II) Module "ramdac" already built-in
[ 685.775] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[ 685.776] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
[ 685.776] (==) NVIDIA(0): RGB weight 888
[ 685.776] (==) NVIDIA(0): Default visual is TrueColor
[ 685.776] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[ 685.776] (**) NVIDIA(0): Enabling 2D acceleration
[ 685.824] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:1:0:0. Please
[ 685.824] (EE) NVIDIA(GPU-0): check your system's kernel log for additional error
[ 685.824] (EE) NVIDIA(GPU-0): messages and refer to Chapter 8: Common Problems in the
[ 685.824] (EE) NVIDIA(GPU-0): README for additional information.
[ 685.824] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA graphics device!
[ 685.824] (EE) NVIDIA(0): Failing initialization of X screen 0
[ 685.825] (II) UnloadModule: "nvidia"
[ 685.825] (II) UnloadSubModule: "wfb"
[ 685.825] (II) UnloadSubModule: "fb"
[ 685.825] (EE) Screen(s) found, but none have a usable configuration.
[ 685.825] (EE)
Fatal server error:
[ 685.825] (EE) no screens found(EE)
[ 685.825] (EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
[ 685.825] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[ 685.825] (EE)
[ 685.827] (EE) Server terminated with error (1). Closing log file.

Thanks in advance
 
I don't have a nvidia card installed on my FreeBSD machine, but on others laptops which have nvidia graphics and run GNU/Linux the latest nvidia (nvidia 418.xxx) driver doesn't work ( I have installed nvidia-390xx). Also you don't need to generate /etc/X11/xorg.conf, only in special cases, you need to create a file in: /usr/local/etc/X11/xorg.conf.d/ called driver-nvidia.conf which contains:
Code:
Section "Device"
        Identifier "NVIDIA Card"
        VendorName "NVIDIA Corporation"
        Driver "nvidia"
EndSection
Before you create that file (driver-nvidia.conf) run rm -f /etc/X11/xorg.conf /usr/local/etc/X11/xorg.conf to remove the old Xorg config.
 
If the stock FreeBSD nVidia driver does not work, you might like to uninstall it and try the FreeBSD driver direct from the nVidia website for FreeBSD 12-RC3 at: https://www.nvidia.com/Download/driverResults.aspx/141301/en-us which claims to support the 720M.

I looked at that option but my first preference is using the pkg system driver as you can get constant updates. Using the driver directly from nvidia is the last resort I guess (if it works out of the box)
 
The pciconf command shows that there is an intel vga installed as well as the Nvidia (towards the bottom of the list).

If you have not done so, go into BIOS and make sure you have the Graphics options set to "Discreet Graphics".
 
I don't have a nvidia card installed on my FreeBSD machine, but on others laptops which have nvidia graphics and run GNU/Linux the latest nvidia (nvidia 418.xxx) driver doesn't work ( I have installed nvidia-390xx). Also you don't need to generate /etc/X11/xorg.conf, only in special cases, you need to create a file in: /usr/local/etc/X11/xorg.conf.d/ called driver-nvidia.conf which contains:
Code:
Section "Device"
        Identifier "NVIDIA Card"
        VendorName "NVIDIA Corporation"
        Driver "nvidia"
EndSection
Before you create that file (driver-nvidia.conf) run rm -f /etc/X11/xorg.conf /usr/local/etc/X11/xorg.conf to remove the old Xorg config.
I tried all the three drivers none worked.... is there any more tricks I should try?
 
Try adding this to /etc/rc.conf instead of what you had originally.

Code:
linux_enable="YES"
kld_list="nvidia nvidia-modeset"
nvidia_name="nvidia"
nvidia_modeset_name="nvidia-modeset"
 
Try adding this to /etc/rc.conf instead of what you had originally.

Code:
linux_enable="YES"
kld_list="nvidia nvidia-modeset"
nvidia_name="nvidia"
nvidia_modeset_name="nvidia-modeset"
will wipe the slate clean and start over again ...
 
More like "No way to use Nvidia". That's Optimus for you.
I have another high specs laptop with great nvidia card which I 'm planning to install FreeBSD on it as well. So I need to get this working on this machine first. I am sure eventually it will work.
 
Oh, if you have optimus your nvidia will probably not work. I know arch linux had a method to use the nvidia card only with a system like that but don't know if it works on FreeBSD.
 
Oh, if you have optimus your nvidia will probably not work. I know arch linux had a method to use the nvidia card only with a system like that but don't know if it works on FreeBSD.
sorry I missed shkhln comment, I just realized this laptop got "Nvidia Optimus" :(
So there is no way to get it working?
 
I just realized this laptop got "Nvidia Optimus" :(
So there is no way to get it working?


See above. I already told you how to get it working.

My W520 uses Optimus:

6254
 
That's cute, but the absolute majority of the laptops sold in the last 5 years do not have a hardware mux.

I'm glad you like it. ?

I pointed out that he had already said he had an Intel and Nvidia chip and told him how I got Optimus running on mine. He did not respond, maybe he has me on ignore. Which is always an option.
 
So I had problems kind of like you have with a GTX1070 on my desktop. The solution was to compile the nvidia drivers from source with the 12.0 Kernel Source. Somebody wrote here or on another forum, that apparently, the drivers you install with pkg are compiled for another kernel.

You have to get the ports, download the kernel with subversion to a specific folder. There's guides around, I don't have the links anymore (sorry).


Just follow it (it's not complete though), don't forget to do kldload linux64. Then do nvidia-xconfig and you are done. Hopefully, it will help.
 
So I had problems kind of like you have with a GTX1070 on my desktop.

You can only get Optimus issues on your desktop if you have (say, mechanically) broken all output ports on your Nvidia card and you had to plug your display into the motherboard video output port controlled by Intel IGPU and you still want to use the Nvidia card for 3d rendering. Any other problem is a different problem.

Somebody wrote here or on another forum, that apparently, the drivers you install with pkg are compiled for another kernel.

From https://www.freebsd.org/releases/11.2R/errata.html#open-issues:
[2018-06-28] An issue had been reported after the release of FreeBSD 11.2 with x11/nvidia-driver installed from the upstream package mirrors via pkg(8).
Building x11/nvidia-driver from the ports(7) collection has been reported to resolve the issue.
See PR 228536 for more information.

Obviously not applicable here.
 
Back
Top