I cant really get the nvidia-drm to work aside from that everything works.

Hi,

I'm trying to get NVIDIA PRIME/offloading to work on a hybrid laptop running FreeBSD 15.1-RELEASE-p7.

Hardware

  • Intel Raptor Lake UHD Graphics — PCI 00:02.0
  • NVIDIA GeForce RTX 5050 Laptop GPU (GB207M) — PCI 01:00.0
  • Internal display connected to Intel.
  • Xorg with OXWM, started via startx.
Driver installation

I'm using NVIDIA 580 from Quarterly:

  • nvidia-driver-580-580.178.04_1
  • nvidia-kmod-580
  • nvidia-drm-612-kmod-580
  • drm-612-kmod
The proprietary NVIDIA driver and GSP firmware load successfully, and nvidia-smi works as well.

Problem

After loading the NVIDIA DRM driver:

doas kldload nvidia-drm
Both GPUs register with DRM/KMS:

hw.dri.0.name: i915 0x61
hw.dri.0.busid: pci:0000:00:02.0
hw.dri.1.name: nvidia-drm 0x62
hw.dri.1.busid: pci:0000:01:00.0
However, Xorg fails to start with:

modeset(G0): [DRI2] DRI driver: nouveau
(EE) modeset(G0): Failed to create pixmap
Fatal server error:
failed to create screen resources
This also happens with startx, so it isn't SLiM-specific.

After unloading both nvidia-drm and nvidia-modeset, Intel graphics starts successfully and OXWM works OK. The proprietary nvidia.ko module and GSP firmware remain loaded too.

Xorg configuration

I have an Intel OutputClass with PrimaryGPU "yes" and an explicitly defined Intel Device section.

The NVIDIA package-provided OutputClass matches nvidia-drm and specifies the proprietary nvidia Xorg driver. It does not contain PrimaryGPU "yes".

Questions

  1. Is there a known compatibility issue between NVIDIA 580 and DRM 6.12 on FreeBSD 15.1?
  2. Why does Xorg report nouveau as the DRI2 driver when the proprietary NVIDIA driver is installed?
  3. What is the recommended Intel-primary/NVIDIA-offload configuration on FreeBSD?
My goal is to keep Intel driving the internal display and use NVIDIA for selected applications.

I can provide the full Xorg logs, pciconf, devinfo, and package information.

btw if you are a mod and i made some mistakes let me know this my first
 
I'm not an expert, and I also struggle to make the mvidia-drm or nvidia-modeset and amdgpu work in couple of my olden, system as intended - one desktop with GTX960 and the other laptop with both amdgpu and on chip Intel GPUs. No matter which kmod and driver I tried in each system, the GPU's DRI doesn't function as it should, and the screen resolutions are not selectable. FreeBSD's 15.1-RELEASE (ai - automagic installer) configures X to run in VESA, despite the fact that all the required GPU modules are loaded, and "dmesg" indicates that the GPU hardware is recognized. Even if I don't indicate any GPU references with "kld_stat" in /etc/rc.conf, I do get X GUI, also in VESA mode :)

To get help from an expert on here you can start with dumping outputs of your:

Files:
/boot/loader.conf
/etc/rc.conf
/var/log/Xorg.0.log

Console commands:
pkg info drm-kmod
kldstat
xrandr
 
This also happens with startx, so it isn't SLiM-specific.
If an Operating System's GPU driver is not correct or correct but automagically misconfigured, including in: MSOS, *BSD or Linux variants, your GUI output won't function at all, or as intended. And there isn't known AI solution or automagic to fix that 😁
 
I'm not an expert, and I also struggle to make the mvidia-drm or nvidia-modeset and amdgpu work in couple of my olden, system as intended - one desktop with GTX960 and the other laptop with both amdgpu and on chip Intel GPUs. No matter which kmod and driver I tried in each system, the GPU's DRI doesn't function as it should, and the screen resolutions are not selectable. FreeBSD's 15.1-RELEASE (ai - automagic installer) configures X to run in VESA, despite the fact that all the required GPU modules are loaded, and "dmesg" indicates that the GPU hardware is recognized. Even if I don't indicate any GPU references with "kld_stat" in /etc/rc.conf, I do get X GUI, also in VESA mode :)

To get help from an expert on here you can start with dumping outputs of your:

Files:
/boot/loader.conf
/etc/rc.conf
/var/log/Xorg.0.log

