——-PVE主節點端設定————
1.下載debian版CT範本並建立,注意選項中的功能NFS,SMB/CIFS要打勾才可掛載NFS。(debian官方已編好intel內顯驅動PKG包,所以選它)
2.設定顯卡直通:主節點端編輯CT設定檔
vi /etc/pve/lxc/CT節點編號.conf
並加入
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
——-以下進入CT端————
3.啟動CT,安裝 screen,nfs-common,net-tools,ffmpeg,vainfo,安裝完畢後執行vainfo,出現以下面畫面代表核顯設定成功
vainfo: VA-API version: 1.10 (libva 2.10.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 ()
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileJPEGBaseline : VAEntrypointVLD
.....
4.掛NFS
vi /etc/fstab
加入
10.0.x.y:/對方目錄 /本地目錄 nfs defaults 0 0
5.設定語系
dpkg-reconfigure locales
6.重開機,確認語系設定是否正確,掛載點有無掛起,掛載目錄中的檔名有無正常
7.自此可執行ffmpeg轉檔並調用主機核顯
ffmpeg -vaapi_device /dev/dri/renderD128 -i 來源檔 -vf 'format=nv12,hwupload' -c:v h264_vaapi 目標檔