Jim's Blog
Toggle navigation
Jim's Blog
Home
About Me
Archives
Tags
基于 12&13&14 代 Intel® 处理器安装群晖 SA6400 并驱动核显和 NVIDIA GeForce RTX 3080 12G 显卡
2023-07-16 06:42:44
15162
0
0
jim
# 驱动获取请参考下方链接 https://jim.plus/blog/post/jim/synology-sa6400-with-i915 # 更新记录 > ~~FLEX 电源线不匹配,3080 独显暂时没法测试,后续再更新。~~ > 去买了一个海韵 `PX-1300` 电源来测试 * 2023-08-22 更新 Emby 硬解测试 * 2023-08-21 更新 3080 12G 独显驱动安装和 Jellyfin 硬解测试 * 2023-07-16 更新核显驱动安装与硬解测试 > 备注:这里测试的时候,转码的码率没有统一,有待重新测试纠正。 # 测试硬件 * 主板:华硕 ProArt Z790-CREATOR WIFI * 板载接口:AQC 113C 10G 网卡,i226 2.5G 网卡,双口雷电 4 * 处理器:Intel® i3 13100 * 内存:金士顿 64G * 电源:全汉 FSP Flex-500G、海韵 PX-1300 * 硬盘:SanDisk X400 256G * 引导 U 盘:SanDisk CZ880 128G ![ASUS ProArt Z790.png](https://blog.jim.plus/api/file/getAttach?fileId=64b009e240527c000c00d0da) # 安装群晖 SA6400 引导同 https://jim.plus/blog/post/jim/j6413-with-synology-sa6400 ![SA6400-Info.png](https://blog.jim.plus/api/file/getAttach?fileId=64b38eee40527c000c00d636) ## 测试用到的驱动列表 | 驱动名称 | 描述 | | --- | --- | | atlantic | AQC 网卡驱动 | | amdgpu | AMD 显卡驱动 | | igc | 英特尔 I225、I226 网卡驱动 | | i915 | 英特尔核显驱动 | | iptable 系列 | netfilter 相关驱动 | | nvidia 系列 | 英伟达显卡驱动 | | thunderbolt | 雷电设备驱动 | | vfio 系列 | 硬件直通相关驱动 | # 安装核显驱动 > 这里的驱动编译自:https://github.com/intel/linux-intel-lts,在此感谢英特尔为 `Linux 5.10` 内核移植了 12 代核显驱动,本文中使用的驱动是从 `Linux 5.15` 内核移植了 13&14 代核显驱动到 `Linux 5.10` 内核。 引导中的核显驱动是主线 `Linux 5.10` 内核自带的,支持到 11 代,这里要更新到支持 12&13&14 代的。 这里编译的驱动会安装到群晖的 ramdisk 并固化到 arpl 引导中。 > 驱动用的英特尔的,intel-i915-installer 工具是闭源的,这里仅用于测试。 ``` # ./intel-i915-installer -install -loader prepare ram disk output: 690179 blocks copy tgl_dmc_ver2_12.bin to /tmp/ramdisk/lib/firmware/i915/tgl_dmc_ver2_12.bin copy tgl_guc_70.1.1.bin to /tmp/ramdisk/lib/firmware/i915/tgl_guc_70.1.1.bin copy tgl_guc_70.bin to /tmp/ramdisk/lib/firmware/i915/tgl_guc_70.bin copy tgl_huc.bin to /tmp/ramdisk/lib/firmware/i915/tgl_huc.bin copy tgl_huc_7.9.3.bin to /tmp/ramdisk/lib/firmware/i915/tgl_huc_7.9.3.bin copy modules/md5.ko to /tmp/ramdisk/usr/lib/modules/md5.ko copy modules/backport-sa6400-export-intel-lts.ko to /tmp/ramdisk/usr/lib/modules/backport-sa6400-export-intel-lts.ko copy modules/backport-sa6400-export.ko to /tmp/ramdisk/usr/lib/modules/backport-sa6400-export.ko copy modules/backport-sa6400.ko to /tmp/ramdisk/usr/lib/modules/backport-sa6400.ko copy modules/backport-dma-buf.ko to /tmp/ramdisk/usr/lib/modules/backport-dma-buf.ko copy modules/backlight.ko to /tmp/ramdisk/usr/lib/modules/backlight.ko copy modules/video.ko to /tmp/ramdisk/usr/lib/modules/video.ko copy modules/fbdev.ko to /tmp/ramdisk/usr/lib/modules/fbdev.ko copy modules/fbcore.ko to /tmp/ramdisk/usr/lib/modules/fbcore.ko copy modules/hdmi.ko to /tmp/ramdisk/usr/lib/modules/hdmi.ko copy modules/drm_mipi_dsi.ko to /tmp/ramdisk/usr/lib/modules/drm_mipi_dsi.ko copy modules/drm_panel_orientation_quirks.ko to /tmp/ramdisk/usr/lib/modules/drm_panel_orientation_quirks.ko copy modules/drm.ko to /tmp/ramdisk/usr/lib/modules/drm.ko copy modules/drm_kms_helper.ko to /tmp/ramdisk/usr/lib/modules/drm_kms_helper.ko copy modules/ttm.ko to /tmp/ramdisk/usr/lib/modules/ttm.ko update grub env output: origin dsm_cmdline: withefi syno_hw_version=SA6400 i915.enable_guc=2 netif_num=4 synoboot2 pid=0x0001 mac2=7e21363bcd30 mac3=7e21363bcd50 mac1=7e21363bcd10 mac4=7e21363bcd70 sn=2270XXXBN4YEE SMBusHddDynamicPower=1 vid=0x46f4 vender_format_version=2 i915.disable_display=1 syno_ttyS1=serial,0x2f8 syno_ttyS0=serial,0x3f8 new dsm_cmdline: withefi syno_hw_version=SA6400 netif_num=4 synoboot2 pid=0x0001 mac2=7e21363bcd30 mac3=7e21363bcd50 mac1=7e21363bcd10 mac4=7e21363bcd70 sn=2270XXXBN4YEE SMBusHddDynamicPower=1 vid=0x46f4 vender_format_version=2 syno_ttyS1=serial,0x2f8 syno_ttyS0=serial,0x3f8 i915.enable_guc=1 update loader output: '/tmp/ramdisk/lib/firmware/i915/tgl_dmc_ver2_04.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_dmc_ver2_04.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_dmc_ver2_06.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_dmc_ver2_06.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_dmc_ver2_08.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_dmc_ver2_08.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_dmc_ver2_12.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_dmc_ver2_12.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_guc_35.2.0.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_guc_35.2.0.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_guc_49.0.1.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_guc_49.0.1.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_guc_70.1.1.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_guc_70.1.1.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_guc_70.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_guc_70.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_huc.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_huc.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_huc_7.0.12.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_huc_7.0.12.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_huc_7.0.3.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_huc_7.0.3.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_huc_7.5.0.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_huc_7.5.0.bin' '/tmp/ramdisk/lib/firmware/i915/tgl_huc_7.9.3.bin' -> '/mnt/synoboot3/modules-sa6400/firmware/i915/tgl_huc_7.9.3.bin' save ram disk output: 690179 blocks ``` 安装成功后可以通过运行下面的命令查看核显信息和核显利用率: ``` docker run --privileged --rm -it --entrypoint=/usr/bin/lsgpu ghcr.io/xpenology-community/docker-intel-gpu-tools docker run --privileged --rm -it --entrypoint=/usr/bin/intel_gpu_top ghcr.io/xpenology-community/docker-intel-gpu-tools ``` 下面是群晖 SA6400 的内核与硬解的核显信息: ![Intel-GPU-Info.png](https://blog.jim.plus/api/file/getAttach?fileId=64b3974640527c000c00d66c) 下面是硬解的核显利用率: ![Intel-GPU-Top.png](https://blog.jim.plus/api/file/getAttach?fileId=64b3912240527c000c00d639) # 安装 NVIDIA 3080 12G 驱动 英伟达有提供驱动包,不过依赖比较多,群晖中缺少完整的编译工具和依赖,所以我们需要自己使用开源的 open-gpu-kernel-modules 和群晖提供的编译环境去编译驱动,然后利用英伟达提供的驱动板安装显卡相关的工具。 ## 编译开源的 open-gpu-kernel-modules > 官方源码:https://github.com/NVIDIA/open-gpu-kernel-modules,在此感谢英伟达开源了显卡驱动。 ``` # ./build.sh make -C src/nvidia make -C src/nvidia-modeset make[1]: Entering directory '/usr/src/open-gpu-kernel-modules/src/nvidia' make[1]: Entering directory '/usr/src/open-gpu-kernel-modules/src/nvidia-modeset' make[1]: Nothing to be done for 'default'. make[1]: Leaving directory '/usr/src/open-gpu-kernel-modules/src/nvidia-modeset' cd kernel-open/nvidia-modeset/ && ln -sf ../../src/nvidia-modeset/_out/Linux_x86_64/nv-modeset-kernel.o nv-modeset-kernel.o_binary make[1]: Nothing to be done for 'default'. make[1]: Leaving directory '/usr/src/open-gpu-kernel-modules/src/nvidia' cd kernel-open/nvidia/ && ln -sf ../../src/nvidia/_out/Linux_x86_64/nv-kernel.o nv-kernel.o_binary make -C kernel-open modules make[1]: Entering directory '/usr/src/open-gpu-kernel-modules/kernel-open' make[2]: Entering directory '/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/lib/modules/DSM-7.2/build' scripts/Makefile.lib:8: 'always' is deprecated. Please use 'always-y' instead MODPOST /usr/src/open-gpu-kernel-modules/kernel-open/Module.symvers make[2]: Leaving directory '/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/sys-root/usr/lib/modules/DSM-7.2/build' make[1]: Leaving directory '/usr/src/open-gpu-kernel-modules/kernel-open' MODPOST /usr/src/open-gpu-kernel-modules/native_write_cr4/Module.symvers '/usr/src/open-gpu-kernel-modules/kernel-open/nvidia-peermem.ko' -> '/usr/src/open-gpu-kernel-modules/output/7.2/nvidia-peermem.ko' '/usr/src/open-gpu-kernel-modules/kernel-open/nvidia-uvm.ko' -> '/usr/src/open-gpu-kernel-modules/output/7.2/nvidia-uvm.ko' '/usr/src/open-gpu-kernel-modules/kernel-open/nvidia-drm.ko' -> '/usr/src/open-gpu-kernel-modules/output/7.2/nvidia-drm.ko' '/usr/src/open-gpu-kernel-modules/kernel-open/nvidia-modeset.ko' -> '/usr/src/open-gpu-kernel-modules/output/7.2/nvidia-modeset.ko' '/usr/src/open-gpu-kernel-modules/kernel-open/nvidia.ko' -> '/usr/src/open-gpu-kernel-modules/output/7.2/nvidia.ko' '/usr/src/open-gpu-kernel-modules/native_write_cr4/native_write_cr4.ko' -> '/usr/src/open-gpu-kernel-modules/output/7.2/native_write_cr4.ko' ``` ## 安装显卡驱动和工具安装包 ### 安装依赖库 ``` wget https://download.nvidia.com/XFree86/Linux-x86_64/535.54.03/NVIDIA-Linux-x86_64-535.54.03-no-compat32.run # 准备必要的依赖项 opkg install ldconfig cp -l /bin/kmod /bin/depmod # 默认的 /tmp 是没有 exec 权限的,这里重新挂载一下 mount -o remount,exec /tmp sh NVIDIA-Linux-x86_64-535.54.03-no-compat32.run --no-kernel-modules --no-dkms --no-systemd --no-questions ``` ### 加载驱动 > 驱动需要开机加载 ``` insmod native_write_cr4.ko insmod nvidia.ko NVreg_OpenRmEnableUnsupportedGpus=1 insmod nvidia-uvm.ko ``` ## 查看独显信息和转码时利用率 ``` bash-4.4# nvidia-smi Tue Aug 22 11:33:35 2023 +---------------------------------------------------------------------------------------+ | NVIDIA-SMI 535.54.03 Driver Version: 535.54.03 CUDA Version: 12.2 | |-----------------------------------------+----------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+======================+======================| | 0 NVIDIA GeForce RTX 3080 Off | 00000000:02:00.0 Off | N/A | | 30% 49C P2 151W / 350W | 765MiB / 12288MiB | 3% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+ +---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | 0 N/A N/A 31008 C /usr/lib/jellyfin-ffmpeg/ffmpeg 752MiB | +---------------------------------------------------------------------------------------+ ``` # Jellyfin 和 Emby 硬解测试 本人非专业测试人员,所有的测试都是想到哪儿测试哪儿,如有不正确的地方,欢迎可留言指点。 测试视频:杜比视界和杜比全景声 4K 原版 ## Jellyfin **运行命令** ``` basedir=/volume1/Test/jellyfin/ config=${basedir}/config media=${basedir}/media mkdir -p ${config} mkdir -p ${media} docker run \ --network=host \ --privileged \ -v "${config}":/config \ -v "${media}":/media \ -e TZ="Asia/Shanghai" \ -e UID=0 \ -e GID=0 \ -e GIDLIST=0 \ --restart always \ --name jellyfin \ -d nyanmisaka/jellyfin:230810-amd64 ``` 由于没有安装 `nvidia-container-toolkit` 自动设置相关容器依赖库,这里需要手动去 `Jellyfin` 执行一下安装相关库,和之前的命令是一样的: ``` sh NVIDIA-Linux-x86_64-535.54.03-no-compat32.run --no-kernel-modules --no-dkms --no-systemd --no-questions ``` ### 核显 ![Jellyfin-UHD730-8K-to-1080p.png](https://blog.jim.plus/api/file/getAttach?fileId=64b3901940527c000c00d637) ### NVIDIA 3080 12G > 3080 转码太快了,测试视频太短了,稍不注意就转完了,不过好像色调有些异常,这个后面再研究。 ![Jellyfin-3080-12G-4K-to-1080p.png](https://blog.jim.plus/api/file/getAttach?fileId=64e364c440527c000c003b19) #### 命令行测试 ``` /usr/lib/jellyfin-ffmpeg/ffmpeg -v debug -init_hw_device cuda ``` TODO ## Emby **运行命令** ``` basedir=/volume1/Test/emby config=${basedir}/config media=${basedir}/media mkdir -p ${config} mkdir -p ${media} docker run \ --network=bridge \ --privileged \ -p '8097:8096' \ -p '8921:8920' \ -p '1901:1900/udp' \ -p '7360:7359/udp' \ -v "${config}":/config \ -v "${media}":/media \ -e TZ="Asia/Shanghai" \ -e UID=0 \ -e GID=0 \ -e GIDLIST=0 \ --restart always \ --name emby \ -d emby开心版镜像 ``` ### 核显 ![Emby-UHD730-8K-to-1080p.png](https://blog.jim.plus/api/file/getAttach?fileId=64b3902a40527c000c00d638) ### NVIDIA 3080 12G 这里测试的 Emby 容器是精简过的,无法正常想 Jellyfin 一样直接安装依赖,所以手动复制进去 copy-nvidia-lib.sh 脚本内容如下: ``` #!/bin/sh container=$1 libs="/usr/lib/libcuda.so /usr/lib/libcuda.so.1 /usr/lib/libcuda.so.535.54.03 /usr/lib/libnvcuvid.so.1 /usr/lib/libnvcuvid.so.535.54.03 /usr/lib/libnvidia-encode.so /usr/lib/libnvidia-encode.so.1 /usr/lib/libnvidia-encode.so.535.54.03 /usr/lib/libnvidia-ptxjitcompiler.so /usr/lib/libnvidia-ptxjitcompiler.so.1 /usr/lib/libnvidia-ptxjitcompiler.so.535.54.03" for lib in $libs; do docker cp "$lib" "$container":/lib done ``` Emby 转码设置 ![Emby-3080-12G-Transcode-Setting.png](https://blog.jim.plus/api/file/getAttach?fileId=64e4260440527c000c003cc5) Emby 播放转码视频 ![Emby-3080-12G-4K-to-1080p.png](https://blog.jim.plus/api/file/getAttach?fileId=64e4279140527c000c003cc8) # 显卡直通测试 TODO # 核显 SR-IOV 测试 TODO # 结束语 ## 关于驱动 英特尔核显驱动安装好后,Jellyfin 和 Emby 默认集成了依赖的库,可以直接硬解转码,而英伟达的驱动和依赖是绑定的,需要注入依赖给 Jellyfin 和 Emby 后才能硬解转码。 性能方面 UHD 730 一般般,实际性能比群友测试的 UHD 770 差很多。独显就不评价了,这里的测试只是验证可行性,很少有人会拿独显专门去硬解转码的。 ## 关于直通给虚拟机 TODO
Pre:
群晖英伟达独显驱动安装(基于 SA6400 7.2,支持 30&40 系独显)
Next:
如何创建一个纯 NVMe 固态的群晖
0
likes
15162
新浪微博
微信
腾讯微博
QQ空间
人人网
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus
Table of content