Console commands:
pkg info drm-kmod
kldstat
xrandr
here is some really really useful logs :

1. NVIDIA DRM loaded kernel modules​

i915kms.ko
drm.ko
nvidia_gsp_ga10x_fw.ko
nvidia.ko
nvidia-drm.ko
nvidia-modeset.ko

2. Both GPUs registered with DRM/KMS​

hw.dri.1.modesetting: 1
hw.dri.1.busid: pci:0000:01:00.0
hw.dri.1.name: nvidia-drm 0x62

hw.dri.0.modesetting: 1
hw.dri.0.busid: pci:0000:00:02.0
hw.dri.0.name: i915 0x61

3. Xorg failure with NVIDIA DRM enabled​


[CODE]modeset(G0): glamor X acceleration enabled on NVIDIA GeForce RTX 5050
modeset(G0): [DRI2] DRI driver: nouveau
modeset(G0): [DRI2] VDPAU driver: nouveau
(EE) modeset(G0): Failed to create pixmap

Fatal server error:
failed to create screen resources

4. Working Intel-only state​

i915kms.ko
drm.ko
nvidia_gsp_ga10x_fw.ko
nvidia.ko
Xorg initializes Intel successfully:
modeset(0): glamor X acceleration enabled on Mesa Intel(R) Graphics (RPL-S)
modeset(0): glamor initialized
modeset(0): Output eDP-1 connected
modeset(0): Output eDP-1 using initial mode 1920x1080
modeset(0): [DRI2] Setup complete
modeset(0): [DRI2] DRI driver: iris
 
also :

/boot/loader.conf



boot_mute="YES"
efi_max_resolution="1920x1080"
screen.font="16x32"
vboxdrv_load="YES"
hw.nvidia.registry.EnableGpuFirmware=1
hw.nvidiadrm.modeset="1"



/etc/rc.conf



clear_tmp_enable="YES"
hostname="FreeBSD"
sshd_enable="NO"
ntpd_enable="YES"
local_unbound_enable="NO"
powerd_enable="YES"
powerd_flags="-a hiadaptive -b adaptive"
performance_cx_lowest="Cmax"
economy_cx_lowest="Cmax"
dumpdev="AUTO"
wlans_iwlwifi0="wlan0"
create_args_wlan0="country SA regdomain none"
ifconfig_wlan0="WPA DHCP"
kld_list="i915kms nvidia_gsp_ga10x_fw nvidia"
allscreens_flags="-f spleen-16x32"
linux_enable="YES"
slim_enable="YES"
dbus_enable="YES"
vboxnet_enable="YES"
devfs_system_ruleset="system"
pf_enable="YES"
pf_rules="/etc/pf.conf"
pflog_enable="NO"
pflog_logfile="/var/log/pflog"
unbound_enable="YES"
ntp_leapfile_expiry_days="30"
 
If an Operating System's GPU driver is not correct or correct but automagically misconfigured, including in: MSOS, *BSD or Linux variants, your GUI output won't function at all, or as intended. And there isn't known AI solution or automagic to fix that 😁
I dont agree the SLiM may work with a misconfiguration of Xorg However It wont launch Xorg .
 
when i
kldload nvidia-drm
startx faills and then when I
kldunload nvidia-drm
startx works i did adjust my config according to the documentation:
This is just a dumb suggestion from a dumb end user, but ..:)

I would "kldload" and "kldunload" only ONE nvidia gpu module directive each time in the console, without the i915kms!
kldload nvidia
kldload nvidia-modeset
kldload nvidia-drm

And, then I'd try "startx" after each kldload to see the outcome and check the Xorg.0.log right after the test.

You could also remove ALL the "kld_list" GPU directives from "/etc/rc.conf" and reboot. If there's no kernel panic and FreeBSD will boot into multiuser mode, then you can also try the "startx" for test.

I don't know if your BIOS has video device selection option settings. If it has, you could try to enable only one that you plan to test.

Personally, I did the above mentioned manipulations of modulation in my olden Dell Precision M4600 laptop with intel and amd gpus, that was running FreeBSD 15.1-RELEASE. But, it didn't make any difference if I loaded and unloded pertaining kmods manually, one at the time, 2 at the time, all of them at the same time, or none of them. Although only in VESA, but I had working X display, each time 😁 The only module that crashed FreeBSD video was radeon.ko, which I tried too. Later, out of frustraion and desperation, I ripped out SSD with GhostBSD, that ran OK, in my old Dell T30 desktop with even older nvidia quadro gpu, and I installed the drive into my hybrid laptop with intel and amd gpus. That Ghost boot my laptop (somehow), with automagic gpu configuration using radeon as the gpu driver, into MATE desktop. The Xorg logs are full of error messages, but it runs X, also in VESA 😁:):(
 
