# How to use two screens at the same time while I'm using FreeBSD.



## ziomario (Jul 17, 2022)

Hello to everyone.

Actually I have two screens,but usually I use only one of them. The screen I use everyday with FreeBSD is attached to the HDMI port of the "*VGA compatible controller: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630] (rev 02)*" graphic chipset. And it works well. Sometimes,when I want to virtualize Linux,I attach the second screen to the HDMI port of the second GPU I have,the *Nvidia Geforce RTX 2080 ti* and in this way I can use even the second screen. But,what about to use it without to boot another OS ? This idea came to my mind from some time and I would like to gather some suggestions to understand how can I do this. I find very useful to drag and drop, with a proper tool, files and folders from the screen 1 to the screen 2,like I do in Windows and Linux. But I have no idea about how to do it in FreeBSD. It could be useful even when I want to make some 3d modelling using Blender on the first screen and using the second screen to watch some tutorial. Can someone give me some suggestions about some method,tecnique and tools to achieve this goal ? very thanks.


----------



## scottro (Jul 17, 2022)

FWIW, when I worked with multimonitors, I used NVidia's GUI Config tool  I think it's called nvidia-settings and you may  have use sudo to save changes it  makes in the configuration. It worked well for me.


----------



## ziomario (Jul 18, 2022)

And what about if I want to keep using the intel driver of my *VGA compatible controller: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630] (rev 02)*" graphic chipset ? Has Intel a similar tool like the NVidia one ? I ask this because I use a lot of virtual machines,so I haven't installed the nvidia driver on the system at all,because I don't need it. Will be the linux vm that needs the installation of the nvidia driver. If I can do it using the Intel graphic chipset,I'm non obliged to installl and deinstall the nvidia driver every time I want to have the multimonitor.


----------



## scottro (Jul 18, 2022)

Sorry, I only have experience with the Nvidia ones.


----------



## ziomario (Jul 18, 2022)

In reddit the user "kolepl" suggested to me to use xrandr and the tool ARrandR and I did it.

I really don't understand why,with this xorg.conf :

https://pastebin.ubuntu.com/p/pHNTYGBs33/

FreeBSD recognizes only the intel gpu :



```
xrandr --listproviders

Providers: number : 1 Provider 0: id: 0x43 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:Intel
```



and I tried both these combinations in xorg.conf :




```
Identifier  "Card0"
Driver      "intel"
BusID       "PCI:0:2:0"
EndSection

AND

Section "Device"
Identifier  "Card1"
Driver      "nvidia"
BusID       "PCI:2:0:0"
EndSection


OR :

Section "Device"
Identifier  "Card1"
Driver      "modesetting"
BusID       "PCI:2:0:0"
EndSection
```

actually my monitor 1 is attached to the HDMI port of the intel gpu and the monitor 2 is attached to the HDMI port of the nvidia GPU.

Does not seems correct ? on FreeBSD I have installed these packages for the gpus :

*1) xf86-video-intel-2.99.917.916_1,1 X.Org legacy driver for Intel integrated graphics chipsets

2) nvidia-driver-510.60.02        NVidia graphics card binary drivers for hardware OpenGL rendering*

what else ? ARrandR recognizes only the HDMI-1 monitor. Monitor 2 is turned off.


----------



## jbo (Jul 18, 2022)

Not sure if this is valuable information but all my systems have either an Nvidia GPU or an Intel integrated GPU. In all cases, I only use xrandr(1) to setup my monitors.

On the system I'm currently (with an Nvidia Quadro P5000):

```
#!/bin/sh

# Center monitor
xrandr --output DP-6 --mode 3840x2160

# Right monitor
xrandr --output DP-4 --right-of DP-6 --mode 2560x1440 --rotate right

# Left monitor
xrandr --output DP-0 --left-of DP-6 --mode 2560x1440 --rotate left
```

No fuckery with Nvidia tools or xorg.conf required.

`xrandr -q` provides the necessary per monitor/display/screen information.


----------



## mer (Jul 18, 2022)

The nvidia is actually a second card, not an extra GPU on the motherboard?
output of kldstat | grep nvidia to make sure the nvidia stuff is loaded?  make sure nivdia.ko and nvidia-modeset.ko are loaded and in your rc.conf kld_list line.
What does /var/log/Xorg.0.log say about the devices detected?

"FWIW, when I worked with multimonitors, I used NVidia's GUI Config tool I think it's called nvidia-settings and you may  have use sudo to save changes it  makes in the configuration. It worked well for me."

It works for multiple monitors connected to the same Nvidia card via different ports, but probably won't help with screens across 2 different GPUs.


----------



## SirDice (Jul 18, 2022)

Not sure if the NVidia driver will actually work in combination with other video cards. The NVidia driver uses a couple of modified Xorg libraries, those probably conflict with the AMD/Intel driver that uses the original Xorg libraries.


----------



## mer (Jul 18, 2022)

That is a good point SirDice.  I'm hoping that if there is a conflict the packages/ports would be marked with CONFLICT so you can't shoot yourself in the foot.


----------



## ziomario (Jul 18, 2022)

Probably SirDice is right. I've added to rc.conf :


```
nvidia_load="YES"  
kld_load="nvidia.ko"
kld_load="nvidia-modeset.ko"
```

and then I've rebooted and :


```
# xrandr --listproviders

Providers: number : 1
Provider 0: id: 0x43 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:Intel
```

and :


```
# kldstat | grep nvidia
nothing.
```

I forgot to say that on my BIOS I have chosen the Intel gpu as primary. What about to buy an HDMI splitter that allows me to attach the two monitors only to the intel HDMI port ?


----------



## ziomario (Jul 18, 2022)

on /etc/rc.conf :


```
kld_load="nvidia.ko"
kld_load="nvidia-modeset.ko"
```

REBOOT :


```
# kldstat

Id Refs Address                Size Name
1  133 0xffffffff80200000  1f30590 kernel
3    1 0xffffffff82147000   5848b8 vmm.ko
4    3 0xffffffff826cc000    929d8 vboxdrv.ko
5    1 0xffffffff8275f000    29d28 fusefs.ko
6    1 0xffffffff82789000   5ec1d8 zfs.ko
7    1 0xffffffff82d76000     af68 cryptodev.ko
8    2 0xffffffff82d81000     82b0 bridgestp.ko
9    1 0xffffffff82d8a000     40f8 nmdm.ko
10    1 0xffffffff82d90000     feb0 if_bridge.ko
11    1 0xffffffff83210000     3530 fdescfs.ko
12    2 0xffffffff83214000     4240 vboxnetflt.ko
13    2 0xffffffff83219000     aac8 netgraph.ko
14    1 0xffffffff83224000     31c8 ng_ether.ko
15    1 0xffffffff83228000     55e0 vboxnetadp.ko
16    1 0xffffffff8322e000     2220 cpuctl.ko
17    1 0xffffffff83231000     6730 cuse.ko
18    1 0xffffffff83238000     3378 acpi_wmi.ko
19    1 0xffffffff8323c000     3250 ichsmb.ko
20    1 0xffffffff83240000     2180 smbus.ko
21    1 0xffffffff83243000     2110 pchtherm.ko
22    1 0xffffffff83246000     2340 uhid.ko
23    1 0xffffffff83249000     4350 ums.ko
24    1 0xffffffff8324e000     3380 usbhid.ko
25    1 0xffffffff83252000     31f8 hidbus.ko
26    1 0xffffffff83256000     e538 snd_uaudio.ko
27    1 0xffffffff83265000     3320 wmt.ko
28    1 0xffffffff83269000     2a08 mac_ntpd.ko
29    1 0xffffffff8326c000    38070 linux.ko
30    4 0xffffffff832a5000    10ab0 linux_common.ko
31    1 0xffffffff832b6000    32208 linux64.ko
32    1 0xffffffff832e9000     2260 pty.ko
33    1 0xffffffff832ec000     639c linprocfs.ko
34    1 0xffffffff832f3000     3284 linsysfs.ko
35    1 0xffffffff832f7000     9ea0 tmpfs.ko
36    1 0xffffffff83301000     4700 nullfs.ko
37    1 0xffffffff83306000   158438 i915kms.ko
38    1 0xffffffff8345f000    7f020 drm.ko
39    2 0xffffffff834df000     cbc8 linuxkpi_gplv2.ko
```

I don't see those module loaded. why ?


----------



## SirDice (Jul 18, 2022)

ziomario said:


> I've added to rc.conf :
> 
> ```
> nvidia_load="YES"
> ...


Great. None of them work because they're all incorrect. It's `kld_list="nvidia-modeset"`


----------



## SirDice (Jul 18, 2022)

mer said:


> I'm hoping that if there is a conflict the packages/ports would be marked with CONFLICT so you can't shoot yourself in the foot.


I think they solved this with some clever use of libmap.conf(5). But lib/libEGL-NVIDIA.so for example is a modified version of lib/libEGL.so from Xorg. I presume that the AMD/Intel driver actually uses that one. But you still have two of the same libraries loaded when both drivers are active. It works for each independently, but I have no idea what the effect is when both are loaded.


----------



## ziomario (Jul 18, 2022)

should I also add :


```
/boot/loader.conf
    
nvidia_load="YES"
```

?

what the difference between "*kld_list*" and "*kld_load*" ? it confuses me !


----------



## ziomario (Jul 18, 2022)

This is what happens :


```
# kldstat | grep nvidia

 3    2 0xffffffff826b6000  2c4e1c0 nvidia.ko
19    1 0xffffffff86031000    fd310 nvidia-modeset.ko

# xrandr --listproviders

Providers: number : 1
Provider 0: id: 0x43 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:Intel
```

monitor 2 turned off and xorg.conf like this :


```
Section "Device"
Identifier  "Card0"
Driver      "intel"
BusID       "PCI:0:2:0"
EndSection

Section "Device"
Identifier  "Card1"
Driver      "modesetting"
BusID       "PCI:2:0:0"
EndSection
```


----------



## jbo (Jul 18, 2022)

ziomario said:


> should I also add :


Questions like these can usually be answered by reading the documentation of the corresponding driver or port.
In case of x11/nvidia-driver, the package message explains how to use it:



> jbo@fbsd_beefy01 /u/h/jbo> pkg info -D nvidia-driver
> nvidia-driver-510.60.02:
> On install:
> To use these drivers, make sure that you have loaded the NVidia kernel
> ...


The package messages are displayed when installing a package or can be displayed via `pkg info -D` as shown above.


----------



## SirDice (Jul 18, 2022)

ziomario said:


> hat the difference between "`kld_list`" and "`kld_load`" ? it confuses me !


What difference? `kld_load` doesn't exist.


----------



## mer (Jul 18, 2022)

kld_list is the variable name in rc.conf that tells the init system to "load these modules".  
They get loaded after the loader, but before the system is done booting.  I prefer to not add video stuff to loader.conf (that's just me).

What does /var/log/Xorg.0.log say about the nvidia card?  a grep -v driver /var/log/Xorg.0.log?


----------



## wolffnx (Jul 18, 2022)

I use 3 monitors, 2 Nvidia and one Intel
In mi case I only load the nvidia module at boot, and when start Xorg the intel module is load
my xorg.conf:


```
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 375.26  (root@110amd64-quarterly-job-24)  Sun Jan  8 01:33:48 UTC 2017

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 375.26  (root@110amd64-quarterly-job-03)  Tue Jan  3 19:51:44 UTC 2017

Section "ServerLayout"

#    Screen      1  "Screen1" RightOf "Screen0"
    Identifier     "X.org Configured"
#    Screen      1  "Screen0" RightOf "Screen2"
 #   Screen      0  "Screen1" 0 0
  #  Screen      2  "Screen2" RightOf "Screen0"

 
#    Screen      1  "Screen0" LeftOf "Screen0 #derecha"
#    Screen      0  "Screen1" 0 0 #centro
#   Screen      2  "Screen2" RightOf "Screen1"

    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" RightOf "Screen0"
    Screen      2  "Screen2" RightOf "Screen1"





    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "Keyboard0" "CoreKeyboard"
    Option         "Xinerama" "0"
EndSection

Section "Files"
    ModulePath      "/usr/local/lib/xorg/modules"
    FontPath        "/usr/local/share/fonts/misc/"
    FontPath        "/usr/local/share/fonts/TTF/"
    FontPath        "/usr/local/share/fonts/OTF/"
    FontPath        "/usr/local/share/fonts/Type1/"
    FontPath        "/usr/local/share/fonts/100dpi/"
    FontPath        "/usr/local/share/fonts/75dpi/"
    FontPath "/usr/local/share/fonts/terminus-font/"
FontPath "/usr/local/share/fonts/TerminusTTF/"
FontPath "/usr/local/share/fonts/webfonts/"
EndSection


#Section "Extensions"
#Option "SHAPE" "Disable"
#Option "SYNC" "Disable"
#Option "COMPOSITE" "Disable"
#Option "DRI3" "Disable"
#Option "DOMS" "Disable"


#EndSection

Section "Module"
    Load           "glx"
Load "freetype"
EndSection

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
#    ModelName      "SKYDATA S.P.A. SKYWORTH"
# Option    "DPI"  "100 x 100"
 #   HorizSync       15.0 - 80.0
  #  VertRefresh     49.0 - 76.0
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "LG Electronics W2243"
    HorizSync       30.0 - 83.0
    VertRefresh     56.0 - 75.0
EndSection

Section "Monitor"
    Identifier   "Monitor2"
    VendorName   "Monitor Vendor"
    ModelName    "Monitor Model"
EndSection




Section "Device"

        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "SWcursor"               # [<bool>]
        #Option     "HWcursor"               # [<bool>]
        #Option     "NoAccel"                # [<bool>]
        #Option     "ShadowFB"               # [<bool>]
        #Option     "UseFBDev"               # [<bool>]
        #Option     "Rotate"                 # [<str>]
        #Option     "VideoKey"               # <i>
        #Option     "FlatPanel"              # [<bool>]
        #Option     "FPDither"               # [<bool>]
        #Option     "CrtcNumber"             # <i>
        #Option     "FPScale"                # [<bool>]
        #Option     "FPTweak"                # <i>
        #Option     "DualHead"               # [<bool>]
#Option        "AIGLX"
#Option        "XAANoOffscreenPixmaps"    "True"
#Option      "MigrationHeuristic"        "greedy"
#Option        "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x1"
#Option "TripleBuffer" "1"
#Option "XAANoOffscreenPixmaps" "true"

#Option "DRI" "true"
#Option "RenderAccel" "True"

#Option "NvAGP" "1"


#Option "NoLogo" "0"
#Option "EmulatedOverlaysTimerMs" "1"

    Identifier     "Card0"
    Driver         "nvidia"
    BusID          "PCI:1:0:0"
EndSection

Section "Device"

        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "NoAccel"                # [<bool>]
        #Option     "AccelMethod"            # <str>
        #Option     "Backlight"              # <str>
        #Option     "DRI"                    # <str>
        #Option     "ColorKey"               # <i>
        #Option     "VideoKey"               # <i>
        #Option     "Tiling"                 # [<bool>]
        #Option     "LinearFramebuffer"      # [<bool>]
        #Option     "SwapbuffersWait"        # [<bool>]
        #Option     "TripleBuffer"           # [<bool>]
        #Option     "XvPreferOverlay"        # [<bool>]
        #Option     "HotPlug"                # [<bool>]
        #Option     "ReprobeOutputs"         # [<bool>]
        #Option     "XvMC"                   # [<bool>]
        #Option     "ZaphodHeads"            # <str>
        #Option     "TearFree"               # [<bool>]
        #Option     "PerCrtcPixmaps"         # [<bool>]
        #Option     "FallbackDebug"          # [<bool>]
        #Option     "DebugFlushBatches"      # [<bool>]
        #Option     "DebugFlushCaches"       # [<bool>]
        #Option     "DebugWait"              # [<bool>]
        #Option     "BufferCache"            # [<bool>]
#Option        "AIGLX"
#Option        "XAANoOffscreenPixmaps"    "True"
#Option      "MigrationHeuristic"        "greedy"
#Option "NvAGP" "0"
#Option "TripleBuffer" "1"
#Option "XAANoOffscreenPixmaps" "true"
#Option "DRI" "true"
#Option "RenderAccel" "True"
#Option        "RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x1"

#Option "NvAGP" "1"
#Option "NoLogo" "0"
#Option "EmulatedOverlaysTimerMs" "1"


    Identifier     "Card1"
    Driver         "nvidia"
    BusID          "PCI:0:2:0"
EndSection



Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "NoAccel"                # [<bool>]
#        Option     "AccelMethod"    "exa"        # <str>
        #Option     "Backlight"              # <str>
        Option     "DRI"     "3"               # <str>
        #Option     "ColorKey"               # <i>
        #Option     "VideoKey"               # <i>
        #Option     "Tiling"                 # [<bool>]
        #Option     "LinearFramebuffer"      # [<bool>]
        #Option     "SwapbuffersWait"        # [<bool>]
        #Option     "TripleBuffer"           # [<bool>]
        #Option     "XvPreferOverlay"        # [<bool>]
        #Option     "HotPlug"                # [<bool>]
        #Option     "ReprobeOutputs"         # [<bool>]
        #Option     "XvMC"                   # [<bool>]
        #Option     "ZaphodHeads"            # <str>
 #       Option     "TearFree"  "false"             # [<bool>]
        #Option     "PerCrtcPixmaps"         # [<bool>]
        #Option     "FallbackDebug"          # [<bool>]
        #Option     "DebugFlushBatches"      # [<bool>]
        #Option     "DebugFlushCaches"       # [<bool>]
        #Option     "DebugWait"              # [<bool>]
        #Option     "BufferCache"            # [<bool>]
#Option        "AIGLX"
#Option        "XAANoOffscreenPixmaps"    "True"
#Option      "MigrationHeuristic"        "greedy"
    Identifier  "Card2"
    Driver      "intel"
    BusID       "PCI:0:2:0"
EndSection







Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 210"
    BusID          "PCI:1:0:0"
    Screen          0
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 210"

    BusID          "PCI:1:0:0"
    Screen          1
EndSection




Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "metamodes" "HDMI-0: 1360x765 +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "CRT-0"
    Option         "metamodes" "DVI-I-0: nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection


Section "Screen"
    Identifier "Screen2"
    Device     "Card2"
    Monitor    "Monitor2"
        DefaultDepth 24

    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection
```

I have 3 independent monitors
I forget, you must enable the bios option for use multiple monitors , for nvidia and intel works together


----------



## ziomario (Jul 18, 2022)

SirDice said:


> What difference? `kld_load` doesn't exist.



is this wrong,then ?

*kld_load="snd_hda"*


----------



## ziomario (Jul 18, 2022)

mer said:


> kld_list is the variable name in rc.conf that tells the init system to "load these modules".
> They get loaded after the loader, but before the system is done booting.  I prefer to not add video stuff to loader.conf (that's just me).
> 
> What does /var/log/Xorg.0.log say about the nvidia card?  a grep -v driver /var/log/Xorg.0.log?








						Ubuntu Pastebin
					






					pastebin.ubuntu.com


----------



## SirDice (Jul 18, 2022)

ziomario said:


> is this wrong,then ?


Yes. (Besides the fact that snd_hda(4) is already in the GENERIC kernel).


----------



## ziomario (Jul 18, 2022)

I think that I'm on the right track. I've modified the *xorg.conf* file like this :


```
Section "Device"
Identifier  "Card0"
Driver      "intel"
BusID       "PCI:0:2:0"
EndSection

Section "Device"
Identifier  "Card1"
Driver      "nvidia"
BusID       "PCI:2:0:0"
EndSection
```

and now the monitor 2 is turned on and I can see the mouse pointer that can go on that monitor,BUT there is nothing inside of it,it is totally black. Any idea why is empty and black ? This is the new log file :






						Ubuntu Pastebin
					






					pastebin.ubuntu.com


----------



## ziomario (Jul 18, 2022)

wolffnx said:


> I use 3 monitors, 2 Nvidia and one Intel
> In mi case I only load the nvidia module at boot, and when start Xorg the intel module is load
> my xorg.conf:
> 
> ...



in my BIOS there isn't the option to enable the multimonitor. I can only choose which GPU will be primary.


----------



## mer (Jul 18, 2022)

Does xrandr see 2 screens now?  You may have to do something in your desktop environment to tell it about the extra screen.


----------



## ziomario (Jul 18, 2022)

No.


```
# xrandr --listproviders

Providers: number : 1
Provider 0: id: 0x43 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 1 associated providers: 0 name:Intel
```


----------



## Alexander88207 (Jul 18, 2022)

I do use x11/arandr to configure multiple monitors.


----------



## ziomario (Jul 18, 2022)




----------



## Alexander88207 (Jul 18, 2022)

Looks like you need to go to the point where you already have been: https://forums.FreeBSD.org/threads/...time-while-im-using-freebsd.85866/post-575379 and looks like you also need to configure a monitor/screen section.


----------



## ziomario (Jul 18, 2022)

This is the current xorg.conf file that I'm using :






						Ubuntu Pastebin
					






					pastebin.ubuntu.com


----------



## Criosphinx (Jul 18, 2022)

Why are you using both adapters?

You can disable the intel graphics and connect both screens to the nvidia card, it will work without a hasle.


----------



## mer (Jul 18, 2022)

So with that xorg.conf you are not seeing the nvidia device get loaded in the xorg.0.log file.  That needs to be corrected before xrandr can use it.  I'm not sure how to get there.


----------



## ziomario (Jul 18, 2022)

Criosphinx said:


> Why are you using both adapters?
> 
> You can disable the intel graphics and connect both screens to the nvidia card, it will work without a hasle.



To attach two monitors on two nvidia gpu ports is very unconfortable for me,because I use the bhyve virtual machines very often. And if I want to do that,I should reboot the PC.


----------



## ziomario (Jul 18, 2022)

What happens if I buy an HDMI splitter ? The idea is to attach two screens on the intel HDMI port. Could I use them at the same time in this way ? My answer : NO.


----------



## jbo (Jul 18, 2022)

ziomario said:


> To attach two monitors on two nvidia gpu ports is very unconfortable for me,because I use the bhyve virtual machines very often. And if I want to do that,I should reboot the PC.


Please elaborate in more detail.
Given that bhyve does not support GPU pass-through I assume that your host has full control over the GPU.
Why would reboots be necessary?



ziomario said:


> What happens if I buy an HDMI splitter ? The idea is to attach two screens on the intel HDMI port. Could I use them at the same time in this way ?


Those splitters typically work by presenting a display to the host equivalent to the resolution of both monitors combined.
A GPU has a maximum resolution (per port and in total) that it can support. You want to make sure that your GPU will be able to handle that resolution of the "single display" that the splitter presents to the GPU.


----------



## ziomario (Jul 18, 2022)

jbodenmann said:


> Please elaborate in more detail.
> Given that bhyve does not support GPU pass-through I assume that your host has full control over the GPU.
> Why would reboots be necessary?
> 
> ...



Bhyve supports the GPU passthru,man. For the Nvidia GPU it works only with a linux vm. For the amd gpu it works for linux and windows vm. If I want to use the Nvidia gpu on FreeBSD,I can't pass it thru on any Linux vm. If I want to do this,I need to reboot. My idea is different : I want to use the hdmi port of the intel gpu on FreeBSD and I want to use the HDMI port of the nvidia gpu as secondary monitor when I don't want to boot any bhyve vm. But in this way,I can even boot a bhyve vm without rebooting,because my primary gpu is the intel. I can choose between the first and the second option without rebooting the PC. Regarding the splitter,I've read that they don't allow to turn on two monitors at the same time,so this solution is not good at all.


----------



## jbo (Jul 18, 2022)

ziomario said:


> Bhyve supports the GPU passthru,man.


Can you please provide supporting evidence for this (eg. the corresponding pieces of the official documentation)? Last time I checked GPU pass-through was not officially supported. I'd be very happy to see this being officially supported.

In any case, we're in 36 messages on this thread and _now_ you mention that you're passing the GPU through a hypervisor to a VM. This seems like vital information that should have been provided by the initial post


----------



## ziomario (Jul 18, 2022)

Man,where have you been the last year ? I've started so many threads asking and showing that bhyve supports the GPU passthru. I've even helped the developers to enable this feature. I didn't talk about this because I've thought that it was not necessary,since my primary goal is to use two monitors at the same time,not to passthru my nvidia gpu. Maybe it was relevant,so I apologize for not mentioning this. Anyway I should clarify that officially bhyve does not support the gpu passthru,because the patches needed haven't been uploaded totally on the FreeBSD code,but you can do that applying them for your own.


----------



## Alexander88207 (Jul 18, 2022)

ziomario said:


> Man,where have you been the last year ? I've started so many threads asking and showing that bhyve supports the GPU passthru.



jbodenmann IIUC https://forums.freebsd.org/threads/bhyve-gpu-pass-through.83152/


----------



## ziomario (Jul 18, 2022)

GitHub - Beckhoff/freebsd-src at phab/corvink/13.1/nvidia-wip
					

FreeBSD src tree (read-only mirror). Contribute to Beckhoff/freebsd-src development by creating an account on GitHub.




					github.com


----------



## ziomario (Jul 18, 2022)

So,now,could you rack your brain to come up with some good advice to help me do what I want ?  thanks.


----------



## eternal_noob (Jul 18, 2022)

I have a good advice for you: If you want help, think about your attitude.


----------



## ziomario (Jul 18, 2022)

eternal_noob said:


> I have a good advice for you: If you want help, think about your attitude.



I don't understand what this means.


----------



## eternal_noob (Jul 18, 2022)

It means: Be nice rather than a bitch.


----------



## Alexander88207 (Jul 18, 2022)

ziomario said:


> I don't understand what this means.



People have here helped you a lot in your 50-150 threads. Now someone have a question to you and you have not answered in a nice way.

Instead its something like _do you live under a rock?_


----------



## ziomario (Jul 18, 2022)

Alexander88207 said:


> People have here helped you a lot in your 50-100 threads. Now someone have a question to you and you have not answered in a nice way.
> 
> Instead its something like _do you live under a rock?_



It was intended as a playful provocation. The provocations may not like to everyone,but they are not insults or bad attitudes. I understand how much difficult is to understand the emotional tone and the meaning that the interlocutor wants to express in chat,but that's it. Please don't be always so serious.


----------



## mer (Jul 18, 2022)

eternal_noob said:


> I have a good advice for you: If you want help, think about your attitude.





ziomario said:


> I don't understand what this means.





eternal_noob said:


> It means: Be nice rather than a bitch.





Alexander88207 said:


> People have here helped you a lot in your 50-100 threads. Now someone have a question to you and you have not answered in a nice way.
> 
> Instead its something like _do you live under a rock?_


If I were a mom or a moderator, I'd say "Knock it off".  I think we are running into the limits of the medium (Internet, typing, etc).  Sorry if I'm out of line saying this, but maybe everyone take a step back, a deep breath, a sip of an adult beverage. 
I have no dog in this fight (Sorry, Americanism phrase), but poking the bear, stirring the hornets nest, not helpful.


----------



## eternal_noob (Jul 18, 2022)

Well, he asked for an advice and i gave him an advice. No harm intended.

Sometimes the best advice is one of the sociological kind.


----------



## Criosphinx (Jul 18, 2022)

Maybe an HDMI switch then? also if one of the screens has a second hdmi or dvi input you can switch between using the OSD or one of the buttons should work as input selector.


----------



## ziomario (Jul 18, 2022)

Men,It was just a joke / taunt that was not understood. In fact, I am very grateful to all of you for all the help you are giving me.


----------



## Alexander88207 (Jul 18, 2022)

mer said:


> But maybe everyone take a step back ....  a sip of an adult beverage.



I am normally also a person of peace, but this is not the first time from him.


----------



## ziomario (Jul 18, 2022)

Criosphinx said:


> Maybe an HDMI switch then? also if one of the screens has a second hdmi or dvi input you can switch between using the OSD or one of the buttons should work as input selector.



Does it allow to turn on both the monitors ?


----------



## ziomario (Jul 18, 2022)

I've installed the package nvidia-settings and I've captured some screenshots,hoping that they can be useful to understand what's wrong :


----------



## ziomario (Jul 18, 2022)

I've asked to the nvidia forum :









						How to use two screens at the same time while I'm using FreeBSD
					

Hello to everyone.  Actually I have two screens,but usually I use only one of them. The screen I use everyday with FreeBSD is attached to the HDMI port of the “VGA compatible controller: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630] (rev 02)” graphic chipset. And it works well...




					forums.developer.nvidia.com


----------



## tyson (Jul 18, 2022)

Third page of this ridiculous thread and nobody asked if he has more than one output on his motherboard. If yes, and your second monitor isn’t cheapest crap with one input just use that second intel output be it displayport/dvi/crt.
Ziomario you would save everybody’s time by starting some it school.


----------



## ziomario (Jul 19, 2022)

Sorry,I didn't understand what you mean with "more than one output on his motherboard" ; at school I've chosen another area,not the it,I'm sorry. But anyway,I like the it. My second monitor is very old.


----------



## tyson (Jul 19, 2022)

ziomario said:


> Sorry,I didn't understand what you mean with "more than one output on his motherboard" ; at school I've chosen another area,not the it,I'm sorry. But anyway,I like the it. My second monitor is very old.


That’s why you waste everybody’s time here not having basic technical knowledge even how you pc is built. For example my motherboard can use Intel cpu with graphics chip built in, and I have HDMI, Displayport and D-sub outputs on motherboard(to use with that intel cpu built in graphics). If I want to solve your “problem”, I would just connect two monitors to my motherboard. Second monitor is connect with other cable to nvidia card so by switching inputs on that one I could use it as designated VM monitor.
No need to configure anything except some xrandr one liner for proper screen placement on intel gpu (which is easily found by googling or DuckDuckGo)


----------



## ziomario (Jul 19, 2022)

My HDMI,Displayport and D-sub are located only on the Nvidia gpu slots. And the intel gpu has only an HDMI port. My "problem" is a problem and it will not become a "problem" only because you think you had a stroke of genius. Can you try not to be so aggressive and less respectful with the users who wants to learn ? Is really so important to know a lot of things ? Or is even important to have the right curiosity and to ask for more details ?


----------



## tyson (Jul 19, 2022)

I don’t mind you want to learn things but before you start asking lots of stupid questions do at least some research yourself first, and don’t ask for solution if you don’t describe what you want to achieve in first place.


----------



## tanis (Jul 19, 2022)

From my experience Xorg should do the heavy lifting these days by itself, meaning Xorg should detect all supported cards and screens by it self, so there is no single xorg.conf needed as back in the days. There is actually a very good guide here in the forum: HOWTO: Setup Xorg with NVIDIA's driver .

I would start with that guide and go from there.

My workstation: 2x 24" IPS ilyama screens connected to a docking station on top a Lenovo x270 Gen 1 and FreeBSD 12.3-p5 (started with FreeBSD 10.x if I remember correctly). This has been running in that configuration since 2018 (24/7 365) and I experienced no issues at all.


----------



## ziomario (Jul 19, 2022)

I've found the reason why it does not work and I've been able to make it work,at least,partially. The problem of the black screen arises because I'm using xfce4. It misses some components inside the code and it can't replicate on the monitor 2 what is displayed on the monitor 1. I've installed mate and it happened the same. So,I've got the idea. I've chosen KDE Plasma as DM and boom. It has been able to display on the monitor 2 the content of the monitor 1. Unfortunately the magic did not last too long. KDE crashed many times and at the end I've seen again the black screen on the monitor 2. So,what I want to do can be done,but only KDE is partially able to do it. If KDE does it partially,do you know another DM that can do it better ? Below you can see what's the KDE component that crashed multiple times.


----------



## ziomario (Jul 19, 2022)

tanis said:


> From my experience Xorg should do the heavy lifting these days by itself, meaning Xorg should detect all supported cards and screens by it self, so there is no single xorg.conf needed as back in the days. There is actually a very good guide here in the forum: HOWTO: Setup Xorg with NVIDIA's driver .
> 
> I would start with that guide and go from there.
> 
> My workstation: 2x 24" IPS ilyama screens connected to a docking station on top a Lenovo x270 Gen 1 and FreeBSD 12.3-p5 (started with FreeBSD 10.x if I remember correctly). This has been running in that configuration since 2018 (24/7 365) and I experienced no issues at all.



which desktop manager are you using ?


----------



## Logicien (Jul 19, 2022)

Hello,

I use two screens even three I am on FreeBSD now who manage my main screen. Via the vnc protocole it display the desktop on an other screen on a second computer with ArchLinux for amd64 and on Odroid (Xu4) armv7l with ArchLinuxarm. This screen have two usable connectors an Hdmi and ad Dvi one.

I think you want two screens on the same computer what I have not explore a lot. I can say that TigerVnc do a really good job as server as well than client. The best is an Ethernet cable link but wifi is not  bad.


----------



## ziomario (Jul 19, 2022)

I want two screens on the same computer and attached to two different gpus.


----------



## ziomario (Jul 20, 2022)

SirDice said:


> Not sure if the NVidia driver will actually work in combination with other video cards. The NVidia driver uses a couple of modified Xorg libraries, those probably conflict with the AMD/Intel driver that uses the original Xorg libraries.



*Wayland* can fix this problem ? *Wayland* works great on FreeBSD at this time ? OR : some time ago I've bought another nvidia gpu,the geforce 1060 and inside the tower of my PC there is the space to mount it. Can it,in some way,help me to achieve the goal ? It has 5 ports : 2 HDMI ports,1 DVI,2 DisplayPorts...maybe it works attaching both the monitors to the two HDMI ports of the 1060....


----------



## Alexander88207 (Jul 20, 2022)

mer said:


> That is a good point SirDice.  I'm hoping that if there is a conflict the packages/ports would be marked with CONFLICT so you can't shoot yourself in the foot.



Its not needed because NVIDIA xorg libs dont confilct with the normal ones.

They do have all -nvida or _nvidia at the end and both (mesa and nvidia) are using graphics/libglvnd.


----------



## ziomario (Jul 20, 2022)

Alexander88207 said:


> Its not needed because NVIDIA xorg libs dont confilct with the normal ones.
> 
> They do have all -nvida or _nvidia at the end and both (mesa and nvidia) are using graphics/libglvnd.



So,it seems that in your opinion the NVidia driver libs does not conflict with the AMD/Intel driver that uses the original Xorg libraries. If it is true,what's the problem that's preventing me to use my two monitors with my two gpus ? My suspect may be good : the problem is inside the xfce or mate code that can't display the content on the monitor 2. Kde seems to be able,but then it crashes. Maybe Wayland can fix the problem.


----------



## VladiBG (Jul 20, 2022)

MultiMonitorDesktop


----------



## tanis (Jul 20, 2022)

ziomario said:


> which desktop manager are you using ?


XFCE latest binary package available.

There is basically two ways to have multiple screens:

A) Each screen got it’s own Xserver. If u want to display a window, the environment variable DISPLAY needs to be properly set:


```
export DISPLAY=:0.0 #localhost 1st screen
export DISPLAY=:1.0 #localhost 2nd screen
```

and so on.

B) Xinerama (first introduced by Nvidia, please correct me if i’m wrong) This allows u to stretch X across multiple screens and move your windows freely around without being concerned about which DISPLAY needs to be set.

From what u mentioned, that your 2nd screen keeps being black or blank as I would put it. My guess would be u, especially with two different GPUs, that u r stuck with A) . Back in the days a lot of programs got by default a menu point screen, where u could enter on which screen the window should appear. These days, perhaps of Xinerama, almost all programs lack that feature. Back then this has also been used to remote display windows without the need of VNC. XForward is the feature, wayland doesn’t support that because people think it’s not needed.  A common work setup has been a bunch of different number crunchers and all the windows got forwarded to a single machine which acted as a presenter, but the heavy CPU lifting had been done on a number cruncher in a data center somewhere of the other side of the planet. Perhaps I’m the only one who still works that way.  Sorry for rambling.


----------



## ziomario (Jul 20, 2022)

Interesting. So,maybe the configuration that I could try is the following :


```
Section "ServerLayout"
    Identifier  "Layout0"
    Option      "Xinerama" "on"
    Option      "Clone"    "off"
    # You would need one screen for each monitor
    Screen   0  "Screen0"
    Screen   1  "Screen1"  RightOf "Screen0"
  EndSection
  
