# Xorg automatic configuration fails / Please assist with Xorg -configure



## Tecuma (Apr 18, 2020)

Hi Community,

I have a new system with the following components

CPU AMD Ryzen 3900X
GPU Sapphire Nitro Radeon 5700XT
Mainboard MSI X570 MEG ACE

I installed FreeBSD 12.1, using packages via pkg and UEFI.
I have installed amongst others

drm-kmod
xf86-video-amdgpu-19.1.0_1
In /etc/rc.conf I have
_kld_list=/boot/modules/amdgpu.ko_

In /etc/sysctl.conf I have
_ kern.evdev.rcpt_mask=6_

According to the FreeBSD handbook you should create a manually Xorg config when the auto detection is not working.
I created a config via Xorg :0 -configure to create a xorg.conf. I copied this file to /usr/local/etc/X11/xorg.conf.d/.

There is still the error message in the Xorg log file that no screen was found according to matching config section.

Did I miss something in the xorg.conf?

xorg.conf

Xorg log file: 

Best regards

—Christian


----------



## twllnbrck (Apr 19, 2020)

Hi.
First you can delete the x11-drivers/xf86-video-amdgpu driver cause xf86-video-*** drivers are not to be used with the drm kernel modules.
Then use quotes in your /etc/rc.conf entry

```
kld_list="${kld_list} /boot/modules/amdgpu.ko"
```
Next delete your generated xorg config files in /etc/X11/ and /usr/local/etc/X11/xorg.conf.d and try again with `Xorg -retro`. Check the xorg log file and create only small files in xorg.conf.d if something went wrong. Dont use an autogenerated xorg.conf. E.g. I only have /usr/local/etc/X11/xorg.conf.d/20-keyboard.conf for configuring german keyboard layout.

BTW, do you really need 4 screens as indicated by your xorg.conf?


----------



## Tecuma (Apr 19, 2020)

Hello *twllnbrck,*
thank you for your answer.

The 4 screens I do not need. This comes from the generated configuration.

When I follow your suggestion I got the following in Xorg log file:

