FreeBSDDesktop / DEPRECATED-freebsd-base-graphics

Fork of FreeBSD's base repository to work on graphics-stack-related projects
Other
49 stars 13 forks source link

[amdgpu] where is "amdgpu_dri.so"? #134

Closed freebsd-nils-level1 closed 7 years ago

freebsd-nils-level1 commented 7 years ago

Hi,

playing around with "drm-next" and the "amdgpu" kernel module; it loads and runs after several tries:

X.Org X Server 1.18.4
Release Date: 2016-07-19
[   447.150] X Protocol Version 11, Revision 0
[   447.150] Build Operating System: FreeBSD 12.0-CURRENT amd64
[   447.150] Current Operating System: FreeBSD asbach.renzel.net 12.0-CURRENT FreeBSD 12.0-CURRENT #0 334829e6c(drm-next)-dirty: Tue Mar 28 15:20:53 CEST 2017     root@asbach.renzel.net:/usr/obj/root/work/src/freebsd-base-graphics/sys/GENERIC amd64
[   447.150] Build Date: 25 March 2017  01:14:55PM
[   447.150]  
[   447.150] Current version of pixman: 0.34.0
[   447.150]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[   447.150] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   447.150] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Mar 30 16:33:56 2017
[   447.150] (==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
[   447.150] (==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
[   447.150] (==) ServerLayout "X.org Configured"
[   447.150] (**) |-->Screen "Screen0" (0)
[   447.150] (**) |   |-->Monitor "Monitor0"
[   447.150] (**) |   |-->Device "Card0"
[   447.150] (**) |-->Input Device "Mouse0"
[   447.150] (**) |-->Input Device "Keyboard0"
[   447.150] (==) Automatically adding devices
[   447.150] (==) Automatically enabling devices
[   447.150] (==) Not automatically adding GPU devices
[   447.150] (==) Max clients allowed: 256, resource mask: 0x1fffff
[   447.151] (**) 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/,
        /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/
[   447.151] (**) ModulePath set to "/usr/local/lib/xorg/modules"
[   447.151] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[   447.151] (WW) Disabling Mouse0
[   447.151] (WW) Disabling Keyboard0
[   447.151] (II) Loader magic: 0x80cc00
[   447.151] (II) Module ABI versions:
[   447.151]    X.Org ANSI C Emulation: 0.4
[   447.151]    X.Org Video Driver: 20.0
[   447.151]    X.Org XInput driver : 22.1
[   447.151]    X.Org Server Extension : 9.0
[   447.151] (--) PCI:*(0:36:0:0) 1002:67ef:1682:9460 rev 207, Mem @ 0xe0000000/268435456, 0xf0000000/2097152, 0xfe900000/262144, I/O @ 0x0000e000/256, BIOS @ 0x????????/65536
[   447.151] (II) "glx" will be loaded. This was enabled by default and also specified in the config file.
[   447.151] (II) LoadModule: "vnc"
[   447.151] (II) Loading /usr/local/lib/xorg/modules/extensions/libvnc.so
[   447.155] (II) Module vnc: vendor="TigerVNC Project"
[   447.155]    compiled for 1.18.4, module version = 1.0.0
[   447.155]    Module class: X.Org Server Extension
[   447.155]    ABI class: X.Org Server Extension, version 9.0
[   447.155] (II) LoadModule: "glx"
[   447.155] (II) Loading /usr/local/lib/xorg/modules/extensions/libglx.so
[   447.156] (II) Module glx: vendor="X.Org Foundation"
[   447.156]    compiled for 1.18.4, module version = 1.0.0
[   447.156]    ABI class: X.Org Server Extension, version 9.0
[   447.156] (==) AIGLX enabled
[   447.156] (II) LoadModule: "amdgpu"
[   447.156] (II) Loading /usr/local/lib/xorg/modules/drivers/amdgpu_drv.so
[   447.157] (II) Module amdgpu: vendor="X.Org Foundation"
[   447.157]    compiled for 1.18.4, module version = 1.3.0
[   447.157]    Module class: X.Org Video Driver
[   447.157]    ABI class: X.Org Video Driver, version 20.0
[   447.157] (II) AMDGPU: Driver for AMD Radeon:
        All GPUs supported by the amdgpu kernel driver
[   447.157] (--) Using syscons driver with X support (version 2.0)
[   447.157] (--) using VT number 9

[   447.157] (II) [KMS] Kernel modesetting enabled.
[   447.188] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[   447.188] (==) AMDGPU(0): Depth 24, (--) framebuffer bpp 32
[   447.188] (II) AMDGPU(0): Pixel depth = 24 bits stored in 4 bytes (32 bpp pixmaps)
[   447.188] (==) AMDGPU(0): Default visual is TrueColor
[   447.188] (**) AMDGPU(0): Option "DRI" "2"
[   447.188] (**) AMDGPU(0): Option "TearFree" "true"
[   447.189] (==) AMDGPU(0): RGB weight 888
[   447.189] (II) AMDGPU(0): Using 8 bits per RGB (8 bit DAC)
[   447.189] (--) AMDGPU(0): Chipset: "AMD Radeon RX 460 Graphics" (ChipID = 0x67ef)
[   447.189] (II) Loading sub module "fb"
[   447.189] (II) LoadModule: "fb"
[   447.189] (II) Loading /usr/local/lib/xorg/modules/libfb.so
[   447.189] (II) Module fb: vendor="X.Org Foundation"
[   447.189]    compiled for 1.18.4, module version = 1.0.0
[   447.189]    ABI class: X.Org ANSI C Emulation, version 0.4
[   447.189] (II) Loading sub module "dri2"
[   447.189] (II) LoadModule: "dri2"
[   447.189] (II) Module "dri2" already built-in
[   447.367] (II) Loading sub module "glamoregl"
[   447.367] (II) LoadModule: "glamoregl"
[   447.367] (II) Loading /usr/local/lib/xorg/modules/libglamoregl.so
[   447.377] (II) Module glamoregl: vendor="X.Org Foundation"
[   447.377]    compiled for 1.18.4, module version = 1.0.0
[   447.377]    ABI class: X.Org ANSI C Emulation, version 0.4
[   447.377] (II) glamor: OpenGL accelerated X.org driver based.
[   447.380] (II) glamor: EGL version 1.4 (DRI2):
[   447.380] EGL_MESA_drm_image required.
[   447.381] (EE) AMDGPU(0): glamor detected, failed to initialize EGL.
[   447.381] (II) AMDGPU(0): KMS Pageflipping: enabled
[   447.402] (II) AMDGPU(0): Output DisplayPort-0 using monitor section Monitor0
[   447.402] (II) AMDGPU(0): Output HDMI-A-0 has no monitor section
[   447.434] (II) AMDGPU(0): Output DVI-D-0 has no monitor section
[   447.456] (II) AMDGPU(0): EDID for output DisplayPort-0
[   447.456] (II) AMDGPU(0): EDID for output HDMI-A-0
[   447.488] (II) AMDGPU(0): EDID for output DVI-D-0
[   447.488] (II) AMDGPU(0): Manufacturer: STN  Model: 28  Serial#: 1196634425
[   447.488] (II) AMDGPU(0): Year: 2006  Week: 2
[   447.488] (II) AMDGPU(0): EDID Version: 1.3
[   447.488] (II) AMDGPU(0): Digital Display Input
[   447.488] (II) AMDGPU(0): Max Image Size [cm]: horiz.: 38  vert.: 30
[   447.488] (II) AMDGPU(0): Gamma: 2.20
[   447.488] (II) AMDGPU(0): DPMS capabilities: Off
[   447.488] (II) AMDGPU(0): Supported color encodings: RGB 4:4:4 YCrCb 4:4:4 
[   447.488] (II) AMDGPU(0): First detailed timing is preferred mode
[   447.488] (II) AMDGPU(0): redX: 0.634 redY: 0.354   greenX: 0.304 greenY: 0.581
[   447.488] (II) AMDGPU(0): blueX: 0.143 blueY: 0.102   whiteX: 0.310 whiteY: 0.330
[   447.488] (II) AMDGPU(0): Supported established timings:
[   447.488] (II) AMDGPU(0): 720x400@70Hz
[   447.488] (II) AMDGPU(0): 640x480@60Hz
[   447.488] (II) AMDGPU(0): 640x480@67Hz
[   447.488] (II) AMDGPU(0): 640x480@72Hz
[   447.488] (II) AMDGPU(0): 640x480@75Hz
[   447.488] (II) AMDGPU(0): 800x600@56Hz
[   447.488] (II) AMDGPU(0): 800x600@60Hz
[   447.488] (II) AMDGPU(0): 800x600@72Hz
[   447.488] (II) AMDGPU(0): 800x600@75Hz
[   447.488] (II) AMDGPU(0): 832x624@75Hz
[   447.488] (II) AMDGPU(0): 1024x768@60Hz
[   447.488] (II) AMDGPU(0): 1024x768@70Hz
[   447.488] (II) AMDGPU(0): 1024x768@75Hz
[   447.488] (II) AMDGPU(0): 1280x1024@75Hz
[   447.488] (II) AMDGPU(0): 1152x864@75Hz
[   447.488] (II) AMDGPU(0): Manufacturer's mask: 0
[   447.488] (II) AMDGPU(0): Supported standard timings:
[   447.488] (II) AMDGPU(0): #0: hsize: 1280  vsize 1024  refresh: 60  vid: 32897
[   447.488] (II) AMDGPU(0): #1: hsize: 1152  vsize 864  refresh: 75  vid: 20337
[   447.488] (II) AMDGPU(0): Supported detailed timing:
[   447.488] (II) AMDGPU(0): clock: 108.0 MHz   Image Size:  376 x 301 mm
[   447.488] (II) AMDGPU(0): h_active: 1280  h_sync: 1328  h_sync_end 1440 h_blank_end 1688 h_border: 0
[   447.488] (II) AMDGPU(0): v_active: 1024  v_sync: 1025  v_sync_end 1028 v_blanking: 1066 v_border: 0
[   447.488] (II) AMDGPU(0): Ranges: V min: 56 V max: 75 Hz, H min: 30 H max: 81 kHz, PixClock max 145 MHz
[   447.488] (II) AMDGPU(0): Monitor name: SAMTRON
[   447.488] (II) AMDGPU(0): Serial No: H9NA115163
[   447.488] (II) AMDGPU(0): EDID (in hex):
[   447.488] (II) AMDGPU(0):    00ffffffffffff004e8e280039315347
[   447.488] (II) AMDGPU(0):    0210010380261e782a6f86a25a4d9424
[   447.488] (II) AMDGPU(0):    1a4f54bfef808180714f010101010101
[   447.488] (II) AMDGPU(0):    010101010101302a009851002a403070
[   447.488] (II) AMDGPU(0):    1300782d1100001e000000fd00384b1e
[   447.488] (II) AMDGPU(0):    510e000a202020202020000000fc0053
[   447.488] (II) AMDGPU(0):    414d54524f4e0a2020202020000000ff
[   447.488] (II) AMDGPU(0):    0048394e413131353136330a20200085
[   447.488] (II) AMDGPU(0): Printing probed modes for output DVI-D-0
[   447.488] (II) AMDGPU(0): Modeline "1280x1024"x60.0  108.00  1280 1328 1440 1688  1024 1025 1028 1066 +hsync +vsync (64.0 kHz eP)
[   447.488] (II) AMDGPU(0): Modeline "1280x1024"x75.0  135.00  1280 1296 1440 1688  1024 1025 1028 1066 +hsync +vsync (80.0 kHz e)
[   447.488] (II) AMDGPU(0): Modeline "1152x864"x75.0  108.00  1152 1216 1344 1600  864 865 868 900 +hsync +vsync (67.5 kHz e)
[   447.488] (II) AMDGPU(0): Modeline "1024x768"x75.0   78.75  1024 1040 1136 1312  768 769 772 800 +hsync +vsync (60.0 kHz e)
[   447.488] (II) AMDGPU(0): Modeline "1024x768"x70.1   75.00  1024 1048 1184 1328  768 771 777 806 -hsync -vsync (56.5 kHz e)
[   447.488] (II) AMDGPU(0): Modeline "1024x768"x60.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz e)
[   447.488] (II) AMDGPU(0): Modeline "832x624"x74.6   57.28  832 864 928 1152  624 625 628 667 -hsync -vsync (49.7 kHz e)
[   447.488] (II) AMDGPU(0): Modeline "800x600"x72.2   50.00  800 856 976 1040  600 637 643 666 +hsync +vsync (48.1 kHz e)
[   447.488] (II) AMDGPU(0): Modeline "800x600"x75.0   49.50  800 816 896 1056  600 601 604 625 +hsync +vsync (46.9 kHz e)
[   447.488] (II) AMDGPU(0): Modeline "800x600"x60.3   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz e)
[   447.489] (II) AMDGPU(0): Modeline "800x600"x56.2   36.00  800 824 896 1024  600 601 603 625 +hsync +vsync (35.2 kHz e)
[   447.489] (II) AMDGPU(0): Modeline "640x480"x75.0   31.50  640 656 720 840  480 481 484 500 -hsync -vsync (37.5 kHz e)
[   447.489] (II) AMDGPU(0): Modeline "640x480"x72.8   31.50  640 664 704 832  480 489 492 520 -hsync -vsync (37.9 kHz e)
[   447.489] (II) AMDGPU(0): Modeline "640x480"x66.7   30.24  640 704 768 864  480 483 486 525 -hsync -vsync (35.0 kHz e)
[   447.489] (II) AMDGPU(0): Modeline "640x480"x59.9   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz e)
[   447.489] (II) AMDGPU(0): Modeline "720x400"x70.1   28.32  720 738 846 900  400 412 414 449 -hsync +vsync (31.5 kHz e)
[   447.489] (II) AMDGPU(0): Output DisplayPort-0 disconnected
[   447.489] (II) AMDGPU(0): Output HDMI-A-0 disconnected
[   447.489] (II) AMDGPU(0): Output DVI-D-0 connected
[   447.489] (II) AMDGPU(0): Using exact sizes for initial modes
[   447.489] (II) AMDGPU(0): Output DVI-D-0 using initial mode 1280x1024 +0+0
[   447.489] (II) AMDGPU(0): Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.
[   447.489] (II) AMDGPU(0): mem size init: gart size :3fd3cc000 vram size: s:7d86e000 visible:d86e000
[   447.489] (==) AMDGPU(0): DPI set to (96, 96)
[   447.489] (II) Loading sub module "ramdac"
[   447.489] (II) LoadModule: "ramdac"
[   447.489] (II) Module "ramdac" already built-in
[   447.489] (--) Depth 24 pixmap format is 32 bpp
[   447.489] (II) AMDGPU(0): [DRI2] Setup complete
[   447.489] (II) AMDGPU(0): [DRI2]   DRI driver: radeonsi
[   447.489] (II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi
[   447.493] (II) AMDGPU(0): Front buffer pitch: 5120 bytes
[   447.493] (II) AMDGPU(0): SYNC extension fences enabled
[   447.493] (II) AMDGPU(0): Present extension enabled
[   447.493] (==) AMDGPU(0): DRI3 enabled
[   447.493] (==) AMDGPU(0): Backing store enabled
[   447.493] (II) AMDGPU(0): Direct rendering enabled
[   447.493] (II) AMDGPU(0): 2D acceleration disabled
[   447.493] (==) AMDGPU(0): DPMS enabled
[   447.493] (==) AMDGPU(0): Silken mouse enabled
[   447.493] (II) AMDGPU(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[   447.493] (--) RandR disabled
[   447.495] (EE) AIGLX error: Calling driver entry point failed
[   447.495] (EE) AIGLX: reverting to software rendering
[   447.496] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[   447.496] (II) AIGLX: Loaded and initialized swrast
[   447.496] (II) GLX: Initialized DRISWRAST GL provider for screen 0
[   447.496] (II) AMDGPU(0): Setting screen physical size to 338 x 270
[   447.613] (II) config/devd: probing input devices...
[   447.613] (II) config/devd: adding input device (null) (/dev/kbdmux)
[   447.613] (II) LoadModule: "kbd"
[   447.613] (II) Loading /usr/local/lib/xorg/modules/input/kbd_drv.so
[   447.613] (II) Module kbd: vendor="X.Org Foundation"
[   447.613]    compiled for 1.18.4, module version = 1.9.0
[   447.613]    Module class: X.Org XInput Driver
[   447.613]    ABI class: X.Org XInput driver, version 22.1
[   447.613] (II) Using input driver 'kbd' for 'kbdmux'
[   447.613] (**) kbdmux: always reports core events
[   447.613] (**) kbdmux: always reports core events
[   447.613] (**) Option "Protocol" "standard"
[   447.613] (**) Option "XkbRules" "base"
[   447.613] (**) Option "XkbModel" "pc105"
[   447.613] (**) Option "XkbLayout" "us"
[   447.613] (**) Option "config_info" "devd:kbdmux"
[   447.613] (II) XINPUT: Adding extended input device "kbdmux" (type: KEYBOARD, id 6)
[   447.613] (II) config/devd: kbdmux is enabled, ignoring device ukbd0
[   447.613] (II) config/devd: kbdmux is enabled, ignoring device atkbd0
[   447.613] (II) config/devd: adding input device (null) (/dev/sysmouse)
[   447.613] (II) LoadModule: "mouse"
[   447.613] (II) Loading /usr/local/lib/xorg/modules/input/mouse_drv.so
[   447.614] (II) Module mouse: vendor="X.Org Foundation"
[   447.614]    compiled for 1.18.4, module version = 1.9.2
[   447.614]    Module class: X.Org XInput Driver
[   447.614]    ABI class: X.Org XInput driver, version 22.1
[   447.614] (II) Using input driver 'mouse' for 'sysmouse'
[   447.614] (**) sysmouse: always reports core events
[   447.614] (**) Option "Device" "/dev/sysmouse"
[   447.614] (==) sysmouse: Protocol: "Auto"
[   447.614] (**) sysmouse: always reports core events
[   447.614] (==) sysmouse: Emulate3Buttons, Emulate3Timeout: 50
[   447.614] (**) sysmouse: ZAxisMapping: buttons 4 and 5
[   447.614] (**) sysmouse: Buttons: 5
[   447.614] (**) Option "config_info" "devd:sysmouse"
[   447.614] (II) XINPUT: Adding extended input device "sysmouse" (type: MOUSE, id 7)
[   447.614] (**) sysmouse: (accel) keeping acceleration scheme 1
[   447.614] (**) sysmouse: (accel) acceleration profile 0
[   447.614] (**) sysmouse: (accel) acceleration factor: 2.000
[   447.614] (**) sysmouse: (accel) acceleration threshold: 4
[   447.614] (II) sysmouse: SetupAuto: hw.iftype is 4, hw.model is 0
[   447.614] (II) sysmouse: SetupAuto: protocol is SysMouse
[   447.614] (II) config/devd: device /dev/ums0 already opened
[   504.429] (II) AMDGPU(0): EDID vendor "STN", prod id 40
[   504.430] (II) AMDGPU(0): Using EDID range info for horizontal sync
[   504.430] (II) AMDGPU(0): Using EDID range info for vertical refresh
[   504.430] (II) AMDGPU(0): Printing DDC gathered Modelines:
[   504.430] (II) AMDGPU(0): Modeline "1280x1024"x0.0  108.00  1280 1328 1440 1688  1024 1025 1028 1066 +hsync +vsync (64.0 kHz eP)
[   504.430] (II) AMDGPU(0): Modeline "800x600"x0.0   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "800x600"x0.0   36.00  800 824 896 1024  600 601 603 625 +hsync +vsync (35.2 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "640x480"x0.0   31.50  640 656 720 840  480 481 484 500 -hsync -vsync (37.5 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "640x480"x0.0   31.50  640 664 704 832  480 489 492 520 -hsync -vsync (37.9 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "640x480"x0.0   30.24  640 704 768 864  480 483 486 525 -hsync -vsync (35.0 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "640x480"x0.0   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "720x400"x0.0   28.32  720 738 846 900  400 412 414 449 -hsync +vsync (31.5 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "1280x1024"x0.0  135.00  1280 1296 1440 1688  1024 1025 1028 1066 +hsync +vsync (80.0 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "1024x768"x0.0   78.75  1024 1040 1136 1312  768 769 772 800 +hsync +vsync (60.0 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "1024x768"x0.0   75.00  1024 1048 1184 1328  768 771 777 806 -hsync -vsync (56.5 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "1024x768"x0.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "832x624"x0.0   57.28  832 864 928 1152  624 625 628 667 -hsync -vsync (49.7 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "800x600"x0.0   49.50  800 816 896 1056  600 601 604 625 +hsync +vsync (46.9 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "800x600"x0.0   50.00  800 856 976 1040  600 637 643 666 +hsync +vsync (48.1 kHz e)
[   504.430] (II) AMDGPU(0): Modeline "1152x864"x0.0  108.00  1152 1216 1344 1600  864 865 868 900 +hsync +vsync (67.5 kHz e)

3D support is my next test - unfortunately, with the original "libdrm" and "libdevq"-combo, it doesn't detect the PCI busses correctly:

#env LIBGL_DEBUG=verbose glxinfo
name of display: :0
libGL: Can't open configuration file /root/.drirc: No such file or directory.
libGL error: pci id for fd 4: 0000:0000, driver (null)
libGL error: No driver found
libGL error: failed to load driver: (null)
libGL error: pci id for fd 4: 0000:0000, driver (null)
libGL: OpenDriver: trying /usr/local/lib/dri/radeonsi_dri.so
pci id for fd 5: 0000:0000, driver (null)
libGL error: failed to create dri screen
libGL error: failed to load driver: radeonsi
libGL: OpenDriver: trying /usr/local/lib/dri/swrast_dri.so

So I've tried the not-yet-committed patch to "libdrm" as shown here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217886

Now it wants to load "amdgpu_dri.so":

#env LIBGL_DEBUG=verbose glxinfo
name of display: :0
libGL: Can't open configuration file /home/nbe/.drirc: No such file or directory.
libGL error: MESA-LOADER: failed to retrieve device information
libGL: using driver amdgpu for 4
libGL: OpenDriver: trying /usr/local/lib/dri/amdgpu_dri.so
libGL: dlopen /usr/local/lib/dri/amdgpu_dri.so failed (Cannot open "/usr/local/lib/dri/amdgpu_dri.so")
libGL error: unable to load driver: amdgpu_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: amdgpu
libGL error: MESA-LOADER: failed to retrieve device information
libGL: using driver amdgpu for 4
libGL: OpenDriver: trying /usr/local/lib/dri/amdgpu_dri.so
libGL: dlopen /usr/local/lib/dri/amdgpu_dri.so failed (Cannot open "/usr/local/lib/dri/amdgpu_dri.so")
libGL error: unable to load driver: amdgpu_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: amdgpu
libGL: OpenDriver: trying /usr/local/lib/dri/swrast_dri.so
libGL: Can't open configuration file /home/nbe/.drirc: No such file or directory.
libGL: Can't open configuration file /home/nbe/.drirc: No such file or directory.

A little search for "amdgpu_dri.so" seems to reveal that this is the closed-source AMDGPU-Pro driver from AMD itself. Checking the sysctl:

#sysctl hw.dri
hw.dri.timestamp_precision: 20
hw.dri.vblank_offdelay: 5000
hw.dri.debug: 0
hw.dri.0.modesetting: 1
hw.dri.0.busid: pci:0000:24:00.0
hw.dri.0.vblank: 
crtc ref count    last     enabled inmodeset
  00  00 02806189 00000001 00      00
  01  01 00000000 00000000 00      01
  02  01 00000000 00000000 00      01
  03  01 00000000 00000000 00      01
  04  01 00000000 00000000 00      01
hw.dri.0.bufs: 
hw.dri.0.clients: 
a dev            pid   uid      magic     ioctls
y drm/0        101792     0          0          0

hw.dri.0.vm: 
slot offset             size       type flags address            mtrr

hw.dri.0.name: amdgpu 0x199 pci:0000:24:00.0

Is that intended that it wants the closed-source variant of the mesa driver or is there a mapping missing somewhere in the loader logic?

TIA and regards, Nils

iotamudelta commented 7 years ago

Dear Nils,

I take it this is with the standard ports tree (i.e., Mesa 13)? If so, please try https://reviews.freebsd.org/D9469 which works for me. That being said, 3D is still buggy on amdgpu KMS (it'll leak memory).

Thanks!

freebsd-nils-level1 commented 7 years ago

I take it this is with the standard ports tree (i.e., Mesa 13)?

that's correct - standard ports tree rev. 437356 - Mesa 13.0.6

If so, please try https://reviews.freebsd.org/D9469 which works for me.

unfortunately, this patch doesn't apply cleanly to the current ports tree:

Hunk #1 failed at 18.
Hunk #3 failed at 75.
Hunk #4 failed at 141.
3 out of 4 hunks failed while patching graphics/libGL/Makefile.common

Probably caused by ports commit that updated Mesa to 13.0.6

r437215 | rezny | 2017-03-29 18:57:53 +0200 (Wed, 29 Mar 2017)

do you have an updated version available? Or should I downgrade my ports tree?

That being said, 3D is still buggy on amdgpu KMS (it'll leak memory).

just for fun, I've modified "src/loader/loader.c" of the libGL 13.0.6 source code so, that he returns "radeonsi" as the driver name - hardcoded. Now "glxinfo" gives me:

name of display: :0
libGL: Can't open configuration file /home/nbe/.drirc: No such file or directory.
libGL error: MESA-LOADER: failed to retrieve device information
libGL: using driver radeonsi for 4
libGL: OpenDriver: trying /usr/local/lib/dri/radeonsi_dri.so
MESA-LOADER: failed to retrieve device information
loader_get_driver_for_fd entered
MESA-LOADER: failed to retrieve device information
amdgpu: drmGetDevice failed.
do_winsys_init: DRM version is 3.8.0 but this driver is only compatible with 2.12.0 (kernel 3.2) or later.
<jemalloc>: /usr/src/contrib/jemalloc/include/jemalloc/internal/arena.h:1396: Failed assertion: "arena_mapbits_allocated_get(chunk, pageind) != 0"
Abort

I would imagine that "libdrm" is still the culprit - first wrong PCI ids (original version 2.4.75), then returning a wrong driver name (version 2.4.76 patched) and now failing at "drmGetDevice".

But I'll happily like to test Mesa 17.0.x...

iotamudelta commented 7 years ago

True, sorry for that. I'll update that patch one of these days.

Nevertheless, your observations are very interesting. I haven't tried loading 3D (b/c of the the aforementioned issues) lately, so I wonder if it broke. I'll check and update this issue in a few days.

freebsd-nils-level1 commented 7 years ago

I played around a little more. I've reverted to "libdrm-2.4.75" with "libdevq" dependency. Then I patched "libdevq" so that "devq_compare_vgapci_busaddr" always returns successfully (zero means no error, I believe):

#diff -u devel/libdevq/work/libdevq-0.0.4/src/freebsd/device.c.orig devel/libdevq/work/libdevq-0.0.4/src/freebsd/device.c
--- devel/libdevq/work/libdevq-0.0.4/src/freebsd/device.c.orig  2016-07-28 12:50:48.000000000 +0200
+++ devel/libdevq/work/libdevq-0.0.4/src/freebsd/device.c       2017-04-04 17:18:24.083966000 +0200
@@ -198,7 +198,7 @@
        int ret;
        char sysctl_name[32], sysctl_value[128];
        size_t sysctl_value_len;
-
+       return(0);
        sprintf(sysctl_name, "dev.vgapci.%d.%%location", i);

        sysctl_value_len = sizeof(sysctl_value);

now "glxinfo" looks fine:

#env LIBGL_DEBUG=verbose glxinfo | head -100
libGL: OpenDriver: trying /usr/local/lib/dri/radeonsi_dri.so
libGL: Can't open configuration file /home/nbe/.drirc: No such file or directory.
libGL: Can't open configuration file /home/nbe/.drirc: No such file or directory.
libGL: Using DRI2 for screen 0
name of display: :0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile, 
    GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, 
    GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, 
    GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB, 
    GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, 
    GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, 
    GLX_OML_swap_method, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 
    GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_SGI_swap_control
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile, 
    GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, 
    GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample, 
    GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile, 
    GLX_EXT_create_context_es_profile, GLX_EXT_fbconfig_packed_float, 
    GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context, 
    GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating, 
    GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, 
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_SGI_make_current_read, 
    GLX_SGI_swap_control, GLX_SGI_video_sync
GLX version: 1.4
GLX extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile, 
    GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, 
    GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, 
    GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB, 
    GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, 
    GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, 
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_SGI_make_current_read, 
    GLX_SGI_swap_control, GLX_SGI_video_sync
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: X.Org (0x1002)
    Device: AMD POLARIS11 (DRM 3.8.0 / 12.0-CURRENT, LLVM 4.0.0) (0x67ef)
    Version: 17.0.3
    Accelerated: yes
    Video memory: 2003MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD POLARIS11 (DRM 3.8.0 / 12.0-CURRENT, LLVM 4.0.0)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.0.3
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
    GL_AMD_conservative_depth, GL_AMD_draw_buffers_blend, 
    GL_AMD_performance_monitor, GL_AMD_pinned_memory, 
    GL_AMD_seamless_cubemap_per_texture, GL_AMD_shader_stencil_export, 
    GL_AMD_shader_trinary_minmax, GL_AMD_vertex_shader_layer, 
    GL_AMD_vertex_shader_viewport_index, GL_ARB_ES2_compatibility, 
    GL_ARB_ES3_1_compatibility, GL_ARB_ES3_2_compatibility, 
    GL_ARB_ES3_compatibility, GL_ARB_arrays_of_arrays, GL_ARB_base_instance, 
    GL_ARB_blend_func_extended, GL_ARB_buffer_storage, 
    GL_ARB_clear_buffer_object, GL_ARB_clear_texture, GL_ARB_clip_control, 
    GL_ARB_color_buffer_float, GL_ARB_compressed_texture_pixel_storage, 
    GL_ARB_compute_shader, GL_ARB_compute_variable_group_size, 
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth, 
    GL_ARB_copy_buffer, GL_ARB_copy_image, GL_ARB_cull_distance, 
    GL_ARB_debug_output, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp, 
    GL_ARB_derivative_control, GL_ARB_direct_state_access, 
    GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend, 
    GL_ARB_draw_elements_base_vertex, GL_ARB_draw_indirect, 
    GL_ARB_draw_instanced, GL_ARB_enhanced_layouts, 
    GL_ARB_explicit_attrib_location, GL_ARB_explicit_uniform_location, 
    GL_ARB_fragment_coord_conventions, GL_ARB_fragment_layer_viewport, 
    GL_ARB_fragment_shader, GL_ARB_framebuffer_no_attachments, 
    GL_ARB_framebuffer_object, GL_ARB_framebuffer_sRGB, 
    GL_ARB_get_program_binary, GL_ARB_get_texture_sub_image, 
    GL_ARB_gpu_shader5, GL_ARB_gpu_shader_fp64, GL_ARB_half_float_pixel, 
    GL_ARB_half_float_vertex, GL_ARB_indirect_parameters, 
    GL_ARB_instanced_arrays, GL_ARB_internalformat_query, 
    GL_ARB_internalformat_query2, GL_ARB_invalidate_subdata, 
    GL_ARB_map_buffer_alignment, GL_ARB_map_buffer_range, GL_ARB_multi_bind, 
    GL_ARB_multi_draw_indirect, GL_ARB_occlusion_query2, 
    GL_ARB_pipeline_statistics_query, GL_ARB_pixel_buffer_object, 
    GL_ARB_point_sprite, GL_ARB_program_interface_query, 
    GL_ARB_provoking_vertex, GL_ARB_query_buffer_object, 
    GL_ARB_robust_buffer_access_behavior, GL_ARB_robustness, 
    GL_ARB_sample_shading, GL_ARB_sampler_objects, GL_ARB_seamless_cube_map, 
    GL_ARB_seamless_cubemap_per_texture, GL_ARB_separate_shader_objects, 
    GL_ARB_shader_atomic_counter_ops, GL_ARB_shader_atomic_counters, 

KDE4 flickers like hell (compositor is active), but "tesseract-game" runs very well...

iotamudelta commented 7 years ago

Interesting, the screen corruption issues were all solved for me. Could you let us know if disabling glamor/glx/acceleration in xorg.conf makes KDE smooth?

Also, do you observe in 3D mode a memory leak (swap will be exhausted eventually, causing reset)?

freebsd-nils-level1 commented 7 years ago

Interesting, the screen corruption issues were all solved for me.

How have you done that?

Could you let us know if disabling glamor/glx/acceleration in xorg.conf makes KDE smooth?

I've tried "AccelMethod=none"; and Xorg crashes with signal 6 as soon KDE starts its compositor. What different "xorg.conf" settings should I try?

Also, do you observe in 3D mode a memory leak (swap will be exhausted eventually, causing reset)?

I've got 32GB of RAM - so swap is disabled; but I see that wired memory is growing and growing:

Mem: 1314M Active, 705M Inact, 23M Laundry, 8486M Wired, 21G Free
ARC: 1698M Total, 172M MFU, 482M MRU, 32K Anon, 22M Header, 1023M Other
Swap: 

  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND
20603 nbe          73  20    0  1893M   407M select 14   0:21   0.05% firefox
19954 nbe          54  20    0   384M   275M select  8   0:15   0.01% mysqld
20879 nbe           5  20    0   676M   148M select  8   0:02   0.01% soffice.bin
20570 nbe           2  22    0   549M   136M CPU8    8   0:11   4.42% kdeinit4
20511 nbe           4  20    0   857M   125M select  9   0:04   0.13% kdeinit4
20427 root          6  20    0   320M   123M select  5   0:09   0.31% Xorg
20684 nbe           4  20    0  1679M   107M select 10   0:03   0.00% kmail
20595 nbe           1  20    0   630M    98M select  5   0:00   0.00% knode
20554 nbe           2  20    0   746M 98064K select 10   0:02   0.01% kdeinit4
20496 nbe           5  20    0   690M 85600K select  9   0:02   0.03% kdeinit4
20535 nbe           1  20    0   583M 84636K select  7   0:01   0.00% akonadi_mailfilter_
20509 nbe           3  20    0   622M 84388K select  2   0:03   0.10% kwin
20523 nbe           1  20    0   583M 83952K select  1   0:01   0.00% akonadi_archivemail
20539 nbe           1  20    0   562M 79944K select 15   0:01   0.00% akonadi_sendlater_a
20568 nbe           2  20    0   553M 78588K select  8   0:01   0.02% kdeinit4
20538 nbe           1  20    0   505M 75076K select  5   0:01   0.00% akonadi_notes_agent
20517 nbe          36  20    0   340M 73992K select  4   0:01   0.00% akonadiserver
20501 nbe           1  20    0   463M 68372K select  8   0:00   0.00% kdeinit4
20508 nbe           2  20    0   469M 67920K select  9   0:00   0.00% kdeinit4
20572 nbe           1  20    0   449M 65196K select 12   0:00   0.00% kalarm
20652 nbe           1  20    0   384M 64064K select 14   0:01   0.00% krdc
20494 nbe           1  20    0   362M 62520K select  0   0:00   0.00% kdeinit4
20493 nbe           1  20    0   355M 61028K select  8   0:00   0.00% kdeinit4
20537 nbe           1  20    0   401M 55656K select 11   0:01   0.00% akonadi_newmailnoti
20534 nbe           1  20    0   357M 50584K select  4   0:01   0.00% akonadi_maildispatc
20529 nbe           1  20    0   352M 50228K select 15   0:01   0.00% akonadi_imap_resour
20528 nbe           1  20    0   350M 49940K select 10   0:01   0.00% akonadi_imap_resour
20524 nbe           1  39   19   360M 49524K select 12   0:01   0.00% akonadi_baloo_index
20880 nbe           1  20    0   343M 49468K select  1   0:00   0.00% knotify4
20506 nbe           6  20    0   353M 46636K select 14   0:00   0.00% kactivitymanagerd
20530 nbe           3  20    0   293M 46060K select  1   0:00   0.00% akonadi_agent_launc
20532 nbe           3  20    0   293M 46056K select 12   0:00   0.00% akonadi_agent_launc
20531 nbe           3  20    0   293M 46056K select 15   0:00   0.00% akonadi_agent_launc
20525 nbe           1  20    0   346M 45892K select 13   0:01   0.00% akonadi_birthdays_r
20526 nbe           1  20    0   341M 45444K select  7   0:01   0.00% akonadi_followuprem
20536 nbe           1  20    0   334M 44792K select 14   0:01   0.00% akonadi_migration_a
20516 nbe           2  39   19   339M 43796K select 10   0:00   0.00% baloo_file
20527 nbe           3  20    0   266M 43784K select  4   0:00   0.00% akonadi_agent_launc
20864 nbe           3  20    0   337M 43444K select  7   0:00   0.00% polkit-kde-authenti
20522 nbe           3  20    0   270M 43176K select  5   0:00   0.00% akonadi_agent_launc
20533 nbe           3  20    0   270M 43148K select  8   0:00   0.00% akonadi_agent_launc
  628 unbound       1  20    0 39384K 20616K select 15   0:02   0.00% unbound
iotamudelta commented 7 years ago

I have

Section "Module" Disable "glx" Disable "glamoregl" EndSection

and

Option "NoAccel" "True"

that being said, I have no experience w/ KDE and whether it requires GLX to run (looks like that from what you report).

The corruptions were fixed for me with recent updates to the linuxkpi.

Memory leak seems to be present then, unfortunately expected. We are trying to get the current state into CURRENT/ports ATM, I believe after that @markjdb may have another look into the leak.

jbeich commented 7 years ago

What issue tracks memory leaks? I've seen those on i915kms as well but only with DRI3 enabled.

iotamudelta commented 7 years ago

None. i915 is news to me, so please open an issue.

mattmacy commented 7 years ago

This particular issue seems fixed.