Jasper Lake N5105 lack of acceleration

help!

Explorer
Joined
Aug 3, 2023
Messages
57
:smile: Hey there!

I hope who ever is here is having a great day!

So ive grown to love Truenas and wish to stay on this platform having started the move over from synology,

So Im sold, except that I cant have GPU acceleration passed onto Apps/containers docker and such

it does not use the HW transcoding at all, which saddens me :(

in true nas scale the gpu is show in this section

Isolated GPU Device(s)​

Intel Corporation JasperLake [UHD Graphics]

Now the stable version of truenas scale did not populate my gpu, but regardless it does now via this installer

TrueNAS-SCALE-23.10-MASTER-20230803-042932

now the containers and how they see the gpu, they show the hpu in the following format
comes up with 5 options stating
Allocate 0 gpu.intel.com/i915 GPU
Allocate 1 gpu.intel.com/i915 GPU
Allocate 2 gpu.intel.com/i915 GPU
Allocate 3 gpu.intel.com/i915 GPU
Allocate 4 gpu.intel.com/i915 GPU
Allocate 5 gpu.intel.com/i915 GPU

I have tried every one of those with restarts in between with no acceleration at all

further investigation dmesg | grep i915

lsmod | grep i915
i915 3051520 2
drm_buddy 20480 1 i915
drm_display_helper 184320 1 i915
cec 61440 2 drm_display_helper,i915
ttm 94208 1 i915
drm_kms_helper 204800 2 drm_display_helper,i915
i2c_algo_bit 16384 1 i915
drm 614400 6 drm_kms_helper,drm_display_helper,drm_buddy,i915,ttm
video 65536 1 i915
@truenas:~$




sudo dmesg | grep i915
[sudo] password for admin:
[ 0.000000] Command line: BOOT_IMAGE=/ROOT/23.10-MASTER-20230803-042932@/boot/vmlinuz-6.1.42-production+truenas root=ZFS=boot-pool/ROOT/23.10-MASTER-20230803-042932 ro libata.allow_tpm=1 amd_iommu=on iommu=pt kvm_amd.npt=1 kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=N i915.force_probe=4E61
[ 0.017195] Kernel command line: BOOT_IMAGE=/ROOT/23.10-MASTER-20230803-042932@/boot/vmlinuz-6.1.42-production+truenas root=ZFS=boot-pool/ROOT/23.10-MASTER-20230803-042932 ro libata.allow_tpm=1 amd_iommu=on iommu=pt kvm_amd.npt=1 kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=N i915.force_probe=4E61
[ 6.013195] i915 0000:00:02.0: [drm] VT-d active for gfx access
[ 6.013401] i915 0000:00:02.0: vgaarb: deactivate vga console
[ 6.013485] i915 0000:00:02.0: [drm] Using Transparent Hugepages
[ 6.064989] i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[ 6.066080] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_component_ops [i915])
[ 6.066678] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/icl_dmc_ver1_09.bin (v1.9)
[ 6.241854] [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
[ 6.243428] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 6.274020] fbcon: i915drmfb (fb0) is primary device
[ 6.334982] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
admin@truenas[~]$
admin@truenas[~]$

-------

-------

lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation JasperLake [UHD Graphics] (rev 01)
root@truenas[~]#

----
----

lspci -nn |grep -Ei 'VGA|DISPLAY'
00:02.0 VGA compatible controller [0300]: Intel Corporation JasperLake [UHD Graphics] [8086:4e61] (rev 01)
root@truenas[~]#

---
---

Reply
Report


Thank you very much for reading this!

I know unra.id works with this cpu but im kind of set on truenas now, any help would be awesome!
 

Attachments

  • pload .png
    pload .png
    201 KB · Views: 117
Joined
Aug 4, 2023
Messages
4
Hi,

I was on the stable version and tried the nightly build hoping that the new Linux kernel would solve the issue with my Topton N5105 NAS motherboard. I did not manage to solve it with Truenas Cobia Nightly version you used yourself. So I went back to the stable version and after reading more on the forum, I found some important information that could make N5105's iGPU hardware acceleration work with TrueNAS-SCALE-22.12.3.3. Here is my summary:

(Typically, I gathered the informations from https://www.truenas.com/community/t...uration-empty-for-all-apps.104971/post-740685 and https://www.truenas.com/community/t...newer-intel-cpus-in-scale.100046/#post-768103)

Review dmesg result to see if there are issues with the iGPU firmware.

Code:
admin@truenas[~]$ sudo dmesg | grep i915
[    7.654898] i915 0000:00:02.0: [drm] VT-d active for gfx access
[    7.656190] i915 0000:00:02.0: vgaarb: deactivate vga console
[    7.665653] i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[    7.666601] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_component_ops [i915])
[    7.667514] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/icl_dmc_ver1_09.bin (v1.9)
[    7.675526] i915 0000:00:02.0: Direct firmware load for i915/ehl_guc_62.0.0.bin failed with error -2
[    7.675533] i915 0000:00:02.0: [drm] GuC firmware i915/ehl_guc_62.0.0.bin: fetch failed with error -2
[    7.675537] i915 0000:00:02.0: [drm] GuC firmware(s) can be downloaded from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915
[    7.822673] i915 0000:00:02.0: [drm] GuC is uninitialized
[    7.842668] [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
[    7.844532] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   10.545296] fbcon: i915drmfb (fb0) is primary device
[   10.596575] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device


The interesting part here is that the GuC and the HuC firmwares are not found. Let's verify with the following commands. For GuC firmware:

Code:
admin@truenas[~]$ sudo cat /sys/kernel/debug/dri/0/gt/uc/guc_info
GuC firmware: i915/ehl_guc_62.0.0.bin
    status: MISSING
    version: wanted 62.0, found 0.0
    uCode: 0 bytes
    RSA: 0 bytes

GuC status 0x00000001:
    Bootrom status = 0x0
    uKernel status = 0x0
    MIA Core status = 0x0

Scratch registers:
     0:     0x0
     1:     0x0
     2:     0x0
     3:     0x0
     4:     0x0
     5:     0x0
     6:     0x0
     7:     0x0
     8:     0x0
     9:     0x0
    10:     0x0
    11:     0x0
    12:     0x0
    13:     0x0
    14:     0x0
    15:     0x0

GuC log relay not created


For HuC firmware

Code:
admin@truenas[~]$ sudo cat /sys/kernel/debug/dri/0/gt/uc/huc_info
HuC firmware: i915/ehl_huc_9.0.0.bin
    status: ERROR
    version: wanted 9.0, found 0.0
    uCode: 0 bytes
    RSA: 0 bytes
HuC status: 0x00000000


Now, let's solve the issue:

Firt, let's check what files are missing:

Code:
admin@truenas[~]$ ls /lib/firmware/i915
adls_dmc_ver2_01.bin  bxt_guc_ver9_29.bin     cnl_dmc_ver1_07.bin  glk_dmc_ver1_04.bin     icl_dmc_ver1_09.bin      kbl_dmc_ver1_01.bin  kbl_huc_4.0.0.bin      skl_guc_32.0.3.bin  skl_guc_ver9_33.bin     tgl_guc_49.0.1.bin
bxt_dmc_ver1.bin      bxt_huc_2.0.0.bin         dg1_dmc_ver2_02.bin  glk_guc_32.0.3.bin     icl_guc_32.0.3.bin      kbl_dmc_ver1_04.bin  kbl_huc_ver02_00_1810.bin  skl_guc_33.0.0.bin  skl_huc_2.0.0.bin         tgl_huc_7.0.12.bin
bxt_dmc_ver1_07.bin   bxt_huc_ver01_07_1398.bin  dg1_guc_49.0.1.bin   glk_guc_33.0.0.bin     icl_guc_33.0.0.bin      kbl_guc_32.0.3.bin   rkl_dmc_ver2_02.bin      skl_guc_49.0.1.bin  skl_huc_ver01_07_1398.bin  tgl_huc_7.0.3.bin
bxt_guc_32.0.3.bin    bxt_huc_ver01_8_2893.bin     dg1_huc_7.7.1.bin    glk_guc_49.0.1.bin     icl_guc_49.0.1.bin      kbl_guc_33.0.0.bin   skl_dmc_ver1.bin          skl_guc_ver1.bin    tgl_dmc_ver2_04.bin     tgl_huc_7.5.0.bin
bxt_guc_33.0.0.bin    cml_guc_33.0.0.bin     ehl_guc_33.0.4.bin   glk_huc_4.0.0.bin         icl_huc_9.0.0.bin      kbl_guc_49.0.1.bin   skl_dmc_ver1_23.bin      skl_guc_ver4.bin    tgl_dmc_ver2_06.bin
bxt_guc_49.0.1.bin    cml_guc_49.0.1.bin     ehl_guc_49.0.1.bin   glk_huc_ver03_01_2893.bin  icl_huc_ver8_4_3238.bin  kbl_guc_ver9_14.bin  skl_dmc_ver1_26.bin      skl_guc_ver6.bin    tgl_dmc_ver2_08.bin
bxt_guc_ver8_7.bin    cml_huc_4.0.0.bin         ehl_huc_9.0.0.bin    icl_dmc_ver1_07.bin     kbl_dmc_ver1.bin      kbl_guc_ver9_39.bin  skl_dmc_ver1_27.bin      skl_guc_ver6_1.bin  tgl_guc_35.2.0.bin


