Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] AMDGPU-PRO 17.40 -> 18.03 for use with 4.18 kernel #46765

Closed
wants to merge 1 commit into from

Conversation

washort
Copy link

@washort washort commented Sep 17, 2018

No description provided.

@washort washort changed the title [WIP] Bump AMDGPU-PRO to 18.03 for use with 4.18 kernel [WIP] AMDGPU-PRO 17.40 -> 18.03 for use with 4.18 kernel Sep 17, 2018
@washort washort force-pushed the amdgpu-pro-18.03 branch 2 times, most recently from 9a660ff to 6f2f25e Compare September 17, 2018 13:47
@corngood
Copy link
Contributor

corngood commented Sep 17, 2018

Some things I'll try to test:

  • build
  • kernel module + kms
  • xorg
  • opengl
    • 64
    • 32
  • vulkan
    • 64
    • 32
  • vdpau
    • 64
    • 32
  • opencl
    • 64
    • 32

@corngood
Copy link
Contributor

corngood commented Sep 17, 2018

Looks like the module failed to load due to duplicate pci_enable_atomic_ops_to_root. It was added to the kernel in 4.16, so maybe we should wrap it in #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) in amd/amdkcl/kcl_pci.c.

Unfortunately the kernel version has an extra cap_mask param. It looks like amdgpu calls it with PCI_EXP_DEVCAP2_ATOMIC_COMP32 | PCI_EXP_DEVCAP2_ATOMIC_COMP64.

I can see a few different ways to fix it...

  1. rename it to _kcl_pci_enable_atomic_ops_to_root.
  2. rename it and call the kenel version in >= 4.16, passing those cap mask flags
  3. add an #if/#else to the call site, to call the kernel version (with cap_mask) on >= 4.16, wrap the local version with < 4.16

edit: I'd probably go with (2)

@washort
Copy link
Author

washort commented Sep 17, 2018

Looks like the kernel version and the amdgpu-pro version take the same args, actually.

I've fixed that and hit some other missing symbols that I'm not sure what to do about.

@corngood
Copy link
Contributor

Oh yeah, I must have been looking at an old version or something. Weird.

So what errors do you get exactly?

*
*/
-int pci_enable_atomic_ops_to_root(struct pci_dev *dev, u32 comp_caps)
+int _kcl_pci_enable_atomic_ops_to_root(struct pci_dev *dev, u32 comp_caps)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to rename this. It should still have the same name with older kernels.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, oops, didn't actually mean to push that. :)

@washort
Copy link
Author

washort commented Sep 17, 2018

kernel: amdgpu: Unknown symbol amddrm_sched_job_recovery (err 0)
kernel: amdgpu: Unknown symbol amddrm_sched_entity_init (err 0)
kernel: amdgpu: Unknown symbol amddrm_sched_entity_do_release (err 0)
kernel: amdgpu: Unknown symbol amddrm_sched_entity_push_job (err 0)
kernel: amdgpu: Unknown symbol amddrm_sched_job_init (err 0)
kernel: amdgpu: Unknown symbol amddrm_sched_fini (err 0)
kernel: amdgpu: Unknown symbol amddrm_sched_entity_fini (err 0)
kernel: amdgpu: Unknown symbol amdto_drm_sched_fence (err 0)
kernel: amdgpu: Unknown symbol amddrm_sched_entity_set_rq (err 0)
kernel: amdgpu: Unknown symbol amddrm_sched_hw_job_reset (err 0)
kernel: amdgpu: Unknown symbol amddrm_sched_dependency_optimized (err 0)
kernel: amdgpu: Unknown symbol amddrm_sched_init (err 0)
kernel: amdgpu: Unknown symbol amddrm_sched_entity_cleanup (err 0)

I didn't see any references to these in the source.

@corngood
Copy link
Contributor

Looks like some new modules were added, so the list in the nix expression needs updating:

