FreeBSDDesktop / kms-drm

the DRM part of the linuxkpi-based KMS
63 stars 26 forks source link

[i915kms] Memory leak while transcoding? #148

Closed kchiem closed 1 year ago

kchiem commented 5 years ago

Running FreeBSD 12.0 on an Intel NUC8i5. With plex server using hardware transcode, I'm seeing wired memory climb at about 2 gb/hour while transcoding. Restarting plex doesn't free the memory. Eventually, free memory runs low and the system starts swapping, grinding to a halt. Before that happens, while memory is low, I also get:

[drm] GPU HANG: ecode 9:1:0xabfffff4, in Plex Transcoder [100772], reason: No progress on bcs0, action: reset

$ pkg_tree -v drm-kmod
drm-kmod-g20181126
 \__ drm-fbsd12.0-kmod-4.16.g20190430
       \__ gpu-firmware-kmod-g20190219

Relevant boot dmesg:

drmn1: <drmn> on vgapci1
vgapci1: child drmn1 requested pci_enable_io
vgapci1: child drmn1 requested pci_enable_io
[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
[drm] Found 128MB of eDRAM
Failed to add WC MTRR for [0xd0000000-0xdfffffff]: -22; performance may suffer
[drm] Got stolen memory base 0x0, size 0x0
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm] Failed to find VBIOS tables (VBT)
[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 HDMI-A-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-1
[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-2: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-2
[drm]   - kern.vt.fb.default_mode
[drm] Initialized i915 1.6.0 20171222 for drmn1 on minor 0
VT: Replacing driver "vga" with new "fb".
start FB_INFO:
type=11 height=1080 width=1920 depth=32
cmsize=16 size=8294400
pbase=0xd0040000 vbase=0xfffff800d0040000
name=drmn1 flags=0x0 stride=7680 bpp=32
cmap[0]=0 cmap[1]=7f0000 cmap[2]=7f00 cmap[3]=c4a000
end FB_INFO
drmn1: fb0: inteldrmfb frame buffer device
drmn1: successfully loaded firmware image with name: i915/kbl_dmc_ver1_04.bin
[drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
zeising commented 4 years ago

Is this still a problem?

kchiem commented 4 years ago

It was.. but since you're the first response, and it's been over a year, I've since switched over to linux for this. Has something changed such that this wouldn't be a problem anymore? If so, I can spend the effort to fire up a new VM and test it.

zeising commented 4 years ago

It's been over a year, a lot has happened both in the FreeBSD VM subsystem, and to a lesser extent in the drivers. FreeBSD 12.0 has also been replaced by 12.1. There has been a few memory leaks that have been fixed at one point, https://github.com/FreeBSDDesktop/kms-drm/commit/636503003d16314fae1ffa3d15a9ab04e616c12f comes to mind.

kchiem commented 4 years ago

Ok, I'll try and test this in the next couple of days.