Bug 193770

Summary: UEFI: loading modules installed from ports/packages via loader.conf freezes system
Product: Base System Reporter: O. Hartmann <ohartmann>
Component: confAssignee: Mark Linimon <linimon>
Status: New ---    
Severity: Affects Some People CC: banym, dcbdbis, dima_bsd, gooberferris, ross
Priority: ---    
Version: 10.4-STABLE   
Hardware: amd64   
OS: Any   

Description O. Hartmann 2014-09-19 13:15:15 UTC
Problem: Loading the driver nvidia x11/nvidia-driver (either the recent support version 340.24, or 340.32 or even the recent BETA 343.13) freezes a CURRENT booting off UEFI when the kernel module is loaded via loader.conf. The system in question runs FreeBSD 11.0-CURRENT #2 r271869: Fri Sep 19 13:28:03 CEST 2014 amd, is a Lenovo ThinkPad Edge E540 with the most recent Lenovo UEFI Firmware available as of this date.

The last message to see on vt() screen is what comes shortly before the kernel messages run over the screen when the kernel is booting and states some resoltuion informations.


The problem can be solved by loading the kernel module via /etc/rc.conf[.local] with

kld_load="nvidia"
Comment 1 Bugzilla Automation freebsd_committer 2014-09-19 13:15:15 UTC
Maintainers CC'd
Comment 2 dima_bsd 2014-10-12 11:32:08 UTC
I have the same problems with FreeBSD-10.1-RC2 (r272978) and nvidia-driver (version 331.67_1) installed from ports. I can kldload it from console but it frezes system if I trying to load it from /boot/loader.conf

nVidia GeForce GTX 760
UEFI system
Comment 3 Dave 2014-10-12 22:32:36 UTC
I also have the issue, but it goes much deeper than just NVIdia. It affects any 3rd party module you may try to load from /boot/loader.conf.

It appears that the loader is ignoring the configured module_path in the /boot/defaults/loader.conf file which includes /boot/modules as a legit search path for other modules.....Loader is ignoring this directive and is only looking at /boot/kernel for it's modules. Thus the loader dies and pukes out a CPU register dump on your screen.

The temporary fix is to either load it in the scripts (as mentioned), or copy the module from /boot/modules to /boot/kernel

It the module exists in /boot/kernel.....you can continue to load your modules in the loader.conf file normally.


FYI,


Sincerely and respectfully,


Dave
Comment 4 Dominik Zajac 2014-11-21 20:33:09 UTC
I am facing the same issue with 10.1 using UEFI.

My workaround is to load the nvidia module later using rc.conf using:

kld_list="nvidia"

For the record, kld_load="nvidia" did not work for me there.
Comment 5 Alexey Dokuchaev freebsd_committer 2015-03-30 06:08:25 UTC
Fix summary and reassign; the problem affects any 3rd party module loaded from /boot/loader.conf.
Comment 6 Ross McKelvie 2015-04-30 10:32:59 UTC
On FreeBSD 10.1-RELEASE-p9 amd64 using x11/nvidia-driver version 346.47 with a GeForce GTX 770M and the UEFI bootloader, I experienced what I believe may be the same issue.

With 'nvidia_load="YES"' in /boot/loader.conf, the final lines on the console at boot were:

panic:  free: guard 1 fail @ 0x9606a4f0 from /usr/src/lib/libstand/close.c:79
--> Press a key on the console to reboot <--

After pressing a key:

Rebooting...
panic: Load failed

I tried the suggested fix of moving the nvidia.ko module as per Comment 3, but that did not work.  The workaround of adding 'kld_list="nvidia"' to /etc/rc.conf works fine.
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2018-10-09 21:25:23 UTC
Is this still a problem with 12-ALPHA?