```
[    22.931]
X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
[    22.931] Build Operating System: FreeBSD 12.1-RELEASE-p3 amd64
[    22.931] Current Operating System: FreeBSD freebee.i.os-plus.de 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC amd64
[    22.931] Build Date: 02 April 2020  10:19:53AM
[    22.931] 
[    22.931] Current version of pixman: 0.38.4
[    22.931]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[    22.931] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    22.931] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Apr 19 15:33:43 2020
[    22.933] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[    22.933] (==) No Layout section.  Using the first Screen section.
[    22.933] (==) No screen section available. Using defaults.
[    22.933] (**) |-->Screen "Default Screen Section" (0)
[    22.933] (**) |   |-->Monitor "<default monitor>"
[    22.934] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[    22.934] (==) Automatically adding devices
[    22.934] (==) Automatically enabling devices
[    22.934] (==) Not automatically adding GPU devices
[    22.934] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    22.936] (==) FontPath set to:
    /usr/local/share/fonts/misc/,
    /usr/local/share/fonts/TTF/,
    /usr/local/share/fonts/OTF/,
    /usr/local/share/fonts/Type1/,
    /usr/local/share/fonts/100dpi/,
    /usr/local/share/fonts/75dpi/,
    catalogue:/usr/local/etc/X11/fontpath.d
[    22.936] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[    22.936] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[    22.936] (II) Loader magic: 0x42e020
[    22.936] (II) Module ABI versions:
[    22.936]     X.Org ANSI C Emulation: 0.4
[    22.936]     X.Org Video Driver: 24.1
[    22.936]     X.Org XInput driver : 24.1
[    22.936]     X.Org Server Extension : 10.0
[    22.936] (--) PCI:*(47@0:0:0) 1002:731f:1da2:e409 rev 193, Mem @ 0xe0000000/268435456, 0xf0000000/2097152, 0xfcb00000/524288, I/O @ 0x0000f000/256, BIOS @ 0x????????/65536
[    22.936] (II) LoadModule: "glx"
[    22.936] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[    22.944] (II) Module glx: vendor="X.Org Foundation"
[    22.944]     compiled for 1.20.8, module version = 1.0.0
[    22.944]     ABI class: X.Org Server Extension, version 10.0
[    22.944] (==) Matched ati as autoconfigured driver 0
[    22.944] (==) Matched modesetting as autoconfigured driver 1
[    22.944] (==) Matched scfb as autoconfigured driver 2
[    22.944] (==) Matched vesa as autoconfigured driver 3
[    22.944] (==) Assigned the driver to the xf86ConfigLayout
[    22.944] (II) LoadModule: "ati"
[    22.944] (WW) Warning, couldn't open module ati
[    22.944] (EE) Failed to load module "ati" (module does not exist, 0)
[    22.944] (II) LoadModule: "modesetting"
[    22.944] (II) Loading /usr/local/lib/xorg/modules/drivers/modesetting_drv.so
[    22.945] (II) Module modesetting: vendor="X.Org Foundation"
[    22.945]     compiled for 1.20.8, module version = 1.20.8
[    22.945]     Module class: X.Org Video Driver
[    22.945]     ABI class: X.Org Video Driver, version 24.1
[    22.945] (II) LoadModule: "scfb"
[    22.945] (II) Loading /usr/local/lib/xorg/modules/drivers/scfb_drv.so
[    22.945] (II) Module scfb: vendor="X.Org Foundation"
[    22.945]     compiled for 1.20.8, module version = 0.0.5
[    22.945]     ABI class: X.Org Video Driver, version 24.1
[    22.945] (II) LoadModule: "vesa"
[    22.945] (II) Loading /usr/local/lib/xorg/modules/drivers/vesa_drv.so
[    22.945] (II) Module vesa: vendor="X.Org Foundation"
[    22.945]     compiled for 1.20.8, module version = 2.4.0
[    22.945]     Module class: X.Org Video Driver
[    22.945]     ABI class: X.Org Video Driver, version 24.1
[    22.945] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    22.945] (II) scfb: driver for wsdisplay framebuffer: scfb
[    22.945] (II) VESA: driver for VESA chipsets: vesa
[    22.945] (--) Using syscons driver with X support (version 2.0)
[    22.945] (--) using VT number 9

[    22.945] (EE) open /dev/dri/card0: No such file or directory
[    22.945] (WW) Falling back to old probe method for modesetting
[    22.945] (EE) open /dev/dri/card0: No such file or directory
[    22.945] (WW) Falling back to old probe method for scfb
[    22.945] scfb trace: probe start
[    22.945] (II) scfb(1): using default device
[    22.945] scfb trace: probe done
[    22.945] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    22.945] (EE) Screen 0 deleted because of no matching config section.
[    22.945] (II) UnloadModule: "modesetting"
[    22.945] (EE)
Fatal server error:
[    22.945] (EE) Cannot run in framebuffer mode. Please specify busIDs        for all framebuffer devices
[    22.945] (EE)
[    22.945] (EE)
Please consult the The X.Org Foundation support
     at http://wiki.x.org
 for help.
[    22.945] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    22.945] (EE)
[    22.945] (EE) Server terminated with error (1). Closing log file.
```

I assume that I have to provide the gpu with the proper PCI bus number so I created driver-amd.conf file in /usr/local/etc/X11/xorg.conf.d/ with

```
Section "Device"
   Identifier   "Card0"
   Driver       "amdgpu"
   BusID        "PCI:47:0:0"
EndSection
```

When I try to start again Xorg -retro I got