Section "Files"
    ModulePath   "/usr/local/lib/xorg/modules"
    FontPath     "/usr/local/share/fonts/misc/"
    FontPath     "/usr/local/share/fonts/TTF/"
    FontPath     "/usr/local/share/fonts/OTF/"
    FontPath     "/usr/local/share/fonts/Type1/"
    FontPath     "/usr/local/share/fonts/100dpi/"
    FontPath     "/usr/local/share/fonts/75dpi/"
    FontPath     "catalogue:/usr/local/etc/X11/fontpath.d"
EndSection

Section "Module"
    Load  "glx"
    Load  "glxserver_nvidia"
EndSection

Section "InputDevice"
    Identifier  "Keyboard0"
    Driver      "kbd"
EndSection

Section "InputDevice"
    Identifier  "Mouse0"
    Driver      "mouse"
    Option        "Protocol" "auto"
    Option        "Device" "/dev/sysmouse"
    Option        "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
    Identifier   "Monitor0"
    VendorName   "Monitor Vendor"
    ModelName    "Monitor Model"
EndSection

Section "Monitor"
    Identifier   "Monitor1"
    VendorName   "Monitor Vendor"
    ModelName    "Monitor Model"
EndSection

Section "Device"
    Identifier  "Device0"
    Driver      "intel"
    # Actual PCI location of first card/gpu
    BusID       "PCI:0:2:0"
    # Actual connector - as reported by /sys/class/drm/card0-xx (except HDMI, which is HDMI-x instead of HDMI-A-x)
    Option      "ZaphodHeads" "HDMI-1"
    # Screen number for that PCI device, i.e. 0, 1, etc.
    Screen      0
EndSection

Section "Device"
    Identifier  "Device1"
    Driver      "nvidia"
    # Actual PCI location of first card/gpu
    BusID       "PCI:2:0:0"
    # Actual connector - as reported by /sys/class/drm/card0-xx (except HDMI, which is HDMI-x instead of HDMI-A-x)
    Option      "ZaphodHeads" "HDMI-2"
    # Screen number for that PCI device, i.e. 0, 1, etc.
    Screen      1
EndSection

Section "Screen"
    Identifier "Screen0"
    Device     "Card0"
    Monitor    "Monitor0"
    SubSection "Display"
        Viewport   0 0
        Depth     1
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     4
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     8
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     15
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     16
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection

Section "Screen"
    Identifier "Screen1"
    Device     "Card1"
    Monitor    "Monitor1"
    SubSection "Display"
        Viewport   0 0
        Depth     1
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     4
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     8
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     15
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     16
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection
```


----------



## ziomario (Jul 20, 2022)

I tried. It didn't work. The result is even worst than before,because now I don't see the mouse pointer goes across the black screen anymore.


----------



## ziomario (Jul 20, 2022)

tanis said:


> XFCE latest binary package available.
> 
> There is basically two ways to have multiple screens:
> 
> ...



Is this correct ? because it seems to me that the value of DISPLAY is repeated,so since there is one only variable,it always assumes the value 1.0. Don't forget that I have two screens,so there should be at least two variables called DISPLAY1 and DISPLAY2 ? Here the problem could be that I can't open a terminal on the monitor 2,so I can't set the DISPLAY value to 1.0 there.


----------



## elgrande (Jul 20, 2022)




----------



## ziomario (Jul 20, 2022)

elgrande said:


>



Sorry,I don't understand what you mean. A clear communication is always the best choice. I understand what means the image,but I don't understand what you want to mean. You know,it isn't the same thing,the signified and the signifier.


----------



## tanis (Jul 20, 2022)

ziomario said:


> Is this correct ? because it seems to me that the value of DISPLAY is repeated,so since there is one only variable,it always assumes the value 1.0. Don't forget that I have two screens,so there should be at least two variables called DISPLAY1 and DISPLAY2 ? Here the problem could be that I can't open a terminal on the monitor 2,so I can't set the DISPLAY value to 1.0 there.




```
export DISPLAY=:1.0
xterm & # should appear on the 2nd screen
```

DISPLAY is controlling which “Display” is the active one. As long as DISPLAY is set to 0 windows will appear there. 

Like already mentioned, these days Xorg tries to auto-configure, that’s why my first approach would be to get rid of all configuration, install the nvidia driver and the intel driver connect one screen to each card, reboot the system, make sure screens are powered up and then see what’s happening, Xorg.log would be interesting as well. One of your two cards will take the lead. That’s the one I would configure as primary, when I got that I would add the second card. After that is working I would check out if Xinerama is working. 

If I want to know what Xorg and it’s auto-configure came up with, I would do:



```
X -configure
```

The config should can be found here : /root/xorg.conf

Just for clarification and to rule out any misunderstanding, setting DISPLAY to 0.0 refers to the first running 1stXorg.1stScreen. So 1.0 is the 2ndXorg.1stScreen

 For example I got two Xorgs running on two virtual terminals so I can be logged in with two different users at the same time, switching between users by pressing ctrl + alt + f9 and f10. Yes, both Xorg use both two 24” screens. Call me old fashioned but I like business and private stuff separated.


----------



## tyson (Jul 20, 2022)

I spend and hour of two to test whatever I could run in 13.1 Release.
Two graphics cards: amdgpu and intel.
I couldn't get anything except *two separate screens* (so, u have to run 'two' window managers - tried with openbox and It was working fine),
or *Xinerama* - tried that with openbox and KDE, but couldn't really configure anything in KDE as randr is disabled because of xinerama.
Ziomario I will now write slow so u can read it whole.

What I have added to /etc/rc.conf:

```
kld_list="amdgpu i915kms"
```
without that I couldn't even get text console on intel gpu (even if it was set as boot card in bios).

now the  /usr/local/etc/X11/xorg.conf.d/xorg.conf:

```
Section "ServerLayout"
        Identifier "layout"
        Screen 0 "intel"
        Screen 1 "amdgpu"
#       Screen "amdgpu" LeftOf "intel"
#Option "Xinerama" "1"
EndSection

Section "Device"
        Identifier "amdgpu"
        Driver "amdgpu"
        BusID "3@0:0:0" #replace with information from lspci -v
EndSection

Section "Screen"
        Identifier "amdgpu"
        Device "amdgpu"
        Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
        Identifier "intel"
        BusID   "0@0:2:0" #same as above lspci -v
        Driver "intel"
EndSection

Section "Screen"
        Identifier "intel"
        Device "intel"
EndSection
```

Just by uncommenting Xinerama line you can get both screens acting like one desktop, but with limitations like no acceleration, no randr etc.
You can try to replace amdgpu with nvidia, and it could possibly work the same.
I was just using search site, and some linux howto's. I can bet this config could be even simpler and had working without forcing xinerama but require linux.

This topic isn't really FreeBSD specific, and there is lots of Linux howto's on how to setup multihead multimonitor Xorg on the internets.

PS. if you want to run for example double window managers on separate screens, just do in your .xinitrc:

```
DISPLAY=:0.0 exec openbox-session &
DISPLAY=:0.1 exec openbox-session
```
Nothing really amazing but at least you can start from here and customise this to your liking.


----------



## Mitchera (Jul 21, 2022)

ziomario said:


> Hello to everyone.
> 
> Actually I have two screens,but usually I use only one of them. The screen I use everyday with FreeBSD is attached to the HDMI port of the "*VGA compatible controller: Intel Corporation CoffeeLake-S GT2 [UHD Graphics 630] (rev 02)*" graphic chipset. And it works well. Sometimes,when I want to virtualize Linux,I attach the second screen to the HDMI port of the second GPU I have,the *Nvidia Geforce RTX 2080 ti* and in this way I can use even the second screen. But,what about to use it without to boot another OS ? This idea came to my mind from some time and I would like to gather some suggestions to understand how can I do this. I find very useful to drag and drop, with a proper tool, files and folders from the screen 1 to the screen 2,like I do in Windows and Linux. But I have no idea about how to do it in FreeBSD. It could be useful even when I want to make some 3d modelling using Blender on the first screen and using the second screen to watch some tutorial. Can someone give me some suggestions about some method,tecnique and tools to achieve this goal ? very thanks.



I have never had this problem. I own a intel  i7 3770k rig. I install the appropriate drivers and it works quite fine.

Now I do come to understand that you are using two gpus. why not just use the Nvidia one for freebsd. here are the details in this video by robbonuggie  should help you with any driver problem you may be having




_View: https://www.youtube.com/watch?v=XjPha2bWvxs_


----------



## ziomario (Jul 21, 2022)

tyson : let's make a recap. I tried your configuration. This is how I have adapted it in my specific situation :


```
/etc/rc.conf :

kld_list="nvidia-modeset i915kms"

/boot/loader.conf :

nvidia_load="YES"

/etc/X11/xorg.conf :

Section "ServerLayout"
        Identifier "layout"
        Screen 0 "intel"
        Screen 1 "nvidia"
#     Screen "nvidia" RightOf "intel"
#     Option "Xinerama" "1"
EndSection

Section "Device"
        Identifier "nvidia"
        Driver "nvidia"
        BusID "1:0:0" #replace with information from pciconf -vl
EndSection

Section "Screen"
        Identifier "nvidia"
        Device "nvidia"
        Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
        Identifier "intel"
        BusID   "0:2:0" #same as above pciconf -vl
        Driver "intel"
EndSection

Section "Screen"
        Identifier "intel"
        Device "intel"