diff --git a/pkgs/os-specific/linux/amdgpu-pro/default.nix b/pkgs/os-specific/linux/amdgpu-pro/default.nix
index c530cdafbe0..0976dac8b1c 100644
--- a/pkgs/os-specific/linux/amdgpu-pro/default.nix
+++ b/pkgs/os-specific/linux/amdgpu-pro/default.nix
@@ -90,6 +90,9 @@ in stdenv.mkDerivation rec {
   modules = [
     "amd/amdgpu/amdgpu.ko"
     "amd/amdkcl/amdkcl.ko"
+    "amd/amdkfd/amdkfd.ko"
+    "amd/lib/amdchash.ko"
+    "scheduler/amd-sched.ko"
     "ttm/amdttm.ko"
   ];

That got the module loading for me, so KVM works. I started looking at user-space stuff. Xorg crashes on startup:

(II) AMDGPU(0): Direct rendering enabled
      1473:     opening file=/run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so [0]; direct_opencount=18
      1473:
      1473:     /run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so: error: symbol lookup error: undefined symbol: eglCreateImage (fatal)
      1473:     opening file=/run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so [0]; direct_opencount=19
      1473:
      1473:     /run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so: error: symbol lookup error: undefined symbol: eglCreateImage (fatal)
      1473:     opening file=/run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so [0]; direct_opencount=20
      1473:
      1473:     /run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so: error: symbol lookup error: undefined symbol: eglCreateImage (fatal)
      1473:     opening file=/run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so [0]; direct_opencount=21
      1473:
      1473:     /run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so: error: symbol lookup error: undefined symbol: eglCreateImage (fatal)
      1473:     opening file=/run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so [0]; direct_opencount=22
      1473:
      1473:     /run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so: error: symbol lookup error: undefined symbol: eglCreateImage (fatal)
(WW) glamor0: Failed to get GLSL version
(EE) AMDGPU(0): Failed to initialize glamor.
(EE) AMDGPU(0): Acceleration initialization failed
(II) AMDGPU(0): 2D and 3D acceleration disabled
(==) AMDGPU(0): DPMS enabled
(==) AMDGPU(0): Silken mouse enabled
(II) AMDGPU(0): RandR 1.2 enabled, ignore the following RandR disabled message.
(--) RandR disabled
      1473:     opening file=/run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so [0]; direct_opencount=23
      1473:
      1473:     opening file= [0]; direct_opencount=2
      1473:
      1473:
      1473:     closing file=; direct_opencount=1
      1473:     opening file= [0]; direct_opencount=2
      1473:
      1473:
      1473:     closing file=; direct_opencount=1
(II) AIGLX: enabled GLX_MESA_copy_sub_buffer
(II) AIGLX: enabled GLX_ARB_create_context
(II) AIGLX: enabled GLX_ARB_create_context_profile
(II) AIGLX: enabled GLX_EXT_create_context_es2_profile
(II) AIGLX: enabled GLX_INTEL_swap_event
(II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
(II) AIGLX: enabled GLX_EXT_framebuffer_sRGB
(II) AIGLX: enabled GLX_ARB_fbconfig_float
(II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
(II) AIGLX: Loaded and initialized radeonsi
(II) GLX: Initialized DRI2 GL provider for screen 0
X: /usr/include/xorg/privates.h:122: dixGetPrivateAddr: Assertion `key->initialized' failed.
(EE)
(EE) Backtrace:
(EE) 0: /nix/store/1ni4aai81ch7qn21gj4gpq3gs4hckii5-xorg-server-1.19.6/bin/X (OsSigHandler+0x29) [0x59e5f9]
(EE) 1: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libpthread.so.0 (funlockfile+0x50) [0x7f8b387b9f5f]
(EE) 2: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (gsignal+0x100) [0x7f8b3796cbe0]
(EE) 3: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (abort+0x141) [0x7f8b3796ddc1]
(EE) 4: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (__assert_fail_base+0x117) [0x7f8b379656e7]
(EE) 5: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (__assert_fail+0x42) [0x7f8b37965792]
(EE) 6: /nix/store/rqk1yh49l5l4q8zb9xxsybrw49vxlqq1-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/drivers/amdgpu_drv.so (_init+0x7cdc) [0x7f8b3207607e]
(EE) 7: /nix/store/rqk1yh49l5l4q8zb9xxsybrw49vxlqq1-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/drivers/amdgpu_drv.so (_init+0x7d3d) [0x7f8b3207612d]
(EE) 8: /nix/store/rqk1yh49l5l4q8zb9xxsybrw49vxlqq1-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/drivers/amdgpu_drv.so (_init+0x8057) [0x7f8b32076788]
(EE) 9: /nix/store/rqk1yh49l5l4q8zb9xxsybrw49vxlqq1-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/drivers/amdgpu_drv.so (_init+0x80cd) [0x7f8b3207685a]
(EE) 10: /nix/store/rqk1yh49l5l4q8zb9xxsybrw49vxlqq1-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/drivers/amdgpu_drv.so (_init+0x8ade) [0x7f8b32077a85]
(EE) 11: /nix/store/1ni4aai81ch7qn21gj4gpq3gs4hckii5-xorg-server-1.19.6/bin/X (xf86CrtcCreateScreenResources+0x2e) [0x4ace8e]
(EE) 12: /nix/store/1ni4aai81ch7qn21gj4gpq3gs4hckii5-xorg-server-1.19.6/bin/X (dix_main+0x275) [0x43d955]
(EE) 13: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (__libc_start_main+0xee) [0x7f8b37959b8e]
(EE) 14: /nix/store/1ni4aai81ch7qn21gj4gpq3gs4hckii5-xorg-server-1.19.6/bin/X (_start+0x2a) [0x4277da]
(EE)
(EE)
Fatal server error:
(EE) Caught signal 6 (Aborted). Server aborting

Requires at least 4.15 kernel; I've updated it to work with 4.18.
@washort
Copy link
Author

washort commented Sep 18, 2018

I fixed that and a couple other files whose names changed. Here's my crash log:

[  1271.962] (II) Loading /nix/store/l4prff86s7hxskj1ppv92fsn7yj8p218-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/drivers/amdgpu_drv.so
[  1271.962] (II) Module amdgpu: vendor="X.Org Foundation"
[  1271.962] 	compiled for 1.19.6, module version = 18.0.99
[  1271.962] 	Module class: X.Org Video Driver
[  1271.962] 	ABI class: X.Org Video Driver, version 23.0
[  1271.962] (II) AMDGPU: Driver for AMD Radeon:
	All GPUs supported by the amdgpu kernel driver
[  1271.962] (II) AMDGPU(0): [KMS] Kernel modesetting enabled.
[  1271.963] (II) AMDGPU(0): AMDGPU DDX hybrid version: 18.30.2.15
[  1271.963] (II) AMDGPU(0): AMDGPU kernel module hybrid version: 18.30.2.15
[  1271.963] (II) AMDGPU(0): Creating default Display subsection in Screen section
	"Screen-amdgpu[0]" for depth/fbbpp 24/32
[  1271.963] (==) AMDGPU(0): Depth 24, (--) framebuffer bpp 32
[  1271.963] (II) AMDGPU(0): Pixel depth = 24 bits stored in 4 bytes (32 bpp pixmaps)
[  1271.963] (==) AMDGPU(0): Default visual is TrueColor
[  1271.963] (==) AMDGPU(0): RGB weight 888
[  1271.963] (II) AMDGPU(0): Using 8 bits per RGB (8 bit DAC)
[  1271.963] (--) AMDGPU(0): Chipset: "Unknown AMD Radeon GPU" (ChipID = 0x683d)
[  1271.963] (II) Loading sub module "fb"
[  1271.963] (II) LoadModule: "fb"
[  1271.966] (II) Loading /nix/store/1ni4aai81ch7qn21gj4gpq3gs4hckii5-xorg-server-1.19.6/lib/xorg/modules/libfb.so
[  1271.966] (II) Module fb: vendor="X.Org Foundation"
[  1271.966] 	compiled for 1.19.6, module version = 1.0.0
[  1271.966] 	ABI class: X.Org ANSI C Emulation, version 0.4
[  1271.966] (II) Loading sub module "dri2"
[  1271.966] (II) LoadModule: "dri2"
[  1271.966] (II) Module "dri2" already built-in
[  1271.969] (II) Loading sub module "glamoregl"
[  1271.969] (II) LoadModule: "glamoregl"
[  1271.972] (II) Loading /nix/store/l4prff86s7hxskj1ppv92fsn7yj8p218-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/libglamoregl.so
[  1271.975] (II) Module glamoregl: vendor="X.Org Foundation"
[  1271.975] 	compiled for 1.19.6, module version = 1.0.0
[  1271.975] 	ABI class: X.Org ANSI C Emulation, version 0.4
[  1271.975] (II) glamor: OpenGL accelerated X.org driver based.
[  1272.038] (II) glamor: EGL version 1.4:
[  1272.055] (II) AMDGPU(0): glamor detected, initialising EGL layer.
[  1272.055] (==) AMDGPU(0): TearFree property default: auto
[  1272.055] (II) AMDGPU(0): KMS Pageflipping: enabled
[  1272.078] (II) AMDGPU(0): Output DisplayPort-0 has no monitor section
[  1272.089] (II) AMDGPU(0): Output DisplayPort-1 has no monitor section
[  1272.090] (II) AMDGPU(0): Output HDMI-A-0 has no monitor section
[  1272.098] (II) AMDGPU(0): Output DVI-I-0 has no monitor section
[  1272.121] (II) AMDGPU(0): EDID for output DisplayPort-0
[  1272.132] (II) AMDGPU(0): EDID for output DisplayPort-1
[  1272.132] (II) AMDGPU(0): Manufacturer: DEL  Model: a0ec  Serial#: 826824524
[  1272.132] (II) AMDGPU(0): Year: 2018  Week: 15
[  1272.132] (II) AMDGPU(0): EDID Version: 1.4
[  1272.132] (II) AMDGPU(0): Digital Display Input
[  1272.132] (II) AMDGPU(0): 10 bits per channel
[  1272.132] (II) AMDGPU(0): Digital interface is DisplayPort
[  1272.132] (II) AMDGPU(0): Max Image Size [cm]: horiz.: 61  vert.: 35
[  1272.132] (II) AMDGPU(0): Gamma: 2.20
[  1272.132] (II) AMDGPU(0): DPMS capabilities: Off
[  1272.132] (II) AMDGPU(0): Supported color encodings: RGB 4:4:4 YCrCb 4:4:4 YCrCb 4:2:2
[  1272.132] (II) AMDGPU(0): Default color space is primary color space
[  1272.132] (II) AMDGPU(0): First detailed timing is preferred mode
[  1272.132] (II) AMDGPU(0): Preferred mode is native pixel format and refresh rate
[  1272.132] (II) AMDGPU(0): redX: 0.640 redY: 0.330   greenX: 0.300 greenY: 0.600
[  1272.132] (II) AMDGPU(0): blueX: 0.150 blueY: 0.060   whiteX: 0.313 whiteY: 0.329
[  1272.132] (II) AMDGPU(0): Supported established timings:
[  1272.132] (II) AMDGPU(0): 720x400@70Hz
[  1272.132] (II) AMDGPU(0): 640x480@60Hz
[  1272.132] (II) AMDGPU(0): 640x480@75Hz
[  1272.132] (II) AMDGPU(0): 800x600@60Hz
[  1272.132] (II) AMDGPU(0): 800x600@75Hz
[  1272.132] (II) AMDGPU(0): 1024x768@60Hz
[  1272.132] (II) AMDGPU(0): 1024x768@75Hz
[  1272.132] (II) AMDGPU(0): 1280x1024@75Hz
[  1272.132] (II) AMDGPU(0): Manufacturer's mask: 0
[  1272.132] (II) AMDGPU(0): Supported standard timings:
[  1272.132] (II) AMDGPU(0): #0: hsize: 1152  vsize 864  refresh: 75  vid: 20337
[  1272.132] (II) AMDGPU(0): #1: hsize: 1280  vsize 1024  refresh: 60  vid: 32897
[  1272.132] (II) AMDGPU(0): #2: hsize: 1600  vsize 900  refresh: 60  vid: 49321
[  1272.132] (II) AMDGPU(0): #3: hsize: 1600  vsize 1200  refresh: 60  vid: 16553
[  1272.132] (II) AMDGPU(0): #4: hsize: 1920  vsize 1080  refresh: 60  vid: 49361
[  1272.132] (II) AMDGPU(0): #5: hsize: 2048  vsize 1280  refresh: 60  vid: 225
[  1272.132] (II) AMDGPU(0): #6: hsize: 1920  vsize 1200  refresh: 60  vid: 209
[  1272.132] (II) AMDGPU(0): Supported detailed timing:
[  1272.132] (II) AMDGPU(0): clock: 533.2 MHz   Image Size:  609 x 349 mm
[  1272.132] (II) AMDGPU(0): h_active: 3840  h_sync: 3888  h_sync_end 3920 h_blank_end 4000 h_border: 0
[  1272.132] (II) AMDGPU(0): v_active: 2160  v_sync: 2163  v_sync_end 2168 v_blanking: 2222 v_border: 0
[  1272.132] (II) AMDGPU(0): Serial No: 4K8X78481HWL
[  1272.132] (II) AMDGPU(0): Monitor name: DELL U2718Q
[  1272.132] (II) AMDGPU(0): Ranges: V min: 49 V max: 86 Hz, H min: 10 H max: 137 kHz, PixClock max 545 MHz
[  1272.132] (II) AMDGPU(0): Supported detailed timing:
[  1272.132] (II) AMDGPU(0): clock: 241.5 MHz   Image Size:  609 x 349 mm
[  1272.132] (II) AMDGPU(0): h_active: 2560  h_sync: 2608  h_sync_end 2640 h_blank_end 2720 h_border: 0
[  1272.132] (II) AMDGPU(0): v_active: 1440  v_sync: 1443  v_sync_end 1448 v_blanking: 1481 v_border: 0
[  1272.132] (II) AMDGPU(0): Supported detailed timing:
[  1272.132] (II) AMDGPU(0): clock: 262.8 MHz   Image Size:  609 x 349 mm
[  1272.132] (II) AMDGPU(0): h_active: 3840  h_sync: 3888  h_sync_end 3920 h_blank_end 4000 h_border: 0
[  1272.132] (II) AMDGPU(0): v_active: 2160  v_sync: 2163  v_sync_end 2168 v_blanking: 2191 v_border: 0
[  1272.132] (II) AMDGPU(0): Supported detailed timing:
[  1272.132] (II) AMDGPU(0): clock: 533.2 MHz   Image Size:  609 x 349 mm
[  1272.132] (II) AMDGPU(0): h_active: 3840  h_sync: 3888  h_sync_end 3920 h_blank_end 4000 h_border: 0
[  1272.132] (II) AMDGPU(0): v_active: 2160  v_sync: 2163  v_sync_end 2168 v_blanking: 2222 v_border: 0
[  1272.132] (II) AMDGPU(0): Supported detailed timing:
[  1272.132] (II) AMDGPU(0): clock: 148.5 MHz   Image Size:  609 x 349 mm
[  1272.132] (II) AMDGPU(0): h_active: 1920  h_sync: 2008  h_sync_end 2052 h_blank_end 2200 h_border: 0
[  1272.132] (II) AMDGPU(0): v_active: 1080  v_sync: 1082  v_sync_end 1087 v_blanking: 1125 v_border: 0
[  1272.132] (II) AMDGPU(0): Supported detailed timing:
[  1272.132] (II) AMDGPU(0): clock: 58.2 MHz   Image Size:  609 x 349 mm
[  1272.132] (II) AMDGPU(0): h_active: 2048  h_sync: 2096  h_sync_end 2128 h_blank_end 2208 h_border: 0
[  1272.132] (II) AMDGPU(0): v_active: 1080  v_sync: 1083  v_sync_end 1093 v_blanking: 1099 v_border: 0
[  1272.132] (II) AMDGPU(0): Number of EDID sections to follow: 1
[  1272.132] (II) AMDGPU(0): EDID (in hex):
[  1272.132] (II) AMDGPU(0): 	00ffffffffffff0010aceca04c574831
[  1272.132] (II) AMDGPU(0): 	0f1c0104b53d23783eee95a3544c9926
[  1272.132] (II) AMDGPU(0): 	0f5054a54b00714f8180a9c0a940d1c0
[  1272.132] (II) AMDGPU(0): 	e100d10001014dd000a0f0703e803020
[  1272.132] (II) AMDGPU(0): 	3500615d2100001a000000ff00344b38
[  1272.132] (II) AMDGPU(0): 	58373834383148574c0a000000fc0044
[  1272.132] (II) AMDGPU(0): 	454c4c205532373138510a20000000fd
[  1272.132] (II) AMDGPU(0): 	0031560a8936000a20202020202001c8
[  1272.132] (II) AMDGPU(0): 	02031df150101f200514041312110302
[  1272.132] (II) AMDGPU(0): 	161507060123091f0783010000565e00
[  1272.132] (II) AMDGPU(0): 	a0a0a0295030203500615d2100001aa3
[  1272.132] (II) AMDGPU(0): 	6600a0f0701f8030203500615d210000
[  1272.132] (II) AMDGPU(0): 	1a4dd000a0f0703e8030203500615d21
[  1272.132] (II) AMDGPU(0): 	00001a023a801871382d40582c250061
[  1272.132] (II) AMDGPU(0): 	5d2100001ebf1600a08038134030203a
[  1272.132] (II) AMDGPU(0): 	00615d2100001a00000000000000004a
[  1272.132] (II) AMDGPU(0): Printing probed modes for output DisplayPort-1
[  1272.133] (II) AMDGPU(0): Modeline "3840x2160"x60.0  533.25  3840 3888 3920 4000  2160 2163 2168 2222 +hsync -vsync (133.3 kHz eP)
[  1272.133] (II) AMDGPU(0): Modeline "3840x2160"x30.0  262.75  3840 3888 3920 4000  2160 2163 2168 2191 +hsync -vsync (65.7 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "2560x1440"x60.0  241.50  2560 2608 2640 2720  1440 1443 1448 1481 +hsync -vsync (88.8 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "2048x1280"x60.0  221.28  2048 2192 2416 2784  1280 1281 1284 1325 -hsync +vsync (79.5 kHz)
[  1272.133] (II) AMDGPU(0): Modeline "1920x1200"x59.9  193.25  1920 2056 2256 2592  1200 1203 1209 1245 -hsync +vsync (74.6 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "2048x1080"x24.0   58.23  2048 2096 2128 2208  1080 1083 1093 1099 +hsync -vsync (26.4 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1920x1080"x60.0  148.50  1920 2008 2052 2200  1080 1082 1087 1125 +hsync +vsync (67.5 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1920x1080"x60.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.5 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1920x1080"x50.0  148.50  1920 2448 2492 2640  1080 1084 1089 1125 +hsync +vsync (56.2 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1920x1080"x59.9  148.35  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync (67.4 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1920x1080i"x60.0   74.25  1920 2008 2052 2200  1080 1084 1094 1125 interlace +hsync +vsync (33.8 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1920x1080i"x50.0   74.25  1920 2448 2492 2640  1080 1084 1094 1125 interlace +hsync +vsync (28.1 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1920x1080"x24.0   74.25  1920 2558 2602 2750  1080 1084 1089 1125 +hsync +vsync (27.0 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1920x1080i"x59.9   74.18  1920 2008 2052 2200  1080 1084 1094 1125 interlace +hsync +vsync (33.7 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1920x1080"x24.0   74.18  1920 2558 2602 2750  1080 1084 1089 1125 +hsync +vsync (27.0 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1600x1200"x60.0  162.00  1600 1664 1856 2160  1200 1201 1204 1250 +hsync +vsync (75.0 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1600x900"x60.0  108.00  1600 1624 1704 1800  900 901 904 1000 +hsync +vsync (60.0 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1280x1024"x75.0  135.00  1280 1296 1440 1688  1024 1025 1028 1066 +hsync +vsync (80.0 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1280x1024"x60.0  108.00  1280 1328 1440 1688  1024 1025 1028 1066 +hsync +vsync (64.0 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1152x864"x75.0  108.00  1152 1216 1344 1600  864 865 868 900 +hsync +vsync (67.5 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1280x720"x60.0   74.25  1280 1390 1430 1650  720 725 730 750 +hsync +vsync (45.0 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1280x720"x50.0   74.25  1280 1720 1760 1980  720 725 730 750 +hsync +vsync (37.5 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1280x720"x59.9   74.18  1280 1390 1430 1650  720 725 730 750 +hsync +vsync (45.0 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1024x768"x75.0   78.75  1024 1040 1136 1312  768 769 772 800 +hsync +vsync (60.0 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "1024x768"x60.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "800x600"x75.0   49.50  800 816 896 1056  600 601 604 625 +hsync +vsync (46.9 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "800x600"x60.3   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "720x576"x50.0   27.00  720 732 796 864  576 581 586 625 -hsync -vsync (31.2 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "720x576i"x50.0   13.50  720 732 795 864  576 580 586 625 interlace -hsync -vsync (15.6 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "720x480"x60.0   27.03  720 736 798 858  480 489 495 525 -hsync -vsync (31.5 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "720x480"x59.9   27.00  720 736 798 858  480 489 495 525 -hsync -vsync (31.5 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "720x480i"x60.0   13.51  720 739 801 858  480 488 494 525 interlace -hsync -vsync (15.8 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "720x480i"x59.9   13.50  720 739 801 858  480 488 494 525 interlace -hsync -vsync (15.7 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "640x480"x75.0   31.50  640 656 720 840  480 481 484 500 -hsync -vsync (37.5 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "640x480"x60.0   25.20  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "640x480"x59.9   25.18  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz e)
[  1272.133] (II) AMDGPU(0): Modeline "720x400"x70.1   28.32  720 738 846 900  400 412 414 449 -hsync +vsync (31.5 kHz e)
[  1272.134] (II) AMDGPU(0): EDID for output HDMI-A-0
[  1272.142] (II) AMDGPU(0): EDID for output DVI-I-0
[  1272.142] (II) AMDGPU(0): Output DisplayPort-0 disconnected
[  1272.142] (II) AMDGPU(0): Output DisplayPort-1 connected
[  1272.142] (II) AMDGPU(0): Output HDMI-A-0 disconnected
[  1272.142] (II) AMDGPU(0): Output DVI-I-0 disconnected
[  1272.142] (II) AMDGPU(0): Using exact sizes for initial modes
[  1272.142] (II) AMDGPU(0): Output DisplayPort-1 using initial mode 3840x2160 +0+0
[  1272.142] (II) AMDGPU(0): mem size init: gart size :3e648b000 vram size: s:3de59000 visible:2e6c2c00
[  1272.142] (II) AMDGPU(0): Video RAM: 1014116 kByte
[  1272.142] (==) AMDGPU(0): DPI set to (96, 96)
[  1272.142] (==) AMDGPU(0): Using gamma correction (1.0, 1.0, 1.0)
[  1272.142] (II) Loading sub module "ramdac"
[  1272.142] (II) LoadModule: "ramdac"
[  1272.142] (II) Module "ramdac" already built-in
[  1272.142] (--) Depth 24 pixmap format is 32 bpp
[  1272.142] (II) AMDGPU(0): [DRI2] Setup complete
[  1272.142] (II) AMDGPU(0): [DRI2]   DRI driver: radeonsi
[  1272.142] (II) AMDGPU(0): [DRI2]   VDPAU driver: radeonsi
[  1272.142] (II) AMDGPU(0): Front buffer pitch: 15360 bytes
[  1272.142] (II) AMDGPU(0): SYNC extension fences enabled
[  1272.142] (II) AMDGPU(0): Present extension enabled
[  1272.142] (==) AMDGPU(0): DRI3 enabled
[  1272.142] (==) AMDGPU(0): Backing store enabled
[  1272.142] (II) AMDGPU(0): Direct rendering enabled
[  1272.143] (WW) glamor0: Failed to get GLSL version
[  1272.143] (EE) AMDGPU(0): Failed to initialize glamor.
[  1272.143] (EE) AMDGPU(0): Acceleration initialization failed
[  1272.143] (II) AMDGPU(0): 2D and 3D acceleration disabled
[  1272.143] (==) AMDGPU(0): DPMS enabled
[  1272.143] (==) AMDGPU(0): Silken mouse enabled
[  1272.143] (II) AMDGPU(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[  1272.143] (--) RandR disabled
[  1272.151] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[  1272.151] (II) AIGLX: enabled GLX_ARB_create_context
[  1272.151] (II) AIGLX: enabled GLX_ARB_create_context_profile
[  1272.151] (II) AIGLX: enabled GLX_EXT_create_context_es2_profile
[  1272.151] (II) AIGLX: enabled GLX_INTEL_swap_event
[  1272.151] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
[  1272.151] (II) AIGLX: enabled GLX_EXT_framebuffer_sRGB
[  1272.151] (II) AIGLX: enabled GLX_ARB_fbconfig_float
[  1272.151] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
[  1272.151] (II) AIGLX: Loaded and initialized radeonsi
[  1272.151] (II) GLX: Initialized DRI2 GL provider for screen 0
[  1272.152] (EE) 
[  1272.152] (EE) Backtrace:
[  1272.152] (EE) 0: /nix/store/1ni4aai81ch7qn21gj4gpq3gs4hckii5-xorg-server-1.19.6/bin/X (OsSigHandler+0x29) [0x59e5f9]
[  1272.152] (EE) 1: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libpthread.so.0 (funlockfile+0x50) [0x7f3d3b242f5f]
[  1272.152] (EE) 2: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (gsignal+0x100) [0x7f3d3a406be0]
[  1272.153] (EE) 3: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (abort+0x141) [0x7f3d3a407dc1]
[  1272.153] (EE) 4: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (__assert_fail_base+0x117) [0x7f3d3a3ff6e7]
[  1272.153] (EE) 5: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (__assert_fail+0x42) [0x7f3d3a3ff792]
[  1272.153] (EE) 6: /nix/store/l4prff86s7hxskj1ppv92fsn7yj8p218-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/drivers/amdgpu_drv.so (_init+0x7cdc) [0x7f3d34b9107e]
[  1272.153] (EE) 7: /nix/store/l4prff86s7hxskj1ppv92fsn7yj8p218-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/drivers/amdgpu_drv.so (_init+0x7d3d) [0x7f3d34b9112d]
[  1272.153] (EE) 8: /nix/store/l4prff86s7hxskj1ppv92fsn7yj8p218-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/drivers/amdgpu_drv.so (_init+0x8057) [0x7f3d34b91788]
[  1272.153] (EE) 9: /nix/store/l4prff86s7hxskj1ppv92fsn7yj8p218-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/drivers/amdgpu_drv.so (_init+0x80cd) [0x7f3d34b9185a]
[  1272.154] (EE) 10: /nix/store/l4prff86s7hxskj1ppv92fsn7yj8p218-amdgpu-pro-18.30-4.18.7/lib/xorg/modules/drivers/amdgpu_drv.so (_init+0x8ade) [0x7f3d34b92a85]
[  1272.154] (EE) 11: /nix/store/1ni4aai81ch7qn21gj4gpq3gs4hckii5-xorg-server-1.19.6/bin/X (xf86CrtcCreateScreenResources+0x2e) [0x4ace8e]
[  1272.154] (EE) 12: /nix/store/1ni4aai81ch7qn21gj4gpq3gs4hckii5-xorg-server-1.19.6/bin/X (dix_main+0x275) [0x43d955]
[  1272.154] (EE) 13: /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (__libc_start_main+0xee) [0x7f3d3a3f3b8e]
[  1272.154] (EE) 14: /nix/store/1ni4aai81ch7qn21gj4gpq3gs4hckii5-xorg-server-1.19.6/bin/X (_start+0x2a) [0x4277da]

@corngood
Copy link
Contributor

corngood commented Sep 18, 2018

I noticed in an strace log that it was failing to load /opt/amdgpu/share/libdrm/amdgpu.ids. So I added more disgusting hacks to help it find it:

diff --git a/nixos/modules/hardware/video/amdgpu-pro.nix b/nixos/modules/hardware/video/amdgpu-pro.nix
index ed60aad1047..3f65ae9a1ee 100644
--- a/nixos/modules/hardware/video/amdgpu-pro.nix
+++ b/nixos/modules/hardware/video/amdgpu-pro.nix
@@ -48,6 +48,7 @@ in
       mkdir -p /run/lib
       ln -sfn ${package}/lib ${package.libCompatDir}
       ln -sfn ${package} /run/amdgpu-pro
+      ln -sfn ${package} /run/amdgpu
     '' + optionalString opengl.driSupport32Bit ''
       ln -sfn ${package32}/lib ${package32.libCompatDir}
     '';
diff --git a/pkgs/os-specific/linux/amdgpu-pro/default.nix b/pkgs/os-specific/linux/amdgpu-pro/default.nix
index f96a08ed426..0ee9d83b830 100644
--- a/pkgs/os-specific/linux/amdgpu-pro/default.nix
+++ b/pkgs/os-specific/linux/amdgpu-pro/default.nix
@@ -138,6 +138,11 @@ in stdenv.mkDerivation rec {
   '' + ''
     popd
 
+  '' + optionalString (!libsOnly) ''
+    pushd opt/amdgpu
+    cp -r share/libdrm $out/share
+    popd
+
   '' + optionalString (!libsOnly)
     (concatMapStrings (m:
       "install -Dm444 usr/src/amdgpu-${build}/${m}.xz $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/gpu/drm/${m}.xz\n") modules)
@@ -165,6 +170,9 @@ in stdenv.mkDerivation rec {
     for lib in dri/amdgpu_dri.so libdrm_amdgpu.so.1.0.0 libgbm.so.1.0.0 libkms.so.1.0.0 libamdocl${bitness}.so; do
       perl -pi -e 's:/opt/amdgpu-pro/:/run/amdgpu-pro/:g' "$out/lib/$lib"
     done
+    for lib in libdrm_amdgpu.so.1.0.0; do
+      perl -pi -e 's:/opt/amdgpu/:/run/amdgpu/:g' "$out/lib/$lib"
+    done
     substituteInPlace "$out/share/vulkan/icd.d/amd_icd${bitness}.json" --replace "/opt/amdgpu-pro/lib/${libArch}" "$out/lib"
   '' + optionalString (!libsOnly) ''
     for lib in libglamoregl.so; do

It didn't fix the assert though. amdgpu.ids just looks like human readable names for GPUs.

The actual assert message I'm getting is:

/usr/include/xorg/privates.h:122: dixGetPrivateAddr: Assertion `key->initialized' failed.

Which is probably a result of:

AMDGPU(0): Failed to initialize glamor.

I didn't see anything else in the strace logs that looked like it might be failing due to hardcoded paths.

@corngood
Copy link
Contributor

The only thing I have to go on now is some errors from LD_DEBUG=files:

/run/lib/x86_64-linux-gnu/dri/amdgpu_dri.so: error: symbol lookup error: undefined symbol: eglCreateImage (fatal)

I'm not sure what that's about though, because libEGL does seem to export that symbol, and it looks like it gets loaded correctly.

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@ShamrockLee
Copy link
Contributor

ShamrockLee commented Jun 25, 2020

It might still be important, as it is mentioned by some still-open issues.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 25, 2020
@ryantm ryantm marked this pull request as draft October 23, 2020 03:11
@stale
Copy link

stale bot commented Jul 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 21, 2021
@corngood
Copy link
Contributor

I did a pass on 21.30 in #151019. I currently have xorg and 64-bit opengl working, but probably nothing else.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 16, 2021
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants