Solved X starts to a black screen with mouse unresponsive using nvidia driver

I am using Freebsd 12.2-RELEASE -p2
If I try to use the nvidia driver, I get a black screen and my mouse is completely unresponsive. I have to kill the Xorg process to get back to console.
This is a dual GPU laptop, so I understand it does not have the best support (when TrueOS was based on BSD I was able to use nvidia with this laptop).
output of pciconf -lv | grep B3 display:

Code:
vgapci1@pci0:0:2:0:    class=0x030000 card=0x07e11028 chip=0x591b8086 rev=0x04 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'HD Graphics 630'
    class      = display
--
vgapci0@pci0:1:0:0:    class=0x030200 card=0x07e11028 chip=0x1c8d10de rev=0xa1 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'GP107M [GeForce GTX 1050 Mobile]'
    class      = display

xorg config:
Code:
Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
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         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1050"
    BusID       "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
Code:

xorg logs: https://pastebin.com/aWkfL8W5

I am happy to give any more information needed. I tried using intel driver but it gives me: "(EE) Failed to load module "intel" (module does not exist, 0)". I have installed kmod-drm.

I would turn off one of the gpus but I do not have that option in the BIOS.
Any suggestions are appreciated, thank you!
 
You should remove your entire xorg.conf since a certain version of x11/xorg-server will use evdev by default (you can browse the forums for related issue).
Due to some ABI change between 12.1-RELEASE and 12.2-RELEASE, graphics/drm-fbsd12.0-kmod needs to be build by the end user (since the official pkg binary repository only build with 12.1-RELEASE for the 12.X branches).

Finally to have some kind of optimus support you may need to use the following patches: D22521
 
Thank you I will give it a shot.
I should note that I get modesetting driver working (so I do have some sort of X) when there is no Xorg config anywhere (that is when I get the error that the module intel does not exist), it is just not using the intel or nvidia driver.
I am building [COLOR=#0645AD /*#007a00*/]drm-fbsd12.0-kmod[/COLOR] now, i saw a post that suggested to add "WITHOUT_DRM_MODULE=t WITHOUT_DRM2_MODULE=t". I also have kld_list="/boot/modules/i915kms.ko" in rc.conf.
I will also look at those patches and see what happens, thank you!
 
The last one about applying the patches for D22521 was the ticket.
I did not have the ports nvidia-hybrid-graphics, nvidia-hybrid-utils etc.. but if I created the directories/files in the patches it worked. I also had to modify the Makefile in nvidia-hybrid-graphics. nvidia-headless-driver was not registering itself as being installed as nvidia-headless-driver, so I modified the Makefile in nvidia-hybrid-graphics to Depend on just nvidia-driver.
I rebooted, ran startx and it is now using the power hungry nvidia driver. Thank you monwarez
 
Back
Top