Agewise, it looks like you have a good intel CPU/GPU & Nvidia card, both not hyper-modern and not too old. You most likely don't need
x11-drivers/xf86-video-intel; for now, if you had it installed, remove that package.
Xorg tries to autoload (when not explicitly specified) a working driver on startup. When an appropriate "FreeBSD" KMS driver like
i915kms
(I think this is actually a Direct Rendering Module (DRM)), has already been loaded, Xorg can install a "matching mating driver". Note: that's two drivers (more on that later). Autoloading pretty much goes out of the window when more than one graphics card is present or an nvidia card is present: you'll have to specify what driver Xorg must use in an xconfig file. This complicates setting things up for Xorg.
Usually, laptops with hybrid graphics, CPU's internal GPU (iGPU) combined with a discrete graphics card (dGPU), have some hardware/software facilities to minimize power while operating on battery power. That could mean for example that the dGPU can be disabled for operation on batteries and using the iGPU for the laptop screen only; that could also mean that the dGPU can only be used to drive an external screen(s). Sometimes these facilities are referred to as "switcheroo" and may or may not be influenced by (BIOS) settings. This may complicate setting things up for Xorg further.
You could end up, as the least option, with only being able to use the iGPU for your laptop screen and only being able to use the dGPU for external screens, but only by trying and carefully noting different combinations of settings you'll be able to find out the details.
Xorg -configure
can help, but it is not a panacea: it can generate a config specification that specifies too much and/or too little. Some threads to compare:
NVIDIA driver is not working with Xorg. and
Amdgpu and HDMI output not working on ROG Strix G15
Just for clarity: every file ending in the suffix
.conf in
/usr/local/etc/X11/xorg.conf.d/ is read by Xorg as a config file at startup and parsed (=processed). (IIRC, files moved away from there to a subdirectory, e.g.
/usr/local/etc/X11/xorg.conf.d/tmp/ are not processed). My knowledge of Xorg is limited and I am no graphics expert; in any case, I hope this will get you further.
Drivers and kernel mode setting
When using a hardware device, the OS needs to deploy a specific (device) driver to act as a low-level interface between the hardware and normal application software (aka userland).
Usually, when the correct driver is (auto) loaded, the OS and applications can use that device. However, in a graphics environment things are more complicated.
At present a technique referred to as Kernel Mode Setting (KMS) is being used to manage some aspects of the graphics chips on the GPU; see also
modesetting(4). The
K in KMS refers to the fact that the code used for this technique is run in kernel mode (as opposed to normal mode). When using open source drivers, then for an intel CPU/GPU you need
i915kms.ko. For an nvidia GPU there is a KMS module
nvidia-modeset.ko. At least for 13.2-RELEASE and higher KMS driver files are all located in the FreeBSD ports repository (in the past some were part of the FreeBSD base-install). You install them via the appropriate port or package, for example by installing the meta port
x11/nvidia-driver/ or
graphics/drm-kmod/ for nvidia respectively intel graphics.
Merely loading an appropriate KMS driver from an installed package/port is not sufficient to enable kernel mode setting to be used in an Xorg session. When you want use the proprietary nvidia driver
nvidia-modeset.ko for example, first it has to be loaded, usually by specifying it as
kld_list="nvidia-modeset"
in
/etc/rc.conf. Secondly, it has to be used in combination with another driver
nvidia_drv.so in order for Xorg being able to use it; you must always specify that driver by
Driver "nvidia"
in an appropriate Xorg config file inside a
Section "Device"
EndSection
.
For an intel GPU the principle is the same, but the details are a bit different. When you want use
i951kms.ko, first it has to be loaded, usually by specifying it as
kld_list="i915kms"
in
/etc/rc.conf. Secondly, it has to be used in combination with another driver
modesetting_drv.so in order for Xorg being able to use it; see also
modesetting(4). When there is only one GPU and it is an intel one, Xorg is able to autoload this modesetting driver without further specification in an Xorg config file, thereby "mating it with" the already loaded
i915kms
driver. When this autoloading does not work, you'll have to at least specify an appropriate specific driver. In the case of your intel CPU/GPU the
modesetting_drv.so should work by specifying
Driver "modesetting"
in an appropriate Xorg config file inside a
Section "Device"
EndSection
. Because you also have an nvdia GPU, you need to specify the BusID in the relevant Device Section as well.
For Xorg, drivers are available, either installed by Xorg itself or other packages (use
pkg which <fname>
to get their origin), for example:
Code:
ls /usr/local/lib/xorg/modules/drivers/
intel_drv.so nvidia_drv.so vesa_drv.so
modesetting_drv.so scfb_drv.so
Now,
x11-drivers/xf86-video-intel installs the intel driver
intel_drv.so as shown in the ls listing. This is a legacy driver. It could work with your intel GPU, but I think you won't need it. This intel driver is also the driver I wrongly mentioned earlier:
[....]
Rich (BB code):
Section "Device"
Identifier "Card0"
Driver "intel"
BusID "pci0:0:2:0"
EndSection
[...]
you've specified an intel driver, but from
https://termbin.com/wz2e:
Rich (BB code):
[ 45.055] (II) LoadModule: "intel"
[ 45.055] (WW) Warning, couldn't open module intel
[ 45.055] (EE) Failed to load module "intel" (module does not exist, 0)
[...]
Xorg complains that it cannot identify the intel driver. Try installing the package
graphics/drm-kmod/ for your intel GPU and according to
5.3. Graphic card drivers, in your
rc.conf use:
Code:
kld_list="nvidia-modeset i915kms"
Probably the referenced section in the FreeBSD Handbook is not updated and still refers to days gone by when using the intel driver from
x11-drivers/xf86-video-intel was common. When this intel driver is installed, it also hinders Xorg in using the Xorg modesetting driver
modesetting_drv.so when an intel GPU is present and there is no explicit driver mentioned in an Xorg config file, because Xorg seems to prefer the intel driver over its own modesetting driver for an intel GPU. In my suggested section the intel driver was explicitly mentioned and of course Xorg couldn't find it. As
Alexander88207 hinted, you should use
Driver "modesetting"
instead of
Driver "intel"
in combination with
i915kms
. The Xorg modesetting driver will work together with an already loaded
i915kms
to enable kernel modesetting. This combination also has acceleration, I don't know if the intel driver has that or if it uses kernel mode setting.
Suggestions
Your xrandr's output suggests it sees only one monitor, I don't know why that is, may be related to the BIOS setting mentioned in the list below. Because there are a lot of variables at various (file) places, when posting results, include:
- sysrc -v kld_list
- Xorg log file
- all config files in
/usr/local/etc/X11/xorg.conf.d/
- relevant Bios settings
You could also try
x11/nvidia-hybrid-graphics/ but I don't have any experience with that.
You could get everything working with all your external screens attached all at once, but consider the following strategy:
- Disconnect all external monitors, try to get the intel iGPU working.
- Try to get the nvidia card to drive your laptop screen (no external screen connected). Helpful may be:
- Try to get the nvidia GPU driving one external monitor; after that add the second external monitor.
ad 1
Apart from specifying
Driver "modesetting"
, initially you probably don't need to specify a
Section "Screen"
, but you maybe need that later. For this Screen Section then use
Device "<device identifier>"
where <device identifier> refers to an appropriate one you already defined in
Section "Device"
; this is why <device identifier> has to be unique within all Device sections. Previously, in message #23, I mentioned
DEVICE SECTION from the Xorg website, the FreeBSD reference for that is
xorg.conf(5)
ad 2 & 3
Verify if your BIOS setting resemble those as mentioned; the first Dell reference:
This will ensure that any Special Modes driven by the Nvidia or AMD GPU (GSYNC, NV3D, Eyefinity, etc...) can be sent not only to the docking stations but also to the notebook DisplayPort and HDMI connectors.
The option to select the Graphics Special Mode can be made in the system BIOS under Video > Switchable Graphics (Figure 1, English only). When enabled, this simply switches the display source for Thunderbolt Type-C, notebook DisplayPort, and notebook HDMI connectors so displays from all of these connectors are sourced from the discrete GPU.
This suggests that the nvidia output is normally only connected to an output that is used when a docking station is connected; as you don't have a docking station, you might need to change your settings. This part is also briefly mentioned in the
Dell Precision 15 7000 series (7510) - Owner's Manual.
When you have a screen driven by your nvidia GPU, you should be able to use
x11/nvidia-settings. When your nvdia driver is driving multiple screens it should be possible to create one desktop spread over multiple screens. I don't know if you can do that when using the intel GPU driving multiple screens; most likely you cannot create one desktop over multiple screens where the screens are not all driven by one driver.
___
edit: made some minor additions