5.4.5. Video Cards - should I install graphics/drm-kmod?

Hello,
I am installing FreeBSD for the first time and I got stuck at 5.4.5. Video Cards in Handbook.

I am now installing on old PC to try it out but I am interested in general steps.

I identified my GPU as Radeon HD 4000 RV730 XT. So I figured I'll need to modify config file accordingly:

Code:
/usr/local/etc/X11/xorg.conf.d/driver-radeon.conf

Section "Device"
    Identifier "Card0"
    Driver     "radeon"
EndSection

However I do not understand how to use graphics/drm-kmod. Am I supposed to run make install and it will figure out automatically what to install?

I am sorry if this is obvious. I read the Handbook from the start but I am probably missing some clue on how to figure this out.
 
OP
asmar
I followed the guide and set the driver to radeonkms. I also installed drm-kmod. drm-legacy-kmod was installed automatically.

However, startx does not work. In /var/log/Xorg.0.log I found:

Code:
(WW) Warning, couldn't open module radeonkms
(EE) Failed to load module "radeonkms" (module does not exist, 0)
(EE) No drivers available.
(EE) Fatal server error:
(EE) no screens found(EE)

I also modified /etc/rc.conf:
Code:
kld_list="/boot/modules/radeonkms.ko"
 
For RV730 it should be "radeonkms" , "drm-kmod". Try drm-kmod in stead of legacy.
Try to remove drm-legacy-kmod-...
Maybe you should install drm-fbsd...-kmod-...
"For newer Intel and AMD hardware, please use graphics/drm-kmod which will pick an appropriate driver for your system"
 
I followed the guide and set the driver to radeonkms.
(WW) Warning, couldn't open module radeonkms
(EE) Failed to load module "radeonkms" (module does not exist, 0)
(EE) No drivers available.
I also modified /etc/rc.conf:

Disable /usr/local/etc/X11/xorg.conf.d/driver-radeon.conf by renaming, e.g. driver-radeon.conf.0, or delete it . graphics/drm-legacy-kmod doesn’t need a [EDIT:driver] config file. Make sure you are in the video group: 5.4.2. User Group for Accelerated Video
 
OP
asmar
Disable /usr/local/etc/X11/xorg.conf.d/driver-radeon.conf by renaming, e.g. driver-radeon.conf.0, or delete it . graphics/drm-legacy-kmod doesn’t need a [EDIT:driver] config file. Make sure you are in the video group: 5.4.2. User Group for Accelerated Video
I renamed the config file. X now starts however the screen gets disconnected and monitor doesn't detect any input. From the /var/log/Xorg.0.log:
Code:
(WW) Falling back to old probe method for modesetting
(WW) Falling back to old probe method for scfb
...
(WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
...
(WW) RADEON(0): 3 ZaphoHeads crtcs unavailable. Some outputs will stay off.
...
(WW) RADEON(0): Failed to set mode on CRTC 0
(EE) RADEON(0): Failed to enable any CRTC

I forgot to mention that X works with VESA driver if that's helpful.

I also tried to replace xf86-video-ati with xf86-video-ati-legacy by installing a port. However I got:
Code:
===>>> Port directory: /usr/ports/x11-drivers/xf86-video-ati-legacy

===>>> This port is marked BROKEN
===>>> does not build with xorg-server 1.20.7
 
OP
asmar
From startx itself:
Code:
drmn0: error: No GEM object associated to handle 0x00000400 can't create framebuffer
failed to add FB for modeset
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Internal error: Could not resolve keysym XF86FullScreen
 
OP
asmar
Back at these errors.
I followed the guide and set the driver to radeonkms. I also installed drm-kmod. drm-legacy-kmod was installed automatically.

However, startx does not work. In /var/log/Xorg.0.log I found:

Code:
(WW) Warning, couldn't open module radeonkms
(EE) Failed to load module "radeonkms" (module does not exist, 0)
(EE) No drivers available.
(EE) Fatal server error:
(EE) no screens found(EE)

I also modified /etc/rc.conf:
Code:
kld_list="/boot/modules/radeonkms.ko"
 
If you use drm-kmod it's good to check if there is not more than one video card in the PC with
pciconf -lv.
If there is more than one set the pci id in xorg.conf
And don't specify a driver.
 
OP
asmar
If you use drm-kmod it's good to check if there is not more than one video card in the PC with
pciconf -lv.
If there is more than one set the pci id in xorg.conf
And don't specify a driver.
I found no other video card.
I commented out the driver name but then it results in load of radeon instead of radeonkms and screen goes blank/off.
 
OP
asmar
What's the output of :
cat /var/log/Xorg.0.log | grep -i driver
What you requested plus error in different part of log file in an image, sorry.
 

Attachments

  • USER_SCOPED_TEMP_DATA_orca-image--866983801.jpeg
    USER_SCOPED_TEMP_DATA_orca-image--866983801.jpeg
    755.1 KB · Views: 159
OP
asmar
Ok, I finally managed to connect USB drive and copy it. 😄

Code:
[asmar@pent4FBSD ~]$ grep -i drive /var/log/Xorg.0.log
[    61.484]     X.Org Video Driver: 24.1
[    61.484]     X.Org XInput driver : 24.1
[    61.590] (==) Matched ati as autoconfigured driver 0
[    61.590] (==) Matched modesetting as autoconfigured driver 1
[    61.590] (==) Matched scfb as autoconfigured driver 2
[    61.590] (==) Matched vesa as autoconfigured driver 3
[    61.590] (==) Assigned the driver to the xf86ConfigLayout
[    61.591] (II) Loading /usr/local/lib/xorg/modules/drivers/ati_drv.so
[    61.606]     Module class: X.Org Video Driver
[    61.606]     ABI class: X.Org Video Driver, version 24.1
[    61.609] (II) Loading /usr/local/lib/xorg/modules/drivers/radeon_drv.so
[    61.657]     Module class: X.Org Video Driver
[    61.657]     ABI class: X.Org Video Driver, version 24.1
[    61.658] (II) Loading /usr/local/lib/xorg/modules/drivers/modesetting_drv.so
[    61.670]     Module class: X.Org Video Driver
[    61.670]     ABI class: X.Org Video Driver, version 24.1
[    61.670] (II) Loading /usr/local/lib/xorg/modules/drivers/scfb_drv.so
[    61.682]     ABI class: X.Org Video Driver, version 24.1
[    61.682] (II) Loading /usr/local/lib/xorg/modules/drivers/vesa_drv.so
[    61.690]     Module class: X.Org Video Driver
[    61.690]     ABI class: X.Org Video Driver, version 24.1
[    61.690] (II) RADEON: Driver for ATI/AMD Radeon chipsets:
[    61.699] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    61.699] (II) scfb: driver for wsdisplay framebuffer: scfb
[    61.699] (II) VESA: driver for VESA chipsets: vesa
[    61.699] (--) Using syscons driver with X support (version 2.0)
[    67.020] (II) RADEON(0): [DRI2]   DRI driver: r600
[    67.020] (II) RADEON(0): [DRI2]   VDPAU driver: r600
[    68.119]     Module class: X.Org XInput Driver
[    68.119]     ABI class: X.Org XInput driver, version 24.1
[    68.119] (II) Using input driver 'libinput' for 'System mouse'
[    68.309] (II) Using input driver 'libinput' for 'System keyboard multiplexer'
[    68.467] (II) Using input driver 'libinput' for 'AT keyboard'
 
Ok, I finally managed to connect USB drive and copy it.

Please install misc/pastebinit . Use it next time, usage: cat /var/log/Xorg.0.log | pastebinit, that will return a URL, post that URL.

Please post the output (URL) of pciconf -lv | grep -B3 display | pastebinit , to make sure the correct driver is used. I'm unsure which driver is used at the moment, please clarify.
 
OP
asmar
Please install misc/pastebinit . Use it next time, usage: cat /var/log/Xorg.0.log | pastebinit, that will return a URL, post that URL.

Please post the output (URL) of pciconf -lv | grep -B3 display | pastebinit , to make sure the correct driver is used. I'm unsure which driver is used at the moment, please clarify.

Currently, drivers are not selected explicitly and commented out as requested previously. I see I misread name of the graphics card. I apologize for that.

pciconf -lv | grep -B3 display: https://pastebin.com/PYbLvw8r

/etc/rc.conf: https://pastebin.com/9FJcpJxD

/usr/local/etc/X11/xorg.conf.d/driver-radeon.conf: https://pastebin.com/nMpfUbwE

pkg info | grep -i xf86-video: https://pastebin.com/W0xNCXBS

I switched to a different monitor and connected it using VGA instead of DVI. After startx, the screen still goes to sleep on Alt-F9. Switching back to Alt-F1:
kldstat: https://pastebin.com/srgyTbgB
 
I see I misread name of the graphics card. I apologize for that.
Don’t worry, no problem.

Currently, drivers are not selected explicitly and commented out as requested previously.

The output of /etc/rc.conf: https://pastebin.com/9FJcpJxD
Code:
#kld_list="/boot/modules/radeonkms.ko"
and kldstat: https://pastebin.com/srgyTbgB
Code:
1 0x1ac04000    c9000 radeonkms.ko
1 0x1accd000    4a000 drm2.ko
4 0x1ad17000     7000 iicbus.ko
1 0x1ad1e000     5000 iic.ko
1 0x1ad23000     7000 iicbb.ko
1 0x1ad2a000     4000 radeonkmsfw_RV730_pfp.ko
1 0x1ad2e000     5000 radeonkmsfw_RV730_me.ko
1 0x1ad33000     5000 radeonkmsfw_R700_rlc.ko
doesn’t end up. From where is radeonkms.ko loaded? Have you something set in /boot/loader.conf, or did you load it manually?