```
[   522.542]
X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
[   522.542] Build Operating System: FreeBSD 12.1-RELEASE-p3 amd64
[   522.542] Current Operating System: FreeBSD freebee.i.os-plus.de 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC amd64
[   522.542] Build Date: 02 April 2020  10:19:53AM
[   522.542] 
[   522.542] Current version of pixman: 0.38.4
[   522.542]     Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[   522.542] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   522.542] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Apr 19 15:42:03 2020
[   522.542] (==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
[   522.542] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[   522.542] (==) No Layout section.  Using the first Screen section.
[   522.542] (==) No screen section available. Using defaults.
[   522.542] (**) |-->Screen "Default Screen Section" (0)
[   522.542] (**) |   |-->Monitor "<default monitor>"
[   522.542] (==) No device specified for screen "Default Screen Section".
    Using the first device section listed.
[   522.542] (**) |   |-->Device "Card0"
[   522.542] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[   522.542] (==) Automatically adding devices
[   522.542] (==) Automatically enabling devices
[   522.542] (==) Not automatically adding GPU devices
[   522.542] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   522.542] (==) FontPath set to:
    /usr/local/share/fonts/misc/,
    /usr/local/share/fonts/TTF/,
    /usr/local/share/fonts/OTF/,
    /usr/local/share/fonts/Type1/,
    /usr/local/share/fonts/100dpi/,
    /usr/local/share/fonts/75dpi/,
    catalogue:/usr/local/etc/X11/fontpath.d
[   522.542] (==) ModulePath set to "/usr/local/lib/xorg/modules"
[   522.542] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[   522.542] (II) Loader magic: 0x42e020
[   522.542] (II) Module ABI versions:
[   522.542]     X.Org ANSI C Emulation: 0.4
[   522.542]     X.Org Video Driver: 24.1
[   522.542]     X.Org XInput driver : 24.1
[   522.542]     X.Org Server Extension : 10.0
[   522.542] (--) PCI:*(47@0:0:0) 1002:731f:1da2:e409 rev 193, Mem @ 0xe0000000/268435456, 0xf0000000/2097152, 0xfcb00000/524288, I/O @ 0x0000f000/256, BIOS @ 0x????????/65536
[   522.542] (II) LoadModule: "glx"
[   522.542] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[   522.543] (II) Module glx: vendor="X.Org Foundation"
[   522.543]     compiled for 1.20.8, module version = 1.0.0
[   522.543]     ABI class: X.Org Server Extension, version 10.0
[   522.543] (II) LoadModule: "amdgpu"
[   522.543] (WW) Warning, couldn't open module amdgpu
[   522.543] (EE) Failed to load module "amdgpu" (module does not exist, 0)
[   522.543] (EE) No drivers available.
[   522.543] (EE)
Fatal server error:
[   522.543] (EE) no screens found(EE)
[   522.543] (EE)
Please consult the The X.Org Foundation support
     at http://wiki.x.org
 for help.
[   522.543] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[   522.543] (EE)
[   522.543] (EE) Server terminated with error (1). Closing log file.
```

From your feedback I understand that amdgpu should be in the drm-kmod package. 
I have installed

```
drm-fbsd12.0-kmod-4.16.g20200221 DRM modules for the linuxkpi-based KMS components
drm-kmod-g20190710             Metaport of DRM modules for the linuxkpi-based KMS components
```
Are these not the proper ones?

Regards

--Christian


----------



## twllnbrck (Apr 19, 2020)

Yes these are the proper ones.
Im not so familiar with amd radeon cards but maybe 5700er series needs radeonkms instead of amdgpu.ko cause the amdgpu module could not load.


----------



## shkhln (Apr 19, 2020)

twllnbrck said:


> First you can delete the x11-drivers/xf86-video-amdgpu driver cause xf86-video-*** drivers are not to be used with the drm kernel modules.



That's actually not correct, xf86-video-amdgpu is not even deprecated afaik. Although I have no idea whether it makes sense against the modesetting driver.


----------



## shkhln (Apr 19, 2020)

Tecuma said:


> GPU Sapphire Nitro Radeon 5700XT



Too new, not supported yet.


----------



## Tecuma (Apr 19, 2020)

@*shkhln*
Thank you. 
Do you please have a link where I can check to see when it is supported.


----------



## shkhln (Apr 20, 2020)

That's a bit tough. You need to periodically check https://github.com/FreeBSDDesktop/kms-drm to see whether there is any progress towards porting Linux 5.3+ changes.


----------



## Tecuma (Apr 20, 2020)

Thank you for the information. I have checked the link about kms-drm driver. It looks indeed tough.

I had some ideas today to install Arch Linux and see what I get there but I would like to use FreeBSD as I actually prefer it much more than Linux. I am a bit sad as my new system should run again FreeBSD after 20 years with Linux (and some MACs).

So I have ordered another SSD and will play a bit with FreeBSD current


----------

