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

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:
Code:
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:
Code:
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:
Code:
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.
 
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
 
tyson : let's make a recap. I tried your configuration. This is how I have adapted it in my specific situation :

Code:
/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 :

index.jpg
 
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.
 
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.
 
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.
 
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.
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. 😆
 
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.
 
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.
 
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.

Code:
# /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


Code:
# /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:
Code:
pciconf -l -v | grep -A 4 vgapci
 
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.

Code:
# /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


Code:
# /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:
Code:
pciconf -l -v | grep -A 4 vgapci

Code:
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
 
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.

Code:
# /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


Code:
# /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:
Code:
pciconf -l -v | grep -A 4 vgapci

nothing special with this configuration. Xorg started without problems,but my monitor is still black and dead,no mouse cursor accross it.
 
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.
 
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).
 
nothing special with this configuration. Xorg started without problems,but my monitor is still black and dead,no mouse cursor accross it.

nothing special with this configuration. Xorg started without problems,but my monitor is still black and dead,no mouse cursor accross it.Which
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?
 
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.

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.
 
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.
 
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.
 
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.

 
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.

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


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.
 
Back
Top