EndSection
```

this is the error that prevents Xorg from working correctly :


----------



## elgrande (Jul 21, 2022)

A good start would be to actually read what people tell you.
You were told about 5 times NOT to use /etc/X11/xorg.conf, since this is not the way to do this anymore since many years, anyhow you are still doing this.


----------



## ziomario (Jul 21, 2022)

elgrande said:


> A good start would be to actually read what people tell you.
> You were told about 5 times NOT to use /etc/X11/xorg.conf, since this is not the way to do this anymore since many years, anyhow you are still doing this.


----------



## elgrande (Jul 21, 2022)

ziomario said:


> View attachment 14442



What should I say? You literally highlighted a file that is NOT /etc/X11/xorg.conf.


----------



## ziomario (Jul 21, 2022)

what's the difference ? I've always thought that even if the location where is stored xorg.conf changes,the final result is the same. And I had confirmations that's so.


----------



## elgrande (Jul 21, 2022)

No it is not the same.

/etc/X11/xorg.conf is for a full config.
/usr/local/etc/X11/xorg.conf.d/*.conf is for small (delta) config files to add to what has been auto discovered.

I would not exclude the possibility that partial configs in /etc/X11 somehow work, but obviously you have problems and maybe you want to stick to the correct way of doing it.


----------



## tanis (Jul 21, 2022)

elgrande said:


> No it is not the same.
> 
> /etc/X11/xorg.conf is for a full config.
> /usr/local/etc/X11/xorg.conf.d/*.conf is for small (delta) config files to add to what has been auto discovered.
> ...


I concur, back in the days, xorg.conf  had been the way to go. Since the introduction of auto-configure, the preferred way is to let Xorg get it’s way and add your “preferences” to xorg.conf.d, which in my case are some fonts and my keyboard layout. I got nothing in there regarding my two screens and xinerama, as Xorg figure’s it all out by itself. That’s why I can’t post any configuration except for my keyboard layout.


----------



## tyson (Jul 21, 2022)

tanis said:


> I concur, back in the days, xorg.conf  had been the way to go. Since the introduction of auto-configure, the preferred way is to let Xorg get it’s way and add your “preferences” to xorg.conf.d, which in my case are some fonts and my keyboard layout. I got nothing in there regarding my two screens and xinerama, as Xorg figure’s it all out by itself. That’s why I can’t post any configuration except for my keyboard layout.


Xinerama is not the default behaviour, now it’s randr. But on edge cases like different gpus auto configuration can fail. That’s why I couldn’t get my amdgpu  and intel to work with xrandr. But then u can put some mania config like enabling Xinerama.


----------



## ziomario (Jul 21, 2022)

ok. I've moved the file xorg.conf from /etc/X11/ to /usr/local/etc/X11/xorg.conf.d ;

the bug is gone,but the mouse pointer can't go across the black screen. Arandr detects only the HDMI-1 screen,the screen attached to the intel gpu.


----------



## tanis (Jul 21, 2022)

Just for the fun of it, move your xorg.conf to somewhere else so Xorg is not bothered with it and put the following two files in: /usr/local/etc/X11/xorg.conf.d

After that restart your Xserver or reboot the whole system.


```
# /usr/local/etc/X11/xorg.conf.d/40-card0-intel.conf
# Intel gpu
Section "Device"
        Identifier "Card0"
        Option "DPMS"
        Driver "modesetting"
        BusID "PCI:0:2:0"
EndSection
```



```
# /usr/local/etc/X11/xorg.conf.d/40-card1-nvidia.conf
# Nvidia gpu
Section "Device"
        Identifier "Card1"
        Option "DPMS"
        Driver "nvidia-modesetting"
        BusID "PCI:1:0:0"
EndSection
```

Perhaps u can post the output of the following as well:

```
pciconf -l -v | grep -A 4 vgapci
```


----------



## ziomario (Jul 21, 2022)

tanis said:


> Just for the fun of it, move your xorg.conf to somewhere else so Xorg is not bothered with it and put the following two files in: /usr/local/etc/X11/xorg.conf.d
> 
> After that restart your Xserver or reboot the whole system.
> 
> ...




```
vgapci2@pci0:0:2:0:     class=0x030000 rev=0x02 hdr=0x00 vendor=0x8086 device=0x3e98 subvendor=0x145
8 subdevice=0xd000
vendor     = 'Intel Corporation'
device     = 'CoffeeLake-S GT2 [UHD Graphics 630]'
class      = display
subclass   = VGA
--
vgapci0@pci0:1:0:0:     class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1e04 subvendor=0x19d
a subdevice=0x2503
vendor     = 'NVIDIA Corporation'
device     = 'TU102 [GeForce RTX 2080 Ti]'
class      = display
subclass   = VGA
--
vgapci1@pci0:2:0:0:     class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1c02 subvendor=0x19d
a subdevice=0x2438
vendor     = 'NVIDIA Corporation'
device     = 'GP106 [GeForce GTX 1060 3GB]'
class      = display
subclass   = VGA
```


----------



## ziomario (Jul 21, 2022)

tanis said:


> Just for the fun of it, move your xorg.conf to somewhere else so Xorg is not bothered with it and put the following two files in: /usr/local/etc/X11/xorg.conf.d
> 
> After that restart your Xserver or reboot the whole system.
> 
> ...



nothing special with this configuration. Xorg started without problems,but my monitor is still black and dead,no mouse cursor accross it.


----------



## elgrande (Jul 21, 2022)

Maybe an easier solution.
Since you need to restart Xorg anyhow, if you want to switch your Nvidia Card to bhyve passthrough, why not go the easy way?
Have one Xorg config for Intel (in case you only use one screen).
Have another Xorg config only using Nvidia and then use 2 screens at the Nvidia card.


----------



## rsronin (Jul 21, 2022)

ziomario said:


> Xorg started without problems,but my monitor is still black and dead,no mouse cursor accross it.


How about cables and power saving settings of the monitor? I used to have a surface pro 2 with a dock and often the signal to the monitor got lost and had to restart (both on windows and linux).


----------



## tanis (Jul 21, 2022)

ziomario said:


> ziomario said:
> 
> 
> > nothing special with this configuration. Xorg started without problems,but my monitor is still black and dead,no mouse cursor accross it.
> ...


Can u provide /var/log/Xorg.0.log for that configuration so we can see whats going on?
Which screen and therefor which gpu keeps being blank?


----------



## ziomario (Jul 21, 2022)

tanis said:


> elgrande said:
> 
> 
> > Maybe an easier solution.
> ...



and this is where the donkey falls. In your opinion was it worth the effort to make this strange setup work correctly if I had to reboot to enable the passthru? No, I don't have to reboot. There is a method to enabled it on the fly. I consider the killing of Xorg a minor waste of time.


----------



## eternal_noob (Jul 21, 2022)

Just for fun (and being future proof), you could try a modern display server like Wayland. Xorg is old and dusty.


----------



## elgrande (Jul 21, 2022)

ziomario said:


> and this is where the donkey falls. In your opinion was it worth the effort to make this strange setup work correctly if I had to reboot to enable the passthru? No, I don't have to reboot. There is a method to enabled it on the fly. I consider the killing of Xorg a minor waste of time.


who said you would need to reboot? I ensure your your problem would be solved long ago if you bothered to actually read what people write.


----------



## ziomario (Jul 21, 2022)

I really don't understand you. I've always tried every suggestion that you gave to me.


----------



## elgrande (Jul 21, 2022)

You should try to understand things.
We now have an Xorg that autodetects devices and a xorg.conf.d directory to overwrite parts of the auto detection.
You received an example with 2 files for the 2 cards for xorg.conf.d.
That is a defined state. Try to understand what is happening and provide /var/log/Xorg.0.log so we can see what happens.
Keep the defined state. Do not try 100 things mixing all stuff you google somewhere.
If you figured out what is missing, change 1(!) thing. See what happens.
I know you are no software developer or similar.
But you are trying kinda complex things and it will help you to gather some good methodology and being understanding the things you are playing with.


----------



## ziomario (Jul 21, 2022)

eternal_noob said:


> Just for fun (and being future proof), you could try a modern display server like Wayland. Xorg is old and dusty.



I've already asked on reddit. I'm looking for a good tutorial that explain in a synthetic way how to install it,because on internet I've found only chaotic informations,but to be honest I didn't find a good tutorial,yet.






						r/freebsd - How much good is Wayland with KDE Plasma on FreeBSD 13.1-RELEASE ?
					

16 votes and 16 comments so far on Reddit




					www.reddit.com


----------



## ziomario (Jul 21, 2022)

elgrande said:


> You should try to understand things.
> We now have an Xorg that autodetects devices and a xorg.conf.d directory to overwrite parts of the auto detection.
> You received an example with 2 files for the 2 cards for xorg.conf.d.
> That is a defined state. Try to understand what is happening and provide /var/log/Xorg.0.log so we can see what happens.
> ...



thanks. yeah,I'm gonna post the log file of xorg. And yes,I've got some suggestions on this website :









						How to use two gpus (intel and nvidia) attached to two monitors on FreeBSD
					

Hello to everyone. Actually I have two monitors,but usually I use only one of them. The monitor I use everyday with FreeBSD is attached to the HDMI port of...




					www.unitedbsd.com
				




and I've tried. Where is the problem ? You don't know my story,so you can't know how much valid is my method of work. But I can assure you that,despite my ignorance, I have always been able to complete my projects. And one of the reason probably is because my working method is not so bad.


----------



## elgrande (Jul 21, 2022)

however...


----------



## ziomario (Jul 21, 2022)

rsronin said:


> How about cables and power saving settings of the monitor? I used to have a surface pro 2 with a dock and often the signal to the monitor got lost and had to restart (both on windows and linux).



nope because I'd found a configuration with which it seemed to work partially,since my mouse was able to go across the black screen. So,the monitor was working.


----------



## ziomario (Jul 21, 2022)

ok,let's  make a recap. I've created these files :


```
# /usr/local/etc/X11/xorg.conf.d/40-card0-intel.conf

# Intel gpu
Section "Device"
Identifier "Card0"
Option "DPMS"
Driver "modesetting"
BusID "PCI:0:2:0"
EndSection

# /usr/local/etc/X11/xorg.conf.d/40-card1-nvidia.conf

# Nvidia gpu
Section "Device"
Identifier "Card1"
Option "DPMS"
Driver "nvidia-modesetting"
BusID "PCI:2:0:0"
EndSection
```

I would like to know what to put inside /etc/rc.conf and inside /boot/loader.conf,thanks.


```
pciconf -vl

vgapci2@pci0:0:2:0:     class=0x030000 rev=0x02 hdr=0x00 vendor=0x8086 device=0x3e98 subvendor=0x1458 subdevice=0xd000
    vendor     = 'Intel Corporation'
    device     = 'CoffeeLake-S GT2 [UHD Graphics 630]'
    class      = display
    subclass   = VGA

vgapci0@pci0:1:0:0:     class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1e04 subvendor=0x19da subdevice=0x2503
vendor     = 'NVIDIA Corporation'
device     = 'TU102 [GeForce RTX 2080 Ti]'
class      = display
subclass   = VGA

vgapci1@pci0:2:0:0:     class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1c02 subvendor=0x19da subdevice=0x2438
    vendor     = 'NVIDIA Corporation'
    device     = 'GP106 [GeForce GTX 1060 3GB]'
    class      = display
    subclass   = VGA
```

the HDMI cables are attached to the HDMI port of the Intel gpu (0:2:0) and on the HDMI port of the Geforce 1060 (2:0:0).

Don't know if it is correct,but I have :


```
/etc/rc.conf

kld_list="nvidia-modeset i915kms"

/boot/loader.conf :

nvidia_load="YES"
```

that's all.


----------



## eternal_noob (Jul 21, 2022)

ziomario said:


> I would like to know what to put inside /etc/rc.conf and inside /boot/loader.conf,thanks.


Whatever you do, don't put stuff in /boot/loader.conf which isn't absolutely neccessary for booting. If you're unlucky, your system won't boot anymore.


----------



## ziomario (Jul 21, 2022)

Is this correct ?


```
/etc/rc.conf

kld_list="nvidia-modeset i915kms"
```


----------



## elgrande (Jul 21, 2022)

Looks all good so far at a first glance. please post the output of 
	
	



```
kldstat
```
 and the contents of /var/log/Xorg.0.log with that config.
I am off for today now.


----------



## tanis (Jul 21, 2022)

ziomario said:


> Is this correct ?
> 
> 
> ```
> ...



Just one is needed either rc.conf or loader.conf. I actually prefer using loader.conf for loading kernel modules to keep that stuff separate. Also the Xorg driver is named nvidia-modesetting but the kernel module is just named nvidia.


```
# adds nvidia kernel modul to the list of modules when booting up
 sysrc kld_list+="nvidia"
```

 OR:


```
# /boot/loader.conf

nvidia_load="YES"
```

Please check after booting up your system if the module has been loaded by:


```
kldstat | grep nvidia
dmesg | grep -B 2 -A 3 nvidia
```

Please post the content of /var/log/Xorg.0.log .


----------



## ziomario (Jul 21, 2022)

Ubuntu Pastebin
					






					pastebin.ubuntu.com


----------



## ziomario (Jul 21, 2022)

```
# kldstat | grep nvidia
21    1 0xffffffff83400000  2354ab8 nvidia.ko

# dmesg | grep -B 2 -A 3 nvidia

VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID
TSC: P-state invariant, performance statistics
nvidia0: <NVIDIA GeForce RTX 2080 Ti> on vgapci0
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: child nvidia0 requested pci_enable_io
nvidia1: <NVIDIA GeForce GTX 1060 3GB> on vgapci1
vgapci1: child nvidia1 requested pci_enable_io
vgapci1: child nvidia1 requested pci_enable_io
pchtherm0: <CannonLake-H Thermal Subsystem> mem 0x4001119000-0x4001119fff irq 16 at device 18.0 on pci0
ichsmb0: <Intel Cannon Lake SMBus controller> port 0xefa0-0xefbf mem 0x4001116000-0x40011160ff irq 16 at device 31.4 on pci0
smbus0: <System Management Bus> on ichsmb0
```


----------



## tanis (Jul 21, 2022)

ziomario said:


> ziomario said:
> 
> 
> > Ubuntu Pastebin
> ...


Thx.

Can you please change the file 40-card1-nvidia.conf to:


```
# /usr/local/etc/X11/xorg.conf.d/40-card1-nvidia.conf
# Nvidia gpu
Section "Device"
        Identifier "Card1"
        Option "DPMS"
        Driver "nvidia"
        BusID "PCI:2:0:0"
EndSection
```

Please restart the Xorg or reboot whatever suits you, and please post the content of /var/log/Xorg.0.log again.


----------



## tyson (Jul 21, 2022)

ziomario said:


> ok,let's  make a recap. I've created these files :
> 
> 
> ```
> ...


This guy...
Now you telling us its more than one nvidia gpu.
Anything stopping you from using only 1060 for X, or this is also going to be passthrough to bhyve ?


----------



## ziomario (Jul 21, 2022)

tyson said:


> This guy...
> Now you telling us its more than one nvidia gpu.
> Anything stopping you from using only 1060 for X, or this is also going to be passthrough to bhyve ?



This guy added another nvidia gpu later to make some experiments,thinking that it made no difference. If it makes some difference,I will pay you a coffee. The gpu to pass thru is for sure the 2080 ti. I've added the 1060 to make the lastest test when the previous tests will fail. The idea is to attach both the monitors to the 1060 and to leave the 2080 ti for the passthru. But not now.


----------



## tanis (Jul 21, 2022)

Can you please also run the following command:


```
pkg info | grep drm
ls /usr/local/lib/xorg/modules/drivers/
```

It looks like there is an issue with the intel-drm package (perhaps the module has been renamed, I'm still on 12.3)?


----------



## tyson (Jul 21, 2022)

ziomario said:


> This guy added another nvidia gpu later to make some experiments,thinking that it made no difference. If it makes some difference,I will pay you a coffee. The gpu to pass thru is for sure the 2080 ti. I've added the 1060 to make the lastest test when the previous tests will fail. The idea is to attach both the monitors to the 1060 and to leave the 2080 ti for the passthru. But not now.


remove any X configs, and just use whatever tanis posted in  #110      
For ideal setup you could maybe do some magic with nvidia-xconfig, but 1060 it should work with any monitors you connect instantly.


----------



## ziomario (Jul 21, 2022)

tanis said:


> Thx.
> 
> Can you please change the file 40-card1-nvidia.conf to:
> 
> ...





			https://pastebin.ubuntu.com/p/Vs6dWRm36w/


----------



## ziomario (Jul 21, 2022)

Is this a bug ????


```
[    84.768] (EE) open /dev/dri/card0: No such file or directory
[    84.768] (WW) Falling back to old probe method for modesetting
[    84.768] (EE) open /dev/dri/card0: No such file or directory
```


----------



## ziomario (Jul 21, 2022)

tanis said:


> Can you please also run the following command:
> 
> 
> ```
> ...




