# i915 / HD Graphics P530 - transcoding hardware acceleration



## Janusz (Sep 10, 2019)

Hi All. I'm setting up a Plex Media Server instance and thought I'd make use of the P530's Quick Sync Video capability. The Plex configuration appears to be correct. I'm testing transcoding with a mobile Android client and can see Plex trying to utilise the P530. Whenever it tries, the transcoding process generally hangs which eventually results in the Android client freeze. Running this without QSV works perfectly so I know this is related to the GPU.

I've noticed the following states in top when triggering hardware transcoding:
(Note: the first two entries are taken from a single session, the third entry is another attempt)


```
85786 plex          1  21    0    54M    15M drm_gl   1   0:00   0.00% Plex Transcoder
85077 plex          1  20    0    54M    15M &dev->   3   0:00   0.00% Plex Transcoder
68464 plex         10  33    0   128M    64M i915fl   0   0:00   0.00% Plex Transcoder
```

Here's what the log says:

```
# cat messages | grep drm
Sep 10 19:21:14 <name> kernel: drmn0: <drmn> on vgapci0
Sep 10 19:21:14 <name> kernel: vgapci0: child drmn0 requested pci_enable_io
Sep 10 19:21:14 <name> kernel: [drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
Sep 10 19:21:14 <name> kernel: [drm] Got stolen memory base 0x8e000000, size 0x2000000
Sep 10 19:21:14 <name> kernel: [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
Sep 10 19:21:14 <name> kernel: [drm] Driver supports precise vblank timestamp query.
Sep 10 19:21:14 <name> kernel: [drm] Connector HDMI-A-1: get mode from tunables:
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.modes.HDMI-A-1
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.default_mode
Sep 10 19:21:14 <name> kernel: [drm] Connector DP-1: get mode from tunables:
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.modes.DP-1
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.default_mode
Sep 10 19:21:14 <name> kernel: [drm] Connector HDMI-A-2: get mode from tunables:
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.modes.HDMI-A-2
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.default_mode
Sep 10 19:21:14 <name> kernel: [drm] Connector DP-2: get mode from tunables:
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.modes.DP-2
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.default_mode
Sep 10 19:21:14 <name> kernel: [drm] Connector HDMI-A-3: get mode from tunables:
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.modes.HDMI-A-3
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.default_mode
Sep 10 19:21:14 <name> kernel: [drm] Connector DP-3: get mode from tunables:
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.modes.DP-3
Sep 10 19:21:14 <name> kernel: [drm]   - kern.vt.fb.default_mode
Sep 10 19:21:14 <name> kernel: [drm] Initialized i915 1.6.0 20171222 for drmn0 on minor 0
Sep 10 19:21:14 <name> kernel: [drm] Cannot find any crtc or sizes
Sep 10 19:21:14 <name> kernel: drmn0: successfully loaded firmware image with name: i915/skl_dmc_ver1_27.bin
Sep 10 19:21:14 <name> kernel: [drm] Finished loading DMC firmware i915/skl_dmc_ver1_27.bin (v1.27)
Sep 10 19:21:19 <name> kernel: [drm] Cannot find any crtc or sizes
```

I've seem a similar set of entries in another post and approaches included compiling own driver and installing additional X drivers for Intel cards. I'm trying to use this capability without displaying anything on screen - it's meant to process the load more efficiently and send outputs to remote client(s). 

Suggestions would be most welcome.

GPU:

```
# pciconf -lvb vgapci0
vgapci0@pci0:0:2:0:    class=0x030000 card=0x07c51028 chip=0x191d8086 rev=0x06 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'HD Graphics P530'
    class      = display
    subclass   = VGA
    bar   [10] = type Memory, range 64, base 0xde000000, size 16777216, enabled
    bar   [18] = type Prefetchable Memory, range 64, base 0xc0000000, size 268435456, enabled
    bar   [20] = type I/O Port, range 32, base 0xf000, size 64, enabled
```

CPU and system:

```
# dmesg | head -n30
---<<BOOT>>---
Copyright (c) 1992-2018 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.0-RELEASE-p10 GENERIC amd64
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
VT(efifb): resolution 640x480
module_register: cannot register pci/em from kernel; already loaded from if_em_updated.ko
Module pci/em failed to register: 17
CPU: Intel(R) Xeon(R) CPU E3-1225 v5 @ 3.30GHz (3312.16-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0x506e3  Family=0x6  Model=0x5e  Stepping=3
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x7ffafbff<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,SDBG,FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
  AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
  AMD Features2=0x121<LAHF,ABM,Prefetch>
  Structured Extended Features=0x29c6fbf<FSGSBASE,TSCADJ,SGX,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,NFPUSG,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PROCTRACE>
  Structured Extended Features3=0x9c000000<IBPB,STIBP,L1DFL,SSBD>
  XSAVE Features=0xf<XSAVEOPT,XSAVEC,XINUSE,XSAVES>
  VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID
  TSC: P-state invariant, performance statistics
```

Loaded modules:

```
# kldstat
Id Refs Address                Size Name
 1   43 0xffffffff80200000  243d228 kernel
 2    1 0xffffffff8263e000    68c98 if_em_updated.ko
 3    1 0xffffffff8293d000   247e20 zfs.ko
 4    1 0xffffffff82b85000     7628 opensolaris.ko
 5    1 0xffffffff82b8d000   12ce50 i915kms.ko
 6    1 0xffffffff82cba000    76990 drm.ko
 7    4 0xffffffff82d31000    104f0 linuxkpi.ko
 8    3 0xffffffff82d42000    12f30 linuxkpi_gplv2.ko
 9    2 0xffffffff82d55000      6c0 debugfs.ko
10    1 0xffffffff82d56000     245d i915_skl_dmc_ver1_27_bin.ko
11    1 0xffffffff82d59000      acf mac_ntpd.ko
```


----------



## Janusz (Sep 12, 2019)

Hello? Anyone?


----------