Hi

One common issue is that a driver for another version of Freebsd is installed.
As you are using 15.1-p7 all your Kmods need to be buildt for that kernel-version
Im now running 15.2-stable

$ uname -a
FreeBSD sh570r6 15.2-STABLE FreeBSD 15.2-STABLE stable/15-n287088-08e7d27315cf sh570r6 amd64


As you can see with the highlighted version numbers below, they are all higher than 1501000
meaning that they are for a kernel release higher than 15.1
If you have a kmod driver with version 1500068 , that driver is for Freebsd 15.0 kernel and needs to be replaced.


$ pkg info| egrep "nvidia|drm"
drm-612-kmod-6.12.85.1501502_1 Direct Rendering Manager (DRM) GPU drivers
drm-kmod-20260508 Direct Rendering Manager (DRM) GPU drivers metaport
libdrm-2.4.134,1 Direct Rendering Manager library and headers
nvidia-driver-595.99.02 NVIDIA graphics driver userland
nvidia-drm-612-kmod-595.99.02.1501502 NVIDIA DRM Kernel Module
nvidia-drm-kmod-595.99.02 NVIDIA DRM kernel module
nvidia-kmod-595.99.02.1501502 NVIDIA graphics driver kernel module


EDITED:

I would try this kld_list in /etc/rc.conf .
The firmware is loaded by the"hw.nvidia.registry.EnableGpuFirmware=1" statement in /boot/loader.conf and does not need to be in the kld_list .

kld_list="i915kms nvidia-drm"
 
Why are you trying to use the native and linux driver at the same time?

The native driver for FreeBSD works perfectly fine, no need for those linux/drm shenanigans. Remove nvidia-drm and drm-kmod packages; only nvidia-driver and nvidia-kmod are necessary.
It's also sufficient to only load the 'nvidia-modeset' kernel module (via kld_list); nvidia.ko will be loaded as a dependency.
 
This is just a dumb suggestion from a dumb end user, but ..:)

I would "kldload" and "kldunload" only ONE nvidia gpu module directive each time in the console, without the i915kms!
kldload nvidia
kldload nvidia-modeset
kldload nvidia-drm

And, then I'd try "startx" after each kldload to see the outcome and check the Xorg.0.log right after the test.

You could also remove ALL the "kld_list" GPU directives from "/etc/rc.conf" and reboot. If there's no kernel panic and FreeBSD will boot into multiuser mode, then you can also try the "startx" for test.

I don't know if your BIOS has video device selection option settings. If it has, you could try to enable only one that you plan to test.

Personally, I did the above mentioned manipulations of modulation in my olden Dell Precision M4600 laptop with intel and amd gpus, that was running FreeBSD 15.1-RELEASE. But, it didn't make any difference if I loaded and unloded pertaining kmods manually, one at the time, 2 at the time, all of them at the same time, or none of them. Although only in VESA, but I had working X display, each time 😁 The only module that crashed FreeBSD video was radeon.ko, which I tried too. Later, out of frustraion and desperation, I ripped out SSD with GhostBSD, that ran OK, in my old Dell T30 desktop with even older nvidia quadro gpu, and I installed the drive into my hybrid laptop with intel and amd gpus. That Ghost boot my laptop (somehow), with automagic gpu configuration using radeon as the gpu driver, into MATE desktop. The Xorg logs are full of error messages, but it runs X, also in VESA 😁:):(
NO putting it in kld_list and rebooting gives the same result
 
I forgot to mention that GhostBSD was not able to install from USB boot stick onto my Dell M4600 laptop due to lack of video output. But, when I pulled out the already installed GhostBSD on SSD from my Dell T30, wich has different hardware configuration, and just jammed that drive into Dell M4600 laptop, damn Ghost just boot the laptop as if the foreing SSD belonged there, somehow 😁

My conspiracy theory; laptops are manufactured to let Microsoft and Apple make more money than they need, and to make life misrable for Open Source software developers and dumb end users like me - hehe
 
Back
Top