```
@marietto:/home/marietto # pkg info | grep drm


drm-fbsd13-kmod-5.4.191.g20220604_1 DRM modules for the linuxkpi-based KMS components
drm-kmod-20220501              Metaport of DRM modules for the linuxkpi-based KMS components
gpu-firmware-kmod-20220511,1   Firmware modules for the drm-kmod drivers
libdrm-2.4.111,1               Userspace interface to kernel Direct Rendering Module services


@marietto:/home/marietto # ls /usr/local/lib/xorg/modules/drivers/


intel_drv.so            nvidia_drv.so           vesa_drv.so             xrdpdev_drv.a
modesetting_drv.so scfb_drv.so vmware_drv.so xrdpdev_drv.so
```


----------



## tanis (Jul 22, 2022)

ziomario said:


> Is this a bug ????
> 
> 
> ```
> ...


Nope, that just means that /dev/dri/card0 is not existing, the reason we don't know at this stage.

Can you please post the output of the following commands:

```
# prints, if your intel gpu has been proper detected by the kernel module
dmesg | grep drm
# prints gpu device handler have been created
ls -l /dev/dri
# prints the packages the fils belong to
pkg which /usr/local/lib/xorg/modules/drivers/modesetting_drv.so
pkg which /usr/local/lib/xorg/modules/drivers/intel_drv.so
# prints all installed packages which contain the word video
pkg info | grep video
# prints who is part of the video group
getent group video
```

Please change the file /usr/local/etc/X11/xorg.conf.d/40-card0-intel.conf to:

```
# /usr/local/etc/X11/xorg.conf.d/40-card0-intel.conf
# Intel gpu
Section "Device"
        Identifier "Card0"
        Option "DPMS"
        Driver "intel"
        BusID "PCI:0:2:0"
EndSection
```
Please restart Xorg or reboot your system, and can you please post the /var/log/Xorg.0.log afterwards again.

Whats happning so far according to the Xorg.0.log is:
- Xorg detects multiple gpu cards for primary and goes with the first one on the PCI bus which is your intel card
- Xorg loads the module modesetting tries to access the intel gpu /dev/dri/card0 and fails, because there is no such   
   file

What we did so far:
- it seems there is no nvidia-modesetting module anymore, we switch to the nvidia module:

```
/usr/local/lib/xorg/modules/drivers/nvidia_drv.so
```

As I already mentioned I'm still on 12.3-p5, so I don't know about the changes which have been made to 13, but if you provide all the requested information from that post, we should get a pretty good picture what the actual issue is and go further from there.


----------



## elgrande (Jul 22, 2022)

So one of the main issues is definitely the missing module nvidia-modeset.
It still exists and you *definitely* need it in the latest nvidia driver releases.

Can you please post the output of the following commands:

```
pkg info | grep nvidia
```
and

```
kldload nvidia-modeset
```


----------



## ziomario (Jul 22, 2022)

tanis said:


> Just one is needed either rc.conf or loader.conf. I actually prefer using loader.conf for loading kernel modules to keep that stuff separate. Also the Xorg driver is named nvidia-modesetting but the kernel module is just named nvidia.
> 
> 
> ```
> ...



So,to add nvidia is partially wrong ? maybe it should be :


```
sysrc kld_list+="nvidia nvidia-modeset"
```

?


----------



## elgrande (Jul 22, 2022)

yes, the last one is right, you need nvidia-modeset.


----------



## wolffnx (Jul 22, 2022)

my 2 cents, I dont need to load any module at boot or parameter in rc.conf
Install the driver for nvidia from ports, and then the port of intel driver graphics/drm-fbsd13-kmod
and for the last the x11 driver 
	
	



```
xf86-video-intel
```

but more important is the option in the bios (without this wont work,at least for me)






The IGD Multi-Monitor option

one question, for what do you want use the nvidia and intel together? when you can use 2 independent Nvidia monitors?
you can do it more dificult or simple and functional just like FBSD do


----------



## freezr (Jul 22, 2022)

What is the point to use two separate cards for each monitor when the Nvidia one can handle up to four monitors (if not more)?


----------



## ziomario (Jul 22, 2022)

wolffnx said:


> my 2 cents, I dont need to load any module at boot or parameter in rc.conf
> Install the driver for nvidia from ports, and then the port of intel driver graphics/drm-fbsd13-kmod
> and for the last the x11 driver
> 
> ...



I don't have the IGD Multi-monitor option. I can only choose with which gpu start the PC. And for the moment I choose the intel gpu,because I want to keep the intel as primary and I want the second monitor attached to the HDMI cable of the nvidia GPU.


----------



## ziomario (Jul 22, 2022)

wolffnx said:


> my 2 cents, I dont need to load any module at boot or parameter in rc.conf
> Install the driver for nvidia from ports, and then the port of intel driver graphics/drm-fbsd13-kmod
> and for the last the x11 driver
> 
> ...



I've explained the reason in any of the latest messages. You can read it. That old message is not too far from here.


----------



## ziomario (Jul 22, 2022)

Let's recap ?  :


```
/etc/rc.conf :


kld_list="nvidia nvidia-modeset"


/boot/loader.conf


nothing related to the gpu


/etc/X11/


no conf files.


/usr/local/etc/X11/xorg.conf.d/gedit 40-card0-intel.conf


# Intel gpu

Section "Device"

        Identifier "Card0"

        Option "DPMS"

        Driver "intel"

        BusID "PCI:0:2:0"

EndSection


/usr/local/etc/X11/xorg.conf.d/gedit 40-card1-nvidia.conf


# Nvidia gpu

Section "Device"

        Identifier "Card1"

        Option "DPMS"

        Driver "nvidia"

        BusID "PCI:2:0:0"

EndSection
```

/var/log/Xorg.0.log :






						Ubuntu Pastebin
					






					pastebin.ubuntu.com
				




result : the monitor attached to the nvidia gpu is turned off and the mouse can't across over it.


----------



## elgrande (Jul 22, 2022)

I guess this is your issue now:


----------



## ziomario (Jul 22, 2022)

Nope. I think this is :

*[    69.443] (EE) Screen 1 deleted because of no matching config section.*


----------



## elgrande (Jul 22, 2022)

Maybe also this:


----------



## elgrande (Jul 22, 2022)

I have no specific idea concerning this error, only thing I found for similar cases that using x11/nvidia-hybrid-graphics instead of x11/nvidia-driver helped.
But I'd wait for other input first.

Anyhow now you have 2 Nvidia cards, why not use one for FreeBSD, one for bhyve and forget about this problem?


----------



## ziomario (Jul 22, 2022)

Because I'm a geek. I like to squeeze my brain, because if my mind is trained to solve problems it stays young: D
Jokes aside but not so much,only as a lastest experiment I will try to use the 1060 as primary and the intel and the 2080 ti as secondary.


----------



## ziomario (Jul 22, 2022)

Have you already thought that this part could be necessary inside the Xorg conf files ?

```
Section "Screen"

    Identifier "Screen1"

    Device     "Card1"

    Monitor    "Monitor1"

    SubSection "Display"

        Viewport   0 0

        Depth     1

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     4

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     8

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     15

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     16

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     24

    EndSubSection

EndSection
```


----------



## elgrande (Jul 22, 2022)

Something like this defining 2 screens, one per card, might help…


----------



## ziomario (Jul 22, 2022)

Didn't work : https://pastebin.ubuntu.com/p/x8v5Zb8Bmd/


----------



## ziomario (Jul 22, 2022)

this is Xorg.1.log. I don't know for which configuration has been written :






						Ubuntu Pastebin
					






					pastebin.ubuntu.com


----------



## elgrande (Jul 22, 2022)

Which config for 2 screens did you add? Can you post it?


----------



## ziomario (Jul 22, 2022)

I think its one of the old config,because I read "AllowEmptyInitialConfiguration".


----------



## ziomario (Jul 22, 2022)

tyson said:


> I spend and hour of two to test whatever I could run in 13.1 Release.
> Two graphics cards: amdgpu and intel.
> I couldn't get anything except *two separate screens* (so, u have to run 'two' window managers - tried with openbox and It was working fine),
> or *Xinerama* - tried that with openbox and KDE, but couldn't really configure anything in KDE as randr is disabled because of xinerama.
> ...



maybe this...but anyway,it didn't work. For which kind of error ? can u see guess it ?


----------



## ziomario (Jul 22, 2022)

I've tried to change the priorities assigned by the BIOS to my gpus. I have 4 slots :

1) IGV
2) pcie 1
3) pcie 2
4) pcie 3

I have attached one monitor to the slot 2,3 and 4 and I've realized that they belong to one only GPU. Can someone guess to which GPU they belong ?


----------



## tanis (Jul 23, 2022)

ziomario said:


> Let's recap ?  :
> 
> 
> ```
> ...



The issue, I believe, lies in this message:


```
Using the first device section listed.
[    68.520] (**) |   |-->Device "Card0"
[    68.520] (**) |   |-->GPUDevice "Card1"
```

Read the following documentation provided by NVIDIA:
Chapter 34. Offloading Graphics Display with RandR 1.4
Chapter 35. PRIME Render Offload

So I would try to blend that Intel part of your configuration which is currently working with what is suggested by NVIDIA documentation.

What also might be worth to give it a shot is to make the NVIDIA primary and the Intel secondary. From what I got what you are looking for the order of the two cards doesn't matter to you as long as one screen is directed by the Intel device and the other one by the NVIDIA GPU.

One last inquiry, the Xserver is running as root, right ? Because some of the warnings are bit confusing.


----------



## ziomario (Jul 23, 2022)

-----> What also might be worth to give it a shot is to make the NVIDIA primary and the Intel secondary. From what I got what you are looking for the order of the two cards doesn't matter to you as long as one screen is directed by the Intel device and the other one by the NVIDIA GPU.

I'm not sure that I can do this. I think I have only 1 option to try :

a) Intel gpu as primary,nvidia 1060 as offloading graphic display,2080 ti kept free to be passed in bhyve

because yesterday I've ascertained that my BIOS accept only :

-) intel gpu as primary
-) 2080 ti as primary

I don't know why but the 1060 is not accepted as primary gpu. It is not detected at all. So,keeping in consideration that I can't choose the 2080 ti as primary,because if I do this I can't pass it to  a guest os virtualized with bhyve,I can only use the intel gpu as primary.


----------



## ziomario (Jul 23, 2022)

NVIDIA says :



> To use the NVIDIA driver as an RandR 1.4 output source provider, the X server needs to be configured to use the NVIDIA driver for its primary screen and to use the “modesetting” driver for the other graphics device.



So,my only option here is to use the geforce 1060 NVIDIA driver as primary screen. But it will not work since my BIOS does not accept it as primary gpu. Only the intel gpu is accepted. Or the 2080 ti,that I can't choose. I don't know,maybe this work :


```
Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:2:0:0" #1060
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection
```


----------



## ziomario (Jul 23, 2022)

or,maybe :



```
Section "ServerLayout"
      Identifier "layout"
      Screen 0 "iGPU"
      Option "AllowNVIDIAGPUScreens"
    EndSection

    Section "Device"
      Identifier "iGPU"
      Driver "modesetting"
    BusID "PCI:0:2:0" #intel gpu
    EndSection

    Section "Screen"
      Identifier "iGPU"
      Device "iGPU"
    EndSection

    Section "Device"
      Identifier "dGPU"
      Driver "nvidia"
    BusID "PCI:2:0:0" #1060
    EndSection
```


----------



## tanis (Jul 23, 2022)

ziomario said:


> -----> What also might be worth to give it a shot is to make the NVIDIA primary and the Intel secondary. From what I got what you are looking for the order of the two cards doesn't matter to you as long as one screen is directed by the Intel device and the other one by the NVIDIA GPU.
> 
> I'm not sure that I can do this. I think I have only 1 option to try :
> 
> ...



Perhaps the BIOS is only able to recognize the first two cards on the PCI bus, according to the following output the 1060 is last, how about putting it second on the mainboard, is that a possibility?


```
pciconf -vl

vgapci2@pci0:0:2:0:     class=0x030000 rev=0x02 hdr=0x00 vendor=0x8086 device=0x3e98 subvendor=0x1458 subdevice=0xd000
    vendor     = 'Intel Corporation'
    device     = 'CoffeeLake-S GT2 [UHD Graphics 630]'
    class      = display
    subclass   = VGA

vgapci0@pci0:1:0:0:     class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1e04 subvendor=0x19da subdevice=0x2503
vendor     = 'NVIDIA Corporation'
device     = 'TU102 [GeForce RTX 2080 Ti]'
class      = display
subclass   = VGA

vgapci1@pci0:2:0:0:     class=0x030000 rev=0xa1 hdr=0x00 vendor=0x10de device=0x1c02 subvendor=0x19da subdevice=0x2438
    vendor     = 'NVIDIA Corporation'
    device     = 'GP106 [GeForce GTX 1060 3GB]'
    class      = display
    subclass   = VGA
```

Both aforementioend configurations are worth a shot, however based on the already done testing regarding the Intel card, the best bet would be, to stick with the intel driver instead of using modesetting (which did not recognize the Intel card). Perhaps you can still publish the information I inquired in my last two, three posts, which might shade some additional light on the situation.


----------



## ziomario (Jul 23, 2022)

---> Perhaps the BIOS is only able to recognize the first two cards on the PCI bus, according to the following output the 1060 is last, how about putting it second on the mainboard, is that a possibility ?

maybe yes. But I need some help from you,because I have no competence in the hardware area. Problem is that the cable that I'm using to power on the 1060 is too short. I need to find the proper connector to prolong it. I need to know what's the english technical name to buy it. I've attached a screenshot to show you. If the slot occupied by the graphic cards is inverted,on the picture below you can see of how much it should be stretched.

----> perhaps you can still publish the information I inquired in my last two, three posts, which might shade some additional light on the situation.

can you ask again the informations that you need to know ?


----------



## tanis (Jul 23, 2022)

The GPU connector is called a P8 connector (8 pin connector), which is usually assembled from a P2+P6 connector.
Extension cable shouldn't be an issue.


What might give a clue, if this could be a feasible solution , would be to temporary remove the 2080 and power-up the system if the 1060 appears in the BIOS.


----------



## tanis (Jul 23, 2022)

Regarding the information, which might help:


```
Can you please post the output of the following commands:
Code:
# prints, if your intel gpu has been proper detected by the kernel module
dmesg | grep drm
# prints gpu device handler have been created
ls -l /dev/dri
# prints the packages the fils belong to
pkg which /usr/local/lib/xorg/modules/drivers/modesetting_drv.so
pkg which /usr/local/lib/xorg/modules/drivers/intel_drv.so
# prints all installed packages which contain the word video
pkg info | grep video
# prints all installed nvidia driver
pkg info | grep nvidia
# prints who is part of the video group
getent group video
# print loaded kernel modules
kldstat
```

Can you please confirm, if X is running as root? Because there had been some strange warnings in the Xorg.0.log.


----------



## tanis (Jul 23, 2022)

ziomario said:


> I think that I'm on the right track. I've modified the *xorg.conf* file like this :
> 
> 
> ```
> ...


Just read again the whole thread and came across post of yours (#23), which to me looks like we are on the right track. The configuration mentioned in #23 is the same which you got right now. The difference is, that the 1060 is plugged in as well and is being detected by X as "GPUDevice", where the 2080 had been detected as usual "Device" according to the Xorg.0.log posted in #23.


----------



## ziomario (Jul 23, 2022)

tanis said:


> Just read again the whole thread and came across post of yours (#23), which to me looks like we are on the right track. The configuration mentioned in #23 is the same which you got right now. The difference is, that the 1060 is plugged in as well and is being detected by X as "GPUDevice", where the 2080 had been detected as usual "Device" according to the Xorg.0.log posted in #23.



I don't see any desktop manager on the monitor attached to the nvidia card but my mouse can go across it. So,I presume there aren't problems regarding xorg or the drivers,but the problem is that maybe I should run the desktop manager on the black monitor. I've added this line on the file /home/user/.xinitrc :


```
set DISPLAY=:0.1 exec ck-launch-session dbus-launch --exit-with-session startplasma-x11
```

but nothing,it does not work. The screen attached on the nvidia card is still black even if I see the mouse goes there. Nothing happens. Maybe the error is there. We make some mistake trying to start the deskop manager on the black screen ?


----------



## tanis (Jul 23, 2022)

My knowledge about KDE can be considered a faint fairytale, but I do remember that there had been something like a Display Setting where you could expand your "Desktop" from the first screen to the 2nd one. 

If you are able to cross to the other side (2nd screen), then you should also be able to open an kde-console and drag it with your mouse over there. I'm sorry to ask this of you, but did you try that ? Move a window with your mouse to the 2nd screen ?


----------



## ziomario (Jul 23, 2022)

The HDMI cable I used to attach the black screen to the geforce 1060 was broken. I changed it. Now I can see again the mouse across it. And I have removed the 2080 ti and I left only the 1060 and from the BIOS I've chosen it as primary GPU. It has been recognized. So,when I will get the power cable I will place the 1060 on the first slot to make it the primary GPU. And the intel and the 2080 ti will be secondary. Maybe this is the only solution. Regarding the informations requested (now I have chosen the intel gpu as primary and this xorg.conf file :


```
Section "Device"
    Identifier  "Card0"
    Driver      "intel"
    BusID       "PCI:0:2:0"
EndSection

Section "Device"
    Identifier  "Card1"
    Driver      "nvidia"
    BusID       "PCI:2:0:0" #nvidia gtx 1060
EndSection
```


```
# dmesg | grep drm

drmn2: <drmn> on vgapci2
vgapci2: child drmn2 requested pci_enable_io
vgapci2: child drmn2 requested pci_enable_io
[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
[drm] Got stolen memory base 0x3b800000, size 0x4000000
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm] Connector eDP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.eDP-1
[drm]   - kern.vt.fb.default_mode
drmn2: successfully loaded firmware image 'i915/kbl_dmc_ver1_04.bin'
[drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
[drm] failed to retrieve link info, disabling eDP
[drm] Connector HDMI-A-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-1
[drm]   - kern.vt.fb.default_mode
drmn2: Failed to program MOCS registers; expect performance issues.
[drm] Initialized i915 1.6.0 20190822 for drmn2 on minor 0
name=drmn2 flags=0x0 stride=7680 bpp=32
drmn2: fb0: i915drmfb frame buffer device

# ls -l /dev/dri

total 0
lrwxr-xr-x  1 root  wheel   8 Jul 23 22:24 card0 -> ../drm/0
lrwxr-xr-x  1 root  wheel  10 Jul 23 22:24 renderD128 -> ../drm/128

# pkg which /usr/local/lib/xorg/modules/drivers/modesetting_drv.so
/usr/local/lib/xorg/modules/drivers/modesetting_drv.so was installed by package xorg-server-1.20.14,1

# pkg which /usr/local/lib/xorg/modules/drivers/intel_drv.so
/usr/local/lib/xorg/modules/drivers/intel_drv.so was installed by package xf86-video-intel-2.99.917.916_1,1

# pkg info | grep video

emby-server-4.7.5.0            Media server to organize, play & stream audio/video to various devices
ffmpeg-4.4.2_5,1               Realtime audio/video encoder/converter and streaming server
ffmpegthumbnailer-2.2.2        Lightweight video thumbnailer that can be used by file managers
frei0r-1.8.0                   Minimalistic plugin API for video effects
gavl-1.4.0_4                   Library for handling uncompressed video and audio data
gstreamer1-libav-1.16.2        GStreamer plug-in with many audio/video decoders/encoders
gstreamer1-plugins-core-1.16   Core set of typical audio and video GStreamer plugins
intel-media-sdk-22.4.3         Hardware video decoding/encoding/filtering on Intel GPUs
kdemultimedia-ffmpegthumbs-22.04.3 FFmpeg-based thumbnail generator for video files
libde265-1.0.8                 Open source h.265 video codec
libtheora-1.1.1_7              Theora video codec for the Ogg multimedia streaming system
movit-1.6.3                    High-performance video filters for the GPU
qt5-multimedia-5.15.5p1        Qt audio, video, radio and camera support module (KDE patched)
simplescreenrecorder-0.4.4     Screen video recorder
vmaf-2.3.1                     Perceptual video quality assessment based on multi-method fusion
xf86-video-intel-2.99.917.916_1,1 X.Org legacy driver for Intel integrated graphics chipsets
xf86-video-vmware-13.3.0_6     X.Org vmware display driver

# pkg info | grep nvidia

linux-nvidia-libs-510.60.02    NVidia graphics libraries and programs (Linux version)
nvidia-driver-510.60.02        NVidia graphics card binary drivers for hardware OpenGL rendering
nvidia-settings-470.86         Display Control Panel for X NVidia driver

# getent group video
video:*:44:marietto

# kldstat

Id Refs Address                Size Name
 1  137 0xffffffff80200000  1f30590 kernel
 2    2 0xffffffff82131000     82b0 bridgestp.ko
 3    1 0xffffffff8213a000     40f8 nmdm.ko
 4    1 0xffffffff8213f000    29d28 fusefs.ko
 5    3 0xffffffff82169000    929d8 vboxdrv.ko
 6    1 0xffffffff821fc000     feb0 if_bridge.ko
 7    1 0xffffffff8220c000   5ec1d8 zfs.ko
 9    1 0xffffffff8280f000   5848b8 vmm.ko
10    1 0xffffffff82d94000     af68 cryptodev.ko
11    1 0xffffffff83210000     639c linprocfs.ko
12    6 0xffffffff83217000    10ab0 linux_common.ko
13    1 0xffffffff83228000     3284 linsysfs.ko
14    1 0xffffffff8322c000     9ea0 tmpfs.ko
15    1 0xffffffff83236000     3530 fdescfs.ko
16    2 0xffffffff8323a000     4240 vboxnetflt.ko
17    2 0xffffffff8323f000     aac8 netgraph.ko
18    1 0xffffffff8324a000     31c8 ng_ether.ko
19    1 0xffffffff8324e000     55e0 vboxnetadp.ko
20    1 0xffffffff83254000     2220 cpuctl.ko
21    1 0xffffffff83257000    fd310 nvidia-modeset.ko
22    1 0xffffffff83400000  2354ab8 nvidia.ko
23    2 0xffffffff83355000    38070 linux.ko
24    1 0xffffffff8338e000     3378 acpi_wmi.ko
25    1 0xffffffff83392000     3250 ichsmb.ko
26    1 0xffffffff83396000     2180 smbus.ko
27    1 0xffffffff83399000     2110 pchtherm.ko
28    1 0xffffffff8339c000     e538 snd_uaudio.ko
29    1 0xffffffff833ab000     2340 uhid.ko
30    1 0xffffffff833ae000     3380 usbhid.ko
31    1 0xffffffff833b2000     31f8 hidbus.ko
32    1 0xffffffff833b6000     3320 wmt.ko
33    1 0xffffffff833ba000     4350 ums.ko
34    1 0xffffffff833bf000    32208 linux64.ko
35    1 0xffffffff833f2000     2260 pty.ko
36    1 0xffffffff833f5000     4700 nullfs.ko
37    1 0xffffffff833fa000     2a08 mac_ntpd.ko
38    1 0xffffffff85755000   158438 i915kms.ko
39    1 0xffffffff858ae000    7f020 drm.ko
40    2 0xffffffff8592e000     cbc8 linuxkpi_gplv2.ko

# xrandr -q

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 16384 x 16384
HDMI-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  50.00    59.94  
   1920x1080i    60.00    50.00    59.94  
   1680x1050     59.88  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x960      60.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94
```


----------



## ziomario (Jul 23, 2022)

tanis said:


> I'm sorry to ask this of you, but did you try that ? Move a window with your mouse to the 2nd screen ?



sure. I tried. It didn't work. Only the mouse pointer can go there.


----------



## tanis (Jul 23, 2022)

ziomario said:


> ziomario said:
> 
> 
> > sure. I tried. It didn't work. Only the mouse pointer can go there.
> ...



Can you please post the Xorg.0.log?


----------



## ziomario (Jul 23, 2022)

Ubuntu Pastebin
					






					pastebin.ubuntu.com


----------



## tanis (Jul 23, 2022)

What is the output of:


```
xrandr --listmonitors
```


----------



## ziomario (Jul 23, 2022)

```
# xrandr --listmonitors

Monitors: 1
0: +HDMI-1 1920/598x1080/336+0+0  HDMI-1
```


----------



## tanis (Jul 23, 2022)

According to Xorg.0.log you got two screens connected to each card, here are the parts from the log:


```
...
[   111.170] (II) intel(0): Monitor name: 2769M
[   111.170] (II) intel(0): Serial No: AFXG19A000434
...
[   111.916] (--) NVIDIA(0): Valid display device(s) on GPU-0 at PCI:2:0:0
[   111.916] (--) NVIDIA(0):     DFP-0
[   111.916] (--) NVIDIA(0):     DFP-1
[   111.916] (--) NVIDIA(0):     DFP-2
[   111.916] (--) NVIDIA(0):     DFP-3 (boot)
[   111.916] (--) NVIDIA(0):     DFP-4
[   111.916] (--) NVIDIA(0):     DFP-5
[   111.916] (--) NVIDIA(0):     DFP-6
[   111.916] (--) NVIDIA(0):     DFP-7
...
[   111.963] (--) NVIDIA(GPU-0): Samsung SyncMaster (DFP-3): connected
[   111.963] (--) NVIDIA(GPU-0): Samsung SyncMaster (DFP-3): Internal TMDS
[   111.963] (--) NVIDIA(GPU-0): Samsung SyncMaster (DFP-3): 600.0 MHz maximum pixel clock
```

My thoughts on the current situation:

randr Multihead support has been introduced with release 1.5, and needs to be supported by the desktop environment. It looks like xrandr detects only one screen, so perhaps there is still some functionality lacking.

What is randr version? 


```
xrandr --version
```

NVIDIA supports multihead with different cards, IF the NVIDIA card is primary and the 2nd card,most likely intel, uses the modesetting driver. Here was the issue that the modesetting driver didn't recognize your intel card.

randr multihead is the successor to Xinerama, BUT I don't find any information which indicates that Xinerama has been baked out meaning it might be still in there. So perhaps Xinerama is an option which needs further investigation.


----------



## tanis (Jul 23, 2022)

Just out of curiosity, can you try the following, because if you can get across the horizon using your mouse then that screen can be addressed, so the remaining question is how:


```
export DISPLAY=:0.0 ; xterm &
export DISPLAY=:0.1 ; xterm &
export DISPLAY=:1.0 ; xterm &
export DISPLAY=:1.1 ; xterm &
```


----------



## ziomario (Jul 23, 2022)

```
# xrandr --version

xrandr program version       1.5.1
Server reports RandR version 1.6
```


----------



## ziomario (Jul 23, 2022)

it worked ! with this command :


```
$ export DISPLAY=:0.1 ; xterm &
[2] 10763
[1]   Done                    xterm
```

the xterm has been displayed on the black screen monitor !


----------



## ziomario (Jul 23, 2022)

how can I start the full xfce4 desktop manager on the black screen ?????? maybe with :


```
export DISPLAY=:0.1 ; startxfce4 ?
```


----------



## tanis (Jul 23, 2022)

The same way like the xterm:


```
export DISPLAY=:0.1 ; startxfce4 &
```


----------



## ziomario (Jul 23, 2022)

unfortunately not :


```
export DISPLAY=:0.1 ; startxfce4

/usr/local/bin/startxfce4: X server already running on display :0.1
xfce4-session: Another session manager is already running
```


----------



## tanis (Jul 23, 2022)

You got two seperate screens, Xinerama should make it possible to move windows freely around.

The situation you are in right now, that's what I was referring to in my first post, back in the days, GUIs got an option where you could enter on which DISPLAY the window should appear.


----------



## ziomario (Jul 23, 2022)

so,what should I do ? actually it seems that I can run only xterm because it does not need Xorg to work. But xfce4 needs xorg,but since I already run one xorg session,it won't run another one.


----------



## tanis (Jul 23, 2022)

ziomario said:


> so,what should I do ? actually I can run only xterm because it does not need Xorg to work. But xfce4 needs xorg,but since I already run one xorg session,it won't run another one.



Nope, whats happening right now, is that Xorg :0 got screen .0 and screen .1, but Xinerama is not configured so XFCE can't stretch to screen .1. Xinerama is basically a virtual screen combined of all screens configured in Xorg. The desktop environment (XFCE) has no knowledge about the number of screens and just uses the provided screen which in a Xinerama case concats all screens into one.

Using DISPLAY you can send any window on the 2nd screen:


```
export DISPLAY=:0.1 ; firefox
```


----------



## tanis (Jul 23, 2022)

Next step is to configure Xinerama, or put the 1060 as primary and try randr again.

But it's heading in the right direction.


----------



## ziomario (Jul 23, 2022)

It does not work as expected. This command :


```
$ export DISPLAY=:0.1 ; firefox
```

starts firefox on the monitor attached to the intel gpu. Only this command startx xterm on the black screen :


```
$ export DISPLAY=:0.1 ; xterm
```

at this point I'm moved the mouse pointer inside the xterm window and I wrote firefox,but surprise : firefox has been displayed on the screen attached to the intel gpu.


----------



## tanis (Jul 23, 2022)

Strange behavior, it used to work like that.


----------



## ziomario (Jul 23, 2022)

How can I enable Xinerama ?


----------



## tanis (Jul 23, 2022)

Right now there are only two devices configured, each device needs a screen configured and then at last a server layout needs to be configured and in the server layout section Xinerama is enabled.


----------



## ziomario (Jul 23, 2022)

so,there aren't improvements that I can make ?


----------



## tanis (Jul 24, 2022)

Sure, two options to proceed:

A) like already mentioned swap the 1060 and 2080 to make the 1060 primary and therefor intel gpu secondary and Xorg will probably fill in the rest by auto-configuration.

B) Go old school by using Xinerama, BUT adopted to /usr/local/etc/X11/xorg.conf.d . This   example Xinerama xorg.conf looks pretty good, just adopt it to your existing config. Keep the order of the file by splitting it in the section parts in single conf files. U can post those here for further evaluation and documentation.


----------



## ziomario (Jul 24, 2022)

I choose the option 1,since I've tried xinerama and I found it very uncomfortable. Basically two screens become 1. The problem is that the screens are not physically attached,for this reason this solution becomes not goot at all.


----------



## tanis (Jul 24, 2022)

So then I guess we have to wait for the 8P connector extension.


----------



## ziomario (Jul 24, 2022)

tanis said:


> So then I guess we have to wait for the 8P connector extension.



yes,amazon is fast. The item has been shipped already and will come to me in 3 days. It is a 6P connector extension.


----------



## tyson (Jul 24, 2022)

ziomario said:


> How can I enable Xinerama ?


Man, this thread is making me headache.
You had this question answered multiple times in this thread.
Also, to be able to use intel with modesetting driver you most likely need to add i915kms to rc.conf


----------



## ziomario (Jul 25, 2022)

tanis : amazon is faster than I've thought : the power cable will come to me in a few hours.


----------



## ziomario (Jul 25, 2022)

tanis : I've got the 6 pin power cable just today. I've used the old xorg.conf file used before and I've got the same exact situation as before. The only 2 apps which can be directed to the secondary screen is :


```
[marietto@marietto ~]$ export DISPLAY=:0.1 ; chrome (firefox can be displayed only on the screen 0 : dunno why)
```

and


```
[marietto@marietto ~]$ export DISPLAY=:0.1 ; konsole
```

xinerama does not work,it freezes the mouse.


----------



## ziomario (Jul 25, 2022)

I think that the solution here is to use xpra.


----------



## ziomario (Jul 26, 2022)

SirDice : I'm still working on this issue. I've found an old post with the user that has the same exact problem like mine,but he fixed it using two nvidia graphic cards,as you can read here :









						Solved - Dual head setup with two graphics cards
					

Hi all,  I'm trying to setup dual-head display on my machine. I have two identical monitors (Iiyama ProLite B2280HS), but my machine has two graphics cards -- one on-board (intel) and one on PCI (NVidia). I have Xorg displaying on both monitors, but only my left monitor (the one attached to the...




					forums.freebsd.org
				




but I cannot.  Here I read what's the real problem :









						Solved - Dual head setup with two graphics cards
					

Hi all,  I'm trying to setup dual-head display on my machine. I have two identical monitors (Iiyama ProLite B2280HS), but my machine has two graphics cards -- one on-board (intel) and one on PCI (NVidia). I have Xorg displaying on both monitors, but only my left monitor (the one attached to the...




					forums.freebsd.org
				




in the old post you didn't find a solution,you found only a workaround. Unfortunately in my case I can't use two nvidia cards,for the reasons that I have explained. This oblige me to find a different solution,I would say a solution that can modify the wrong libraries,removing,changing them. Do you have this level of competence ?


----------



## drhowarddrfine (Jul 26, 2022)

I have not followed this thread at all--perhaps I should read through it--but I've been running with two monitors on FreeBSD for 15 years or so with one, older, two port nVidia card. It's quick and easy to set up so I don't understand the issue.


----------



## SirDice (Jul 26, 2022)

Dual (or more) monitor set up with one NVidia graphics card was (and still is) fairly easy to set up (TwinView).


----------



## ziomario (Jul 26, 2022)

drhowarddrfine said:


> I have not followed this thread at all--perhaps I should read through it--but I've been running with two monitors on FreeBSD for 15 years or so with one, older, two port nVidia card. It's quick and easy to set up so I don't understand the issue.



yeah,it seems that using two nvidia cards works. But my scenario is different. I can't use two nvidia cards. I'm obliged to use one intel gpu and one nvidia gpu because I use massively the bhyve virtual machines,so I can't use the 2080 ti as secondary nor primary gpu. the rest of my gpus are intel and nvidia. So,I need to understand and find a solution to create a cooperation between intel and nvidia gpus.


----------



## ziomario (Jul 26, 2022)

SirDice said:


> Dual (or more) monitor set up with one NVidia graphics card was (and still is) fairly easy to set up (TwinView).



this could be an idea. And anyway,this is your second workaround  It seems that you like to find workarounds. Now I should only hope that my 1060 supports two monitors...


----------



## SirDice (Jul 26, 2022)

It's not a workaround, TwinView was part of the NVidia driver for as long as I can remember. Even before Xinerama (that has it's own issues). Splitting up the configuration using two (or more) graphics cards and two (or more) screens (not displays!) was always finicky, especially if they're _different_ video cards. The two screen set up works but you can't move a window from one screen to the other, so it has a bunch of quirks too.

Your best bet in getting this working (reliably and without much issues) is to connect both monitors to the same video card.


----------



## ziomario (Jul 26, 2022)

SirDice said:


> It's not a workaround, TwinView was part of the NVidia driver for as long as I can remember. Even before Xinerama (that has it's own issues). Splitting up the configuration using two (or more) graphics cards and two (or more) screens (not displays!) was always finicky. The two screen set up works but you can't move a window from one screen to the other, so it has a bunch of issues too.
> 
> Your best bet in getting this working (reliably and without much issues) is to connect both monitors to the same video card.



I think it is subjective question. In my opinion the real problem is structural. If there are some libraries that interferes in the collaboration between the nvidia driver and the intel driver,that's the "real" problem. And the solution is to make the libraries which belong to each gpu,"indipendent" from each other.


----------



## SirDice (Jul 26, 2022)

ziomario said:


> I think it is subjective question. In my opinion the real problem is structural. If there are some libraries that interferes in the collaboration between the nvidia driver and the intel driver,that's the "real" problem. And the solution is to make the libraries which belong to each gpu,"indipendent" from each other.


Back in the early days the NVidia driver actually _replaced_ some Xorg libraries. Nowadays this is solved by clever use of libmap.conf(5). Doesn't change the fact Xorg itself may not like having two different video cards working simultaneously.


----------



## ziomario (Jul 26, 2022)

SirDice said:


> Back in the early days the NVidia driver actually _replaced_ some Xorg libraries. Nowadays this is solved by clever use of libmap.conf(5). Doesn't change the fact Xorg itself may not like having two different video cards working simultaneously.



1) Clever use of libmap.conf(5) : what it means ? what to do pratically ?
2) Xorg itself may not like having two different video cards working simultaneously : ok,which kind of problems may occours ?


----------



## SirDice (Jul 26, 2022)

ziomario said:


> 1) Clever use of libmap.conf(5) : what it means ?


The NVidia driver uses a modified version of libEGL.so for example. Xorg (well, mesa actually) supplies the exact same library but the NVidia driver requires the NVidia modified version. Back in the olden days the NVidia driver installation would simply overwrite/replace the Xorg libEGL.so. It's not allowed to do this anymore (one package overwriting another package's files is not allowed). This was solved by saving the NVidia modified version of libEGL.so as NVidia-libEGL.so and configuring libmap.conf(5) accordingly. Now, if the Nvidia driver requests to load libEGL.so it actually loads NVidia-libEGL.so (because of the mappings in libmap.conf(5)).


----------



## ziomario (Jul 26, 2022)

Can you give a look at this xorg.conf file ? I've tried to configure it to attach two monitors to the same graphic card (gtx 1060). If you see some error,please tell me. thanks.


```
Section "ServerFlags"
    Option "AutoAddDevices" "False"
    Option "AllowEmptyInput" "False"
EndSection

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 1920 0
    Screen      1  "Screen1" RightOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
   #Option         "Xinerama" "1"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "AOC"
    HorizSync       30.0 - 83.0
    VertRefresh     55.0 - 75.0
    Option         "DPMS"
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "Samsung SyncMaster"
    HorizSync       30.0 - 83.0
    VertRefresh     55.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Option         "UseDisplayDevice" "DFP-1"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060"
    BusID          "PCI:1:0:0"
    Screen          0
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "1920x1080 +0+0; nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "CRT: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
```


----------



## SirDice (Jul 26, 2022)

ziomario said:


> I've tried to configure it to attach two monitors to the same graphic card (gtx 1060).


Yeah, remove the whole thing. Only save the driver section as /usr/local/etc/X11/xorg.conf.d/nvidia-driver.conf:

```
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 1060"
    BusID          "PCI:1:0:0"
EndSection
```
You have to supply a BusID here because you have more than one card available to the system.


----------



## ziomario (Jul 26, 2022)

It didn't work. The 1060 has one only HDMI port and there I have attached the Samsung Synchmaster monitor. I've attached the AOC monitor to the DisplayPort of the 1060. The result is that the Synchmaster monitor didn't turn on. Below you can read the log file :





__





						Ubuntu Pastebin
					






					pastebin.ubuntu.com


----------



## drhowarddrfine (Jul 26, 2022)

ziomario said:


> yeah,it seems that using two nvidia cards works. But my scenario is different. I can't use two nvidia cards.


That's not what I have. I have one 9600 card with two ports on it. I just plug a monitor into each port and run nvidia-config and it all works.


----------



## ziomario (Jul 26, 2022)

drhowarddrfine said:


> That's not what I have. I have one 9600 card with two ports on it. I just plug a monitor into each port and run nvidia-config and it all works.



You replied to my old post. Can you give a look at the next ? I've attached my two monitors to the HDMI / DisplayPort ports of the 1060 but the samsung monitor didn't turn on.


----------



## ziomario (Jul 26, 2022)

drhowarddrfine said:


> That's not what I have. I have one 9600 card with two ports on it. I just plug a monitor into each port and run nvidia-config and it all works.



this is the file generated by nvidia-xconfig,but it does not seem good. Inside of it I see only one monitor (but I have two) and no BUSID on the driver section.


```
# nvidia-xconfig: X configuration file generated by nvidia-xconfig

# nvidia-xconfig:  version 470.86


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"

EndSection


Section "Screen"

    Identifier     "Screen0"

    Device         "Device0"

    Monitor        "Monitor0"

    DefaultDepth    24

    SubSection     "Display"

        Depth       24

    EndSubSection

EndSection
```


----------



## ziomario (Jul 26, 2022)

I see some progress anyway :


```
# xrandr -q

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
1920x1080     60.00*+  59.94    50.00
1680x1050     59.95
1440x900      59.89
1280x1024     75.02    60.02
1280x960      60.00
1280x720      60.00    59.94    50.00
1024x768      75.03    70.07    60.00
800x600       75.00    72.19    60.32    56.25
720x576       50.00
720x480       59.94
640x480       75.00    72.81    59.94    59.93
 
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
```

DP-0 is AOC monitor and the 1060 ; HDMI-0 is Samsung SynchMaster and the 1060,but it is disconnected. why ?


----------



## ziomario (Jul 26, 2022)

SirDice said:


> The NVidia driver uses a modified version of libEGL.so for example. Xorg (well, mesa actually) supplies the exact same library but the NVidia driver requires the NVidia modified version. Back in the olden days the NVidia driver installation would simply overwrite/replace the Xorg libEGL.so. It's not allowed to do this anymore (one package overwriting another package's files is not allowed). This was solved by saving the NVidia modified version of libEGL.so as NVidia-libEGL.so and configuring libmap.conf(5) accordingly. Now, if the Nvidia driver requests to load libEGL.so it actually loads NVidia-libEGL.so (because of the mappings in libmap.conf(5)).



Having said that,is there a solution which allows to use an intel gpu and one gpu nvidia at the same time ?


----------



## SirDice (Jul 26, 2022)

ziomario said:


> is there a solution which allows to use an intel gpu and one gpu nvidia at the same time ?


I honestly don't know. Because this was already a problem in the past I've always avoided such scenarios.


----------



## drhowarddrfine (Jul 26, 2022)

Right now, I have nothing in /etc/X11 and in /usr/local/etc/X11/xorg.conf.d/driver-nvidia.conf there is only this:
`Section "Device"
        Identifier "Card0"
        Driver  "nvidia"
EndSection`

Honestly, it's been months since I reinstalled FreeBSD on this system and am not sure if I needed to run xconfig but my memory is going on me.

I have not been able to get the onboard Intel graphics to work with my nvidia card either but I didn't try too hard years ago.


----------



## getopt (Jul 26, 2022)

Looks like our forums gets more and more a play field and sanctuary for the elderly among us. Please be nice to them while trying to be patient.


----------



## elgrande (Jul 26, 2022)

patiently says x11/nvidia-settings


----------



## ziomario (Jul 26, 2022)

elgrande said:


> patiently says x11/nvidia-settings



please be patient only for a little time. I feel that this long thread is going to reach the solution and the end :


----------



## drhowarddrfine (Jul 26, 2022)

getopt said:


> Looks like our forums gets more and more a play field and sanctuary for the elderly among us. Please be nice to them while trying to be patient.


I had hernia repair done a few days ago, hence my excuse. Can't do anything strenuous and sore as hell.



elgrande said:


> patiently says x11/nvidia-settings


Yeah, we know and it's been mentioned twice by me though once incorrectly. Keeps the kids on their toes.


----------



## drhowarddrfine (Jul 26, 2022)

ziomario Now this is strange to me. I don't have that pkg installed. So how did I get dual monitors working? Do I misremember that the old driver now detects that on its own? Very possible now that I think of it because xorg.conf isn't needed anymore but it's been so long that I don't remember what I did last time.


----------



## ziomario (Jul 26, 2022)

drhowarddrfine said:


> ziomario Now this is strange to me. I don't have that pkg installed. So how did I get dual monitors working? Do I misremember that the old driver now detects that on its own? Very possible now that I think of it because xorg.conf isn't needed anymore but it's been so long that I don't remember what I did last time.



I can for sure delete xorg.conf,but likey it will not work,because the suggestions of SirDice are rarely wrong.


----------



## SirDice (Jul 26, 2022)

ziomario said:


> because the suggestions of @SirDice are rarely wrong.


Don't treat them as gospel though, I do make mistakes every once in a while.


----------



## codingcowboy (Jul 26, 2022)

I have a question when you want to use the 2 monitors at the same time in FreeBSD not in a virtual why don't you get a HDMI to DispalyPort or DVI adapter and plug both monitors into your Nividia 1060 and turn off the Intel card?  It could simplify this whole situation.  Save your config when you use the intel and passthrough the nividia that way you can switch between them with a simple cable swap.


----------



## getopt (Jul 26, 2022)

drhowarddrfine said:


> I had hernia ...


This is reported most when risible muscles got degenerated while trying to lift heavyweight intellectual properties. Try to have at all times enough stuff to laugh at and do it cordially and loud.


----------



## ziomario (Jul 26, 2022)

You gave to me a nice idea,the idea of disabling the Intel GPU. It's good to see what happens. But,anyway,I dislike to disable it forever,because the idea of having two gpus to pass (even at the same time) inside a bhyve vm, makes me excited.


----------



## Crivens (Jul 26, 2022)

I don't know if this was mentioned before, you can blame it on me getting old, but here is what I did:
My .xinitrc contains a line saying

```
~/bin/reset-xrandr.sh
```
with that script being 
	
	



```
#!/bin/sh
xrandr --output LVDS-1 --auto --rotate normal --pos  0x0  --output DP-1 --auto --rotate normal --right-of LVDS-1
```
After that, it starts the screen saver and wmaker.


----------



## ziomario (Jul 26, 2022)

Crivens said:


> I don't know if this was mentioned before, you can blame it on me getting old, but here is what I did:
> My .xinitrc contains a line saying
> 
> ```
> ...



First of all,very thanks. Second : I need to know what's your configuration. Which kind of gpu do u have ? how many monitors ? how is your xorg.conf ? I need to understand what does what in your script,before to run it.


----------



## Crivens (Jul 26, 2022)

This is for a single GPU i915 laptop. It tells the xrands there are multiple monitors, where they are connected and where they are placed with regard to each other. This sets up Xorg to treat them as one surface, and the window system can work with one DISPLAY. Try it out, it will not fry your hardware and even good old twm should work with it. Of course you need to adjust the port names, the resolutions and maybe the placement.


----------



## ziomario (Jul 26, 2022)

Crivens said:


> This is for a single GPU i915 laptop. It tells the xrands there are multiple monitors, where they are connected and where they are placed with regard to each other. This sets up Xorg to treat them as one surface, and the window system can work with one DISPLAY. Try it out, it will not fry your hardware and even good old twm should work with it. Of course you need to adjust the port names, the resolutions and maybe the placement.



My configuration is different. I have 3 gpus. Does it make sense for me ?


----------



## Crivens (Jul 26, 2022)

One way to find out...


----------



## ziomario (Jul 26, 2022)

As u can see here,I have only the DP-0 connected. the HDMI-0 is disconnected. Your script assumes that there at least two connected monitors,LVDS-1 and DP-1. Can't work. mmm.


```
# xrandr -q

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
1920x1080     60.00*+  59.94    50.00
1680x1050     59.95
1440x900      59.89
1280x1024     75.02    60.02
1280x960      60.00
1280x720      60.00    59.94    50.00
1024x768      75.03    70.07    60.00
800x600       75.00    72.19    60.32    56.25
720x576       50.00
720x480       59.94
640x480       75.00    72.81    59.94    59.93
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
```


----------



## ziomario (Jul 26, 2022)

ok according with my values,I tried this :


```
#!/bin/sh
xrandr --output DP-0 --auto --rotate normal --pos  0x0 --output HDMI-0 --auto --rotate normal --right-of DP-0 --output HDMI-0 --auto --rotate normal --right-of DP-0
```

nothing is happened. totally nothing.


----------



## elgrande (Jul 26, 2022)

You have checked the X Server Display Configuration in nvidia-settings and activated both displays?


----------



## ziomario (Jul 26, 2022)

elgrande said:


> You have checked the X Server Display Configuration in nvidia-settings and activated both displays?



I didn't find the section where to activate the second display on the nvidia-settings panel.


----------



## elgrande (Jul 26, 2022)

„X Server Display Configuration“


----------



## ziomario (Jul 26, 2022)

elgrande said:


> „X Server Display Configuration“



I can't. It says "detected display 1",there is only the AOC monitor and the 1060.


----------



## ziomario (Jul 26, 2022)

Do you have a working xorg.conf file to try ?  I tried many but no one worked.


----------



## elgrande (Jul 26, 2022)

The second monitor is connected and has power and is switched on?
Does it work in another OS, eg Linux Live Stick?


----------



## elgrande (Jul 26, 2022)

ziomario said:


> Do you have a working xorg.conf file to try ?  I tried many but no one worked.


DO NOT USE XORG.CONF!
This has been said 100 times in this thread!
Use the small xorg.conf.d Sir Dice sent you that should be enough.


----------



## ziomario (Jul 26, 2022)

Nope is not enough. I've just tried it. Man,can I ask you a little favor ? can you read some of the old messages ? I really dislike that you scold me because In your opinion I shouldn't do (or I should do) something,but you make a mistake,because the task that I should do,I have usually already tried it,but you can't know this,because you usually don't read at all the old messages. So,in your eyes I'm someone that does not want to follow the suggestions,but this is not true. I've already followed the suggestions that have been given to me,when you weren't connected here. After having said that,I have already tried without xorg.conf and with the small xorg.conf written by SirDice but it didn't work.


----------



## elgrande (Jul 26, 2022)

If the small config starts up Nvidia xorg on one monitor it works.
The rest is to be done in xorg.
Please try with windows or Linux to see if both monitors work.


----------



## ziomario (Jul 26, 2022)

And now I have disabled the intel gpu from the bios. Nothing is changed. The samsung monitor is always turned off (and my mouse can't even go across its screen) and the AOC is on and both are connected to the 1060. One monitor works,yes,it's the AOC. I have already tried to go in Linux and Windows. Both the monitor work like a charme.


----------



## elgrande (Jul 26, 2022)

Does it work in Windows or Linux?
Edit: sorry overread this.


----------



## elgrande (Jul 26, 2022)

So you are trying with Sir Dice config and nvidia-settings right?
And the second monitor is switched on?


----------



## getopt (Jul 26, 2022)

Great entertainment here! The most informative thing here is the item at the upper right corner of the posts.


----------



## ziomario (Jul 26, 2022)

getopt said:


> Great entertainment here! The most informative thing here is the item at the upper right corner of the posts.



Usually you do only funny things ?


----------



## ziomario (Jul 26, 2022)

elgrande said:


> So you are trying with Sir Dice config and nvidia-settings right?
> And the second monitor is switched on?



When I have tried the second kind of configuration (two monitors attached to one only gpu (1060),the second monitor never turned on. It worked better when I tried one monitor on the 1060 and the other one on the intel gpu. Anyway,even if it is turned off,it is detected. With the intel gpu and the 1060 it wasn't even detected.


----------



## ziomario (Jul 26, 2022)

I've found the thread of an user who has had my same problem and there could be the solution inside :









						How to correlate xorg.conf config for nvidia gpu with xrandr detected screens?
					

I have a situation with RHEL 7.9 and an RTX 2070 in an Alienware M15 that I haven't made much progress on lately. I downloaded the latest compatible driver from Nvidia (file name: NVIDIA-Linux-x86_...




					unix.stackexchange.com


----------



## ziomario (Jul 26, 2022)

I wanna write here what I did as a reminder,before to reboot. I've tried to adapt the solution for FreeBSD,since it is tailored for Linux. This is what I did :


```
a) # pkg remove xf86-video-intel

b) /etc/rc.conf : kld_list="nvidia nvidia-modeset i915kms"

c) in /boot/loader.conf : pptdevs="2/0/0 2/0/1 2/0/2 2/0/3"

d) /etc/X11/xorg.conf :



Section "ServerLayout"
Identifier "layout"
Screen  "ScreenU"
EndSection

Section "Device"
Identifier "nvidia"
Driver "nvidia"
maybe : BusID          "PCI:1:0:0"
EndSection
 
Section "Screen"
Identifier "ScreenU"
EndSection

Section "Device"
Identifier     "intel"
Driver         "modesetting"
BusID          "PCI:0:2:0"
EndSection
```

I've attached the samsung monitor to the HDMI port of the Intel gpu and the AOC to the DP of the nvidia GTX 1060.

Do you see some mistakes ?


----------



## ziomario (Jul 26, 2022)

It didn't work. This is what happened : https://pastebin.ubuntu.com/p/w6T4zKBdJW/


----------



## eternal_noob (Jul 26, 2022)

ziomario said:


> maybe : BusID "PCI:1:0:0"


Maybe?


----------



## ziomario (Jul 26, 2022)

This is the xorg.conf file which works partially :


```
# nvidia-xconfig: X configuration file generated by nvidia-xconfig

# nvidia-xconfig:  version 470.86


Section "ServerLayout"

    Identifier     "Layout0"

    Screen      0  "Screen0" 1920 1080

    Screen      1  "Screen1" 1280 1024

    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 6 7"

EndSection


Section "InputDevice"

    # generated from default

    Identifier     "Keyboard0"

    Driver         "kbd"

EndSection


Section "Monitor"

    Identifier     "Monitor0"

    VendorName     "AOC"

    ModelName      "AOC"

    Option         "DPMS"

EndSection


Section "Monitor"

    Identifier     "Monitor1"

    VendorName     "Samsung"

    ModelName      "SynchMaster"

    Option         "DPMS"

EndSection


Section "Device"

    Option         "UseDisplayDevice" "DP-0"

    Identifier     "Device0"

    Driver         "nvidia"

    VendorName     "NVIDIA Corporation"

    BusID          "PCI:1:0:0"

EndSection


Section "Device"

    Option         "UseDisplayDevice" "HDMI-0"

    Identifier     "Device1"

    Driver         "modesetting"

    VendorName     "Intel"

    BusID          "PCI:0:2:0"

EndSection


Section "Screen"

    Identifier     "Screen0"

    Device         "Device0"

    Monitor        "Monitor0"

    DefaultDepth    24

    SubSection     "Display"

    Depth           24

    EndSubSection

EndSection


Section "Screen"

    Identifier     "Screen1"

    Device         "Device1"

    Monitor        "Monitor1"

    DefaultDepth    24

    SubSection     "Display"

    Depth            24

    EndSubSection

EndSection
```

it works partially because I've reached the situation I had at the beginning,when I'd used the old intel driver. So,using i915kms in modesetting mode or the old xf86-video-intel driver (inside xorg.conf the driver is called "intel" ) produce the same situation.  My mouse can go across the Secondary screen,but HDMI-0 is disconnected. I would like to run xfce4 there,but I can't. I can export the konsole and I can run chrome on the secondary monitor,but firefox can't be exported such as a lot of other applications will run only on the DP-0 monitor.


```
# xrandr -q


Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  59.94    50.00
   1680x1050     59.95
   1440x900      59.89
   1280x1024     75.02    60.02
   1280x960      60.00
   1280x720      60.00    59.94    50.00
   1024x768      75.03    70.07    60.00
   800x600       75.00    72.19    60.32    56.25
   720x576       50.00
   720x480       59.94
   640x480       75.00    72.81    59.94    59.93
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
```

there is no way. Today I've attached the two monitors to one only gpu (nvidia 1060) and it also didn't work.


----------



## ziomario (Jul 27, 2022)

Tenacity always win. And we have a lot. Our fuel is the "love" we feel for FreeBSD,I think. With the help of you all I've found the working configuration. Now I have two monitors connected :


```
# xrandr -q

Screen 0: minimum 8 x 8, current 3200 x 1080, maximum 32767 x 32767
DVI-D-0 disconnected (normal left inverted right x axis y axis)
DP-0 connected 1920x1080+1280+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+  59.94    50.00
   1680x1050     59.95
   1440x900      59.89
   1280x1024     75.02    60.02
   1280x960      60.00
   1280x720      60.00    59.94    50.00
   1024x768      75.03    70.07    60.00
   800x600       75.00    72.19    60.32    56.25
   720x576       50.00
   720x480       59.94
   640x480       75.00    72.81    59.94    59.93
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm
   1280x1024     60.02*+  75.02
   1920x1080     59.94
   1280x960      60.00
   1280x720      59.94
   1152x864      75.00
   1024x768      75.03    70.07    60.00
   800x600       75.00    72.19    60.32    56.25
   720x480       59.94    59.94
   640x480       75.00    72.81    59.94
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
```

And Infact I can move the windows from a screen to another one. I've even created some application launcher on the monitor 2. What I don't know how to do is how to create a new taskbar at the bottom of the monitor 2 (HDMI-0). I've been able only to create the thunar,firefox and konsole launchers. Another thing to change is to invert the monitors. I mean. As soon as FreeBSD boot,I see the boot messages on the HDMI-0 monitor (the samsung synchmaster),instead I want to see them on the AOC monitor. Later,when FreeBSD is ready to be used and the desktop manager has been loaded on the samsung screen,it enables also the AOC monitor. I would like to do the opposite. And the last thing that it's not so good is that if I want to use the monitor that's in front of my eyes (AOC) I should move the mouse on the right side of the monitor that's on my right (samsung synchmaster). Anyway,this is the xorg.conf file that I have created :


```
Section "ServerLayout"

    Identifier     "X.org Configured"

    Screen      0  "Screen0" 0 0

    Screen      1  "Screen1" RightOf "Screen0"

    InputDevice    "Mouse0" "CorePointer"

    InputDevice    "Keyboard0" "CoreKeyboard"

EndSection


Section "Files"

    ModulePath   "/usr/local/lib/xorg/modules"

    FontPath     "/usr/local/share/fonts/misc/"

    FontPath     "/usr/local/share/fonts/TTF/"

    FontPath     "/usr/local/share/fonts/OTF/"

    FontPath     "/usr/local/share/fonts/Type1/"

    FontPath     "/usr/local/share/fonts/100dpi/"

    FontPath     "/usr/local/share/fonts/75dpi/"

    FontPath     "catalogue:/usr/local/etc/X11/fontpath.d"

EndSection


Section "Module"

    Load  "glx"

EndSection


Section "InputDevice"

    Identifier  "Keyboard0"

    Driver      "kbd"

EndSection


Section "InputDevice"

    Identifier  "Mouse0"

    Driver      "mouse"

    Option        "Protocol" "auto"

    Option        "Device" "/dev/sysmouse"

    Option        "ZAxisMapping" "4 5 6 7"

EndSection


Section "Monitor"

    Identifier   "Monitor0"

    VendorName   "Monitor Vendor"

    ModelName    "Monitor Model"

EndSection


Section "Monitor"

    Identifier   "Monitor1"

    VendorName   "Monitor Vendor"

    ModelName    "Monitor Model"

EndSection


Section "Device"

Identifier  "Card0"

Driver      "nvidia"

BusID       "PCI:1:0:0"

EndSection


Section "Screen"

    Identifier "Screen0"

    Device     "Card0"

    Monitor    "Monitor0"

    SubSection "Display"

        Viewport   0 0

        Depth     1

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     4

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     8

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     15

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     16

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     24

    EndSubSection

EndSection


Section "Screen"

    Identifier "Screen1"

    Device     "Card0"

    Monitor    "Monitor1"

    SubSection "Display"

        Viewport   0 0

        Depth     1

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     4

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     8

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     15

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     16

    EndSubSection

    SubSection "Display"

        Viewport   0 0

        Depth     24

    EndSubSection

EndSection
```


----------



## tyson (Jul 27, 2022)

ziomario said:


> Tenacity always win. And we have a lot. Our fuel is the "love" we feel for FreeBSD,I think. With the help of you all I've found the working configuration. Now I have two monitors connected :
> 
> 
> ```
> ...


Im surprised it works as you already had  very similar configs done.
Still what I’d use is remove *all* configs, as everything is auto configured now. Only one thing you should put in your config been posted several times in this thread by multiple people, and it include *only* the driver section. No server layout section, because if you add it you have to add whole screen configuration manually.
This whole thread is like watching blind person asking other people how colors look like.


----------



## ziomario (Jul 27, 2022)

tyson said:


> Im surprised it works as you already had  very similar configs done.
> Still what I’d use is remove *all* configs, as everything is auto configured now. Only one thing you should put in your config been posted several times in this thread by multiple people, and it include *only* the driver section. No server layout section, because if you add it you have to add whole screen configuration manually.
> This whole thread is like watching blind person asking other people how colors look like.



----> This whole thread is like watching blind person asking other people how colors look like :

I don't understand this.

I think that the devil is on the details. So,if you look carefully,maybe you will see some little differences between the configurations that haven't worked and this.

----> Only one thing you should put in your config been posted several times in this thread by multiple people, and it include *only* the driver section.

yes,I did that already. It is in some old message. Did u read old messages ?

---> Still what I’d use is remove *all* configs, as everything is auto configured now.

thanks. I did this,also. It is in some old message. Maybe you have read old messages too fast.

Man,can I ask you a little favor ? can you read some of the old messages ? I really dislike that you scold me because In your opinion I shouldn't do (or I should do) something,but you make a mistake,because the task that I should do,I have usually already tried it,but you can't know this,because you usually don't do that. So,in your eyes I become like someone that does not want to follow the suggestions,but this is not true. I've already followed the suggestions that have been given to me,when you weren't connected here. After having said that,I have already tried without xorg.conf and with the small xorg.conf written by SirDice but it didn't work.


----------



## ziomario (Jul 27, 2022)

Anyway it seems there is a bug. If I turn off one monitor,all the icons on the desktop and the background images applied are broken and when I move a window from a screen to another one I see that it will not be of the same size of the screen anymore. I presume that if I turn off a monitor physically,it will be turned off also virtually. And when I turn it on again,it remains turned off virtually.


----------