You can see that the ehl_huc_9.0.0.bin file is present but not ehl_guc_62.0.0.bin. You will need to download the missing file in the /lib/firmware/i915 folder.

Code:
admin@truenas[~]$ cd /lib/firmware/i915 
admin@truenas[/lib/firmware/i915]$ wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/i915/ehl_guc_62.0.0.bin


Make sure to enable GuC/HuC firmwares at boot (https://wiki.archlinux.org/title/intel_graphics#Enable_GuC_.2F_HuC_firmware_loading). Execute the following command:

sudo midclt call system.advanced.update '{"kernel_extra_options": "i915.enable_guc=3"}'

You will now need to reboot the machine.

Verify that the firmwares are correctly loaded:


Code:
admin@truenas[~]$ sudo dmesg | grep i915
[    0.000000] Command line: BOOT_IMAGE=/ROOT/22.12.3.3@/boot/vmlinuz-5.15.107+truenas root=ZFS=boot-pool/ROOT/22.12.3.3 ro libata.allow_tpm=1 amd_iommu=on iommu=pt kvm_amd.npt=1 kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=N i915.enable_guc=3
[    0.021738] Kernel command line: BOOT_IMAGE=/ROOT/22.12.3.3@/boot/vmlinuz-5.15.107+truenas root=ZFS=boot-pool/ROOT/22.12.3.3 ro libata.allow_tpm=1 amd_iommu=on iommu=pt kvm_amd.npt=1 kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=N i915.enable_guc=3
[    7.705244] i915 0000:00:02.0: [drm] VT-d active for gfx access
[    7.707683] i915 0000:00:02.0: vgaarb: deactivate vga console
[    7.727237] i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[    7.729807] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/icl_dmc_ver1_09.bin (v1.9)
[    7.730127] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_component_ops [i915])
[    7.917858] i915 0000:00:02.0: [drm] GuC firmware i915/ehl_guc_62.0.0.bin version 62.0 submission:enabled
[    7.917873] i915 0000:00:02.0: [drm] GuC SLPC: disabled
[    7.917876] i915 0000:00:02.0: [drm] HuC firmware i915/ehl_huc_9.0.0.bin version 9.0 authenticated:yes
[    7.947388] [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
[    7.949232] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   10.650088] fbcon: i915drmfb (fb0) is primary device
[   10.703507] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device


The firmwares are enabled, you can now configure Jellyfin. Get list of codecs supported by the iGPU, open a shell in Jellyfin's container, and type

Code:
admin@truenas[~]$ /usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128


You will get the following result:

Code:
admin@truenas[~]$ /usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128         
Trying display: drm
libva info: VA-API version 1.18.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_18
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.18 (libva 2.18.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 23.1.6 (8589406)
vainfo: Supported profile and entrypoints
      VAProfileNone                   :    VAEntrypointVideoProc
      VAProfileNone                   :    VAEntrypointStats
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointVLD
      VAProfileH264Main               :    VAEntrypointEncSliceLP
      VAProfileH264High               :    VAEntrypointVLD
      VAProfileH264High               :    VAEntrypointEncSliceLP
      VAProfileVC1Simple              :    VAEntrypointVLD
      VAProfileVC1Main                :    VAEntrypointVLD
      VAProfileVC1Advanced            :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointVLD
      VAProfileJPEGBaseline           :    VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:    VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :    VAEntrypointVLD
      VAProfileHEVCMain               :    VAEntrypointVLD
      VAProfileHEVCMain               :    VAEntrypointEncSliceLP
      VAProfileHEVCMain10             :    VAEntrypointVLD
      VAProfileHEVCMain10             :    VAEntrypointEncSliceLP
      VAProfileVP9Profile0            :    VAEntrypointVLD
      VAProfileVP9Profile0            :    VAEntrypointEncSliceLP
      VAProfileVP9Profile1            :    VAEntrypointVLD
      VAProfileVP9Profile1            :    VAEntrypointEncSliceLP
      VAProfileVP9Profile2            :    VAEntrypointVLD
      VAProfileVP9Profile2            :    VAEntrypointEncSliceLP
      VAProfileVP9Profile3            :    VAEntrypointVLD
      VAProfileVP9Profile3            :    VAEntrypointEncSliceLP
      VAProfileHEVCMain422_10         :    VAEntrypointVLD
      VAProfileHEVCMain444            :    VAEntrypointVLD
      VAProfileHEVCMain444            :    VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         :    VAEntrypointVLD
      VAProfileHEVCMain444_10         :    VAEntrypointEncSliceLP


You can now select the codec that the iGPU supports in Jellyfin configuration (Menu>Administration Dashboard>Playback):

1691268380869.png


This is where I am now. For videos using unsupported codecs (e.g. AV1), you will still use the software transcoding. Which is maybe not something wished. Reencoding those videos using a supported codec could be a solution.
 

help!

Explorer
Joined
Aug 3, 2023
Messages
57
Ive bin trying to do this for days thank you so much
 

help!

Explorer
Joined
Aug 3, 2023
Messages
57
I cant even get the firmware, that code isnt working?
 

help!

Explorer
Joined
Aug 3, 2023
Messages
57
totally stuck here

$ /usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128
Trying display: drm
Faile

ive rebooted the server, this is a fresh intal same one you hafe and same chip

n5105

both drivers are installed for sure
 

help!

Explorer
Joined
Aug 3, 2023
Messages
57
THis is amazing, You fixed it thank you very much mate!

been two days full days of getting nowhere,

thank you very much!!!
 

Siress

Dabbler
Joined
Jul 20, 2023
Messages
11
Thank you both for the write ups on this topic. Using the same topton mobo, I've been following your adventure while running TrueNAS Cobia (TrueNAS-SCALE-23.10-BETA.1). I've managed to get the firmware loaded, guc/huc enabled on boot, and am able to deploy the jellyfin containers with allocated GPU cores and have it continue to function.

The container cannot find "the given device" though... Any advice?
1695525466783.png


It was mentioned that this verison of TrueNAS maybe incompatible. Looks like RC1 is out so I'll likely upgrade to it and give it a whirl if nothing here jumps out. (EDIT: Upgraded to RC1. No change)

These may help:
1695526950385.png


(truncated guc_info as there's a lot...)
1695527010461.png


1695527043110.png


1695527076495.png
 
Last edited:
Joined
Aug 4, 2023
Messages
4
Hi @Siress

I did try to use Cobia but I had also some troubles. It seems that it works with the stable release Bluefin. Is there any specific reason why you want to run your NAS with Cobia instead?
 

Siress

Dabbler
Joined
Jul 20, 2023
Messages
11
Hello!

I want to stick with Cobia because I don't want to migrate my upgraded zfs pool off and back... that's all. I managed to get past the issue above, but h.265 decoding is still going to the CPU. The Jellyfin documentation did warn that OpenCL is needed for Intel GPUs, and isn't available on TrueNAS. Perhaps we need Jellyfin in a VM to really enable HW acceleration?
 
Joined
Aug 4, 2023
Messages
4
Hi @Siress !

Did you find a way to fix it? I just updated to Cobia since it is now the Stable version. I have the same issue with h265/hevc. It reports that the decoder is supported when using `/usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128`. But when playing a HEVC encoded video, jellyfin-ffmpeg fails with

[h264_qsv @ 0x5607be740900] Selected ratecontrol mode is unsupported
[h264_qsv @ 0x5607be740900] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Thanks!
 
Joined
Aug 4, 2023
Messages
4
Actually, I just had to enable GuC on boot with `sudo midclt call system.advanced.update '{"kernel_extra_options": "i915.enable_guc=3"}'` and it works.
 
Top