I believe that x11-drivers/xf86-video-ati is the needed driver. Make sure it’s installed: pkg info | grep xf86-video-ati , set in /usr/local/etc/X11/xorg.conf.d/driver-radeon.conf:
Code:
Section "Device"
    Identifier "Card0"
    Driver     "radeon"
EndSection

run startx, report back about the result, and please post /var/log/Xorg.0.log.
 
OP
asmar
From where is radeonkms.ko loaded?
I believe it is loaded automatically since I didn't modify any other files and didn't load it manually. In /boot/loader.conf is only fuse.

The driver is installed as per: https://pastebin.com/W0xNCXBS

Section "Device" Identifier "Card0" Driver "radeon" EndSection
I saved the log before any setting and after this setting.

Before: https://pastebin.com/8KAiMRLB
After: https://pastebin.com/7ivBK7zd

Diff between before and after: https://pastebin.com/RAFxupw2

It seems to load the same kernel modules anyway. Just as a side note, on the wiki, it says to use radeonkms for similar cards and not radeon. Though as demonstrated earlier it doesn't work with either. https://wiki.freebsd.org/Graphics/AMD-GPU-Matrix
 
You should actually read /var/log/Xorg.0.log at least once, it's very clear from the log what Xorg calls "module" and what it tries to load.
 
OP
asmar
You should actually read /var/log/Xorg.0.log at least once, it's very clear from the log what Xorg calls "module" and what it tries to load.
Yes, I have read it many, many times by now. And yes, I saw that it loads modules ati_drv.so and radeon_drv.so. But I also read the man page for kldstat which says "The kldstat utility displays the status of any files dynamically linked into the kernel."

And as far as I know .ko stands for "kernel object". Thus I called it kernel module. EDIT: As in radeonkms.ko.
 
It seems to load the same kernel modules anyway. Just as a side note, on the wiki, it says to use radeonkms for similar cards and not radeon.
Not quite, there are two radeon driver from different packages. The wiki is referring to the radeonkms.ko driver installed by graphics/drm-kmod (graphics/drm-fbsd12.0-kmod actually, run pkg info -l drm-fbsd12.0-kmod), whereas radeon_drv.so (aka radeon) is installed by x11-drivers/xf86-video-ati.

- radeonkms.ko is set in rc.conf(5), loaded by kldload(2)
- radeon_drv.so, aka "radeon”, is set in /usr/local/etc/X11/xorg.conf.d/driver-radeon.conf, loaded by xorg.

Concerning the Xorg.0.logs:
Code:
[   475.804] failed to add FB for modeset
[   475.804] (WW) RADEON(0): Failed to set mode on CRTC 0
[   475.812] (EE) RADEON(0): Failed to enable any CRTC
(https://pastebin.com/8KAiMRLB, https://pastebin.com/7ivBK7zd9 )

There is an older bug report PR 232499 regarding x11-drivers/xf86-video-ati and the error messages. Op is reporting being successful with, x11-drivers/xf86-video-ati-legacy. You could try that driver, but it is currently marked as broken, a patch is available, easy to apply.
 
OP
asmar
Not quite, there are two radeon driver from different packages. The wiki is referring to the radeonkms.ko driver installed by graphics/drm-kmod (graphics/drm-fbsd12.0-kmod actually, run pkg info -l drm-fbsd12.0-kmod), whereas radeon_drv.so (aka radeon) is installed by x11-drivers/xf86-video-ati.

- radeonkms.ko is set in rc.conf(5), loaded by kldload(2)
- radeon_drv.so, aka "radeon”, is set in /usr/local/etc/X11/xorg.conf.d/driver-radeon.conf, loaded by xorg.

Concerning the Xorg.0.logs:
Code:
[   475.804] failed to add FB for modeset
[   475.804] (WW) RADEON(0): Failed to set mode on CRTC 0
[   475.812] (EE) RADEON(0): Failed to enable any CRTC
(https://pastebin.com/8KAiMRLB, https://pastebin.com/7ivBK7zd9 )

There is an older bug report PR 232499 regarding x11-drivers/xf86-video-ati and the error messages. Op is reporting being successful with, x11-drivers/xf86-video-ati-legacy. You could try that driver, but it is currently marked as broken, a patch is available, easy to apply.
Thank you for investigation and clarification. I ran across this bug report previously but didn't get further than the broken message.

I applied the patch and compiled. Then rebooted and started X. I am not sure what's the take on this: https://pastebin.com/iM7qVx3m

EDIT: I also removed the xf86-video-ati.
 
Top