From owner-freebsd-ports@freebsd.org Thu Apr 9 18:32:49 2020 Return-Path: Delivered-To: freebsd-ports@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88F4C279E71 for ; Thu, 9 Apr 2020 18:32:49 +0000 (UTC) (envelope-from list1@gjunka.com) Received: from msa1.earth.yoonka.com (yoonka.com [88.98.225.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "msa1.earth.yoonka.com", Issuer "msa1.earth.yoonka.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 48yqWh4nd5z40mP for ; Thu, 9 Apr 2020 18:32:48 +0000 (UTC) (envelope-from list1@gjunka.com) Received: from crayon2.yoonka.com (crayon2.yoonka.com [10.70.7.20]) (authenticated bits=0) by msa1.earth.yoonka.com (8.15.2/8.15.2) with ESMTPSA id 039IWkWC034159 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Thu, 9 Apr 2020 18:32:46 GMT (envelope-from list1@gjunka.com) Subject: Re: amdgpu panics To: freebsd-ports@freebsd.org References: <83bfb6f7-0a84-2905-7849-e4e93d9f6fb1@selasky.org> <9426b9bb-4fe6-37ba-ecb4-13a1ade47f92@gjunka.com> <9bc766aa-b17f-e8bc-bea2-11431972cf5d@selasky.org> <2ddfe444-7a20-9835-0875-6f93aa0f6ab3@gmx.de> <5fb0aa95-9aa1-e170-15fe-ba5ce77869db@gjunka.com> <72befef2-16f2-a452-9e36-a3986988c556@gjunka.com> <16501c75-24b0-54f6-972c-1a03dfe50276@selasky.org> <2c1d5679-811f-0b01-f032-7261e9f57259@gjunka.com> <69c05fe9-29a6-4160-4f4a-ae6f939a187b@selasky.org> <4b5b26ce-1c0c-8204-5c71-a3e24682b4de@gjunka.com> <66a1cebe-10de-f0b5-79aa-dc7928af25ca@selasky.org> <0dd43f30-339a-3003-6c3d-065d13e36b6b@gjunka.com> From: Grzegorz Junka Message-ID: Date: Thu, 9 Apr 2020 18:32:46 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 48yqWh4nd5z40mP X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of list1@gjunka.com designates 88.98.225.149 as permitted sender) smtp.mailfrom=list1@gjunka.com X-Spamd-Result: default: False [-5.87 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:88.98.225.149]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; DMARC_NA(0.00)[gjunka.com]; IP_SCORE(-3.57)[ip: (-9.35), ipnet: 88.98.192.0/18(-4.67), asn: 56478(-3.74), country: GB(-0.07)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:56478, ipnet:88.98.192.0/18, country:GB]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2020 18:32:49 -0000 Tried just now with 12-STABLE installed using FreeBSD-base and all kmod packages recompiled in a jail that was created from the same obj/usr as the 12-STABLE base packages. In other words: The build host is running 12.1-RELEASE-p3. On it I fetched 12-STABLE and compiled world and kernel. Then packaged both into FreeBSD-base packages to install on the destination desktop. Then I created a new poudriere jail using the same 12-STABLE usr/obj. Then I used that jail to build drm-kmod, drm-fbsd12.0-kmod and gpu-firmware-kmod. Then I reinstalled the base (world/kernel) on the destination desktop using FreeBSD-base packages and reinstalled on it the three kmod packages recompiled with poudriere. The result is (almost) exactly the same as with 12.1-RELEASE-p3. The screen goes blank and to sleep after a few seconds. The ssh session survived: root@venus:~ # kldstat Id Refs Address                Size Name  1  142 0xffffffff80200000  226f3f0 kernel  2    1 0xffffffff82470000   3adf68 zfs.ko  3    2 0xffffffff8281e000     a430 opensolaris.ko  4    1 0xffffffff82e11000     4950 linprocfs.ko  5    3 0xffffffff82e16000     3148 linux_common.ko  6    1 0xffffffff82e1a000     8838 tmpfs.ko  7    1 0xffffffff82e23000    16b50 if_iwm.ko  8    1 0xffffffff82e3a000    fb11f iwm3168fw.ko  9    1 0xffffffff82f36000     2658 intpm.ko 10    1 0xffffffff82f39000      b60 smbus.ko 11    1 0xffffffff82f3a000     1880 uhid.ko 12    1 0xffffffff82f3c000     2968 ums.ko 13    1 0xffffffff82f3f000     1a40 wmt.ko 14    1 0xffffffff82f41000     cbd0 snd_uaudio.ko 15    1 0xffffffff82f4e000     4240 ng_ubt.ko 16    6 0xffffffff82f53000     9be0 netgraph.ko 17    2 0xffffffff82f5d000     91e8 ng_hci.ko 18    3 0xffffffff82f67000      9b0 ng_bluetooth.ko 19    1 0xffffffff82f68000     cb40 ng_l2cap.ko 20    1 0xffffffff82f75000    1b420 ng_btsocket.ko 21    1 0xffffffff82f91000     2180 ng_socket.ko 22    1 0xffffffff82f94000    3d450 linux.ko 23    1 0xffffffff82fd2000    35260 linux64.ko 24    1 0xffffffff83008000     1a88 fdescfs.ko 25    3 0xffffffff8300a000    764b0 drm.ko 26    5 0xffffffff83081000    11170 linuxkpi.ko 27    4 0xffffffff83093000    13f30 linuxkpi_gplv2.ko 28    2 0xffffffff830a7000      6d0 debugfs.ko 30    1 0xffffffff832f8000     ef41 ttm.ko 31    1 0xffffffff83307000      2c1 amdgpu_vega10_gpu_info_bin.ko 32    1 0xffffffff83308000    27d07 amdgpu_vega10_sos_bin.ko 33    1 0xffffffff83330000    1e377 amdgpu_vega10_asd_bin.ko 34    1 0xffffffff8334f000    4047f amdgpu_vega10_acg_smc_bin.ko 35    1 0xffffffff83390000     55f7 amdgpu_vega10_pfp_bin.ko 36    1 0xffffffff83396000     45f5 amdgpu_vega10_me_bin.ko 37    1 0xffffffff8339b000     25f5 amdgpu_vega10_ce_bin.ko 38    1 0xffffffff8339e000     4477 amdgpu_vega10_rlc_bin.ko 39    1 0xffffffff833a3000    41887 amdgpu_vega10_mec_bin.ko 40    1 0xffffffff833e5000    41889 amdgpu_vega10_mec2_bin.ko 41    1 0xffffffff83427000     4579 amdgpu_vega10_sdma_bin.ko 42    1 0xffffffff8342c000     457b amdgpu_vega10_sdma1_bin.ko 43    1 0xffffffff83431000    5c337 amdgpu_vega10_uvd_bin.ko 44    1 0xffffffff8348e000    2a797 amdgpu_vega10_vce_bin.ko root@venus:~ # dmesg ---<>--- Copyright (c) 1992-2020 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994         The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 12.1-STABLE r359722 GENERIC amd64 FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1) VT(efifb): resolution 1024x768 CPU: AMD Ryzen 7 2700X Eight-Core Processor          (3700.37-MHz K8-class CPU)   Origin="AuthenticAMD"  Id=0x800f82  Family=0x17  Model=0x8 Stepping=2 Features=0x178bfbff Features2=0x7ed8320b   AMD Features=0x2e500800   AMD Features2=0x35c233ff   Structured Extended Features=0x209c01a9   XSAVE Features=0xf   AMD Extended Feature Extensions ID EBX=0x1007   SVM: (disabled in BIOS) NP,NRIP,VClean,AFlush,DAssist,NAsids=32768   TSC: P-state invariant, performance statistics real memory  = 68719476736 (65536 MB) avail memory = 66808102912 (63713 MB) Event timer "LAPIC" quality 600 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 16 CPUs FreeBSD/SMP: 1 package(s) x 2 cache groups x 4 core(s) x 2 hardware threads random: unblocking device. Firmware Warning (ACPI): Optional FADT field Pm2ControlBlock has valid Length but zero Address: 0x0000000000000000/0x1 (20191213/tbfadt-796) ioapic0 irqs 0-23 on motherboard ioapic1 irqs 24-55 on motherboard Launching APs: 12 13 9 15 8 11 1 10 14 7 6 3 4 5 2 Timecounter "TSC-low" frequency 1850186165 Hz quality 1000 random: entropy device external interface kbd1 at kbdmux0 000.000023 [4336] netmap_init               netmap: loaded module [ath_hal] loaded (...) [drm] amdgpu kernel modesetting enabled. drmn0: on vgapci0 vgapci0: child drmn0 requested pci_enable_io vgapci0: child drmn0 requested pci_enable_io [drm] initializing kernel modesetting (VEGA10 0x1002:0x687F 0x1002:0x0B36 0xC0). [drm] register mmio base: 0xFD100000 [drm] register mmio size: 524288 [drm] PCI I/O BAR is not found. drmn0: successfully loaded firmware image with name: amdgpu/vega10_gpu_info.bin [drm] probing gen 2 caps for device 1022:1471 = 700d03/e [drm] probing mlw for device 1002:687f = 400d03 [drm] UVD is enabled in VM mode [drm] UVD ENC is enabled in VM mode [drm] VCE enabled in VM mode ATOM BIOS: 113-D0500500-104 [drm] vm size is 262144 GB, 4 levels, block size is 9-bit, fragment size is 9-bit drmn0: VRAM: 8176M 0x000000F400000000 - 0x000000F5FEFFFFFF (8176M used) drmn0: GTT: 256M 0x000000F600000000 - 0x000000F60FFFFFFF Successfully added WC MTRR for [0xe0000000-0xefffffff]: 0; [drm] Detected VRAM RAM=8176M, BAR=256M [drm] RAM width 2048bits HBM [TTM] Zone  kernel: Available graphics memory: 33496000 kiB [TTM] Zone   dma32: Available graphics memory: 2097152 kiB [TTM] Initializing pool allocator [drm] amdgpu: 8176M of VRAM memory ready [drm] amdgpu: 8176M of GTT memory ready. i_size_write unimplemented [drm] GART: num cpu pages 65536, num gpu pages 65536 [drm] PCIE GART of 256M enabled (table at 0x000000F400800000). drmn0: successfully loaded firmware image with name: amdgpu/vega10_sos.bin drmn0: successfully loaded firmware image with name: amdgpu/vega10_asd.bin drmn0: successfully loaded firmware image with name: amdgpu/vega10_acg_smc.bin drmn0: successfully loaded firmware image with name: amdgpu/vega10_pfp.bin drmn0: successfully loaded firmware image with name: amdgpu/vega10_me.bin drmn0: successfully loaded firmware image with name: amdgpu/vega10_ce.bin drmn0: successfully loaded firmware image with name: amdgpu/vega10_rlc.bin drmn0: successfully loaded firmware image with name: amdgpu/vega10_mec.bin drmn0: successfully loaded firmware image with name: amdgpu/vega10_mec2.bin i_size_write unimplemented i_size_write unimplemented i_size_write unimplemented i_size_write unimplemented i_size_write unimplemented i_size_write unimplemented i_size_write unimplemented i_size_write unimplemented i_size_write unimplemented i_size_write unimplemented drmn0: successfully loaded firmware image with name: amdgpu/vega10_sdma.bin drmn0: successfully loaded firmware image with name: amdgpu/vega10_sdma1.bin [drm] use_doorbell being set to: [true] i_size_write unimplemented [drm] use_doorbell being set to: [true] i_size_write unimplemented drmn0: successfully loaded firmware image with name: amdgpu/vega10_uvd.bin [drm] Found UVD firmware Version: 65.29 Family ID: 17 [drm] PSP loading UVD firmware i_size_write unimplemented i_size_write unimplemented i_size_write unimplemented drmn0: successfully loaded firmware image with name: amdgpu/vega10_vce.bin [drm] Found VCE firmware Version: 57.4 Binary ID: 4 [drm] PSP loading VCE firmware i_size_write unimplemented i_size_write unimplemented i_size_write unimplemented [drm] Display Core initialized with v3.1.27! [drm] Connector DP-1: get mode from tunables: [drm]   - kern.vt.fb.modes.DP-1 [drm]   - kern.vt.fb.default_mode [drm] Connector DP-2: get mode from tunables: [drm]   - kern.vt.fb.modes.DP-2 [drm]   - kern.vt.fb.default_mode [drm] Connector DP-3: get mode from tunables: [drm]   - kern.vt.fb.modes.DP-3 [drm]   - kern.vt.fb.default_mode [drm] Connector HDMI-A-1: get mode from tunables: [drm]   - kern.vt.fb.modes.HDMI-A-1 [drm]   - kern.vt.fb.default_mode [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). [drm] Driver supports precise vblank timestamp query. amdgpu: [powerplay] Failed to send message: 0x4 [drm:amdgpu_ring_write] amdgpu: writing more dwords to the ring than expected! root@venus:~ # sysctl -a compat.linuxkpi compat.linuxkpi.drm_timestamp_precision_usec: 20 compat.linuxkpi.drm_vblankoffdelay: 5000 compat.linuxkpi.drm_poll: 1 compat.linuxkpi.drm_drm_fbdev_overalloc: 100 compat.linuxkpi.drm_fbdev_emulation: 1 Then it hangs... After restart: root@venus:/boot # ls -l kernel/drm* -r-xr-xr-x  1 root  wheel  160440 Apr  8 12:08 kernel/drm.ko -r-xr-xr-x  1 root  wheel  500088 Apr  8 12:08 kernel/drm2.ko root@venus:/boot # ls -l modules/drm* -r-xr-xr-x  1 root  wheel  850928 Apr  8 22:09 modules/drm.ko root@venus:/boot # ls -l modules/amdgpu.ko -r-xr-xr-x  1 root  wheel  4119152 Apr  8 22:09 modules/amdgpu.ko root@venus:/boot # sysctl -a compat compat.linux32.maxvmem: 0 compat.linux32.maxssiz: 67108864 compat.linux32.maxdsiz: 536870912 compat.linux.oss_version: 198144 compat.linux.osrelease: 2.6.36 compat.linux.osname: Linux compat.ia32.maxvmem: 0 compat.ia32.maxssiz: 67108864 compat.ia32.maxdsiz: 536870912 GrzegorzJ