扫描二维码关注官方公众号
返回列表 发布新帖

[讨论/分享] 分享一个ubuntu虚拟918+开启photo人脸识别的办法

5276 11
发表于 2021-10-7 02:05:24 | 显示全部楼层 阅读模式

来吧兄弟,一起玩一起讨论!

您需要 登录 才可以下载或查看,没有账号?注册

×
本帖最后由 ma20at 于 2021-10-7 02:08 编辑

之前的虚拟机类似是用uefi模式创建的,显卡启用gvt-g后jellyfin可以识别vGpu开启硬解,photo的人脸无法识别。今晚没事干看到有个网友分享了pve开启人脸识别,就重新创建了一个bios模式启动的虚拟机,终于可以识别了,我有多个虚拟机所以需要gvt-g虚拟多个vGpu,单虚拟机直接显卡passthrough也一样。ubuntu宿主机怎么启用gvt-g就不说了官方有文档可以参考。大概步骤:1. 虚拟机类型选择i440fx芯片组BIOS启动,os选择redhat6. vCPU选择kvm64就行,网卡类型直接virtio可以识别。
屏幕截图 2021-10-07 015007.jpg
2.虚拟机虚拟gpu设置部分,我懒得截图,直接把虚拟机的配置文件贴出来,直接参考最后<graphics type="spice">到结束部分。
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
  <name>dsm7</name>
  <uuid>dd64d1c6-cd37-4e1f-9d88-d6e4eb148bc1</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://redhat.com/rhel/6.0"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">8388608</memory>
  <currentMemory unit="KiB">8388608</currentMemory>
  <vcpu placement="static">4</vcpu>
  <os>
    <type arch="x86_64" machine="pc-i440fx-focal">hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state="off"/>
  </features>
  <cpu mode="custom" match="exact" check="partial">
    <model fallback="allow">kvm64</model>
  </cpu>
  <clock offset="utc">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw"/>
      <source file="/var/lib/libvirt/images/dsm7boot.img"/>
      <target dev="sda" bus="sata"/>
      <boot order="1"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw"/>
      <source file="/var/lib/libvirt/images/dsm7os.img"/>
      <target dev="sdb" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="1"/>
    </disk>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw"/>
      <source file="/var/lib/libvirt/images/ds7soft.img"/>
      <target dev="sdc" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="2"/>
    </disk>
    <disk type="block" device="disk">
      <driver name="qemu" type="raw" cache="none" io="native"/>
      <source dev="/dev/disk/by-id/wwn-0x5000039fe6e2f731-part1"/>
      <target dev="sdd" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="3"/>
    </disk>
    <disk type="block" device="disk">
      <driver name="qemu" type="raw" cache="none" io="native"/>
      <source dev="/dev/disk/by-id/wwn-0x5000cca097df7be5"/>
      <target dev="sde" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="4"/>
    </disk>
    <disk type="block" device="disk">
      <driver name="qemu" type="raw" cache="none" io="native"/>
      <source dev="/dev/disk/by-id/md-uuid-dd395b79:b830c522:8a7eee05:aa2b9700"/>
      <target dev="sdf" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="5"/>
    </disk>
    <controller type="usb" index="0" model="ich9-ehci1">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x7"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci1">
      <master startport="0"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x0" multifunction="on"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci2">
      <master startport="2"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x1"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci3">
      <master startport="4"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x2"/>
    </controller>
    <controller type="pci" index="0" model="pci-root"/>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x07" function="0x0"/>
    </controller>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x08" function="0x0"/>
    </controller>
    <interface type="bridge">
      <mac address="00:11:32:12:34:e6"/>
      <source bridge="br0"/>
      <model type="virtio"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
    </interface>
    <serial type="pty">
      <target type="isa-serial" port="0">
        <model name="isa-serial"/>
      </target>
    </serial>
    <console type="pty">
      <target type="serial" port="0"/>
    </console>
    <channel type="unix">
      <target type="virtio" name="org.qemu.guest_agent.0"/>
      <address type="virtio-serial" controller="0" bus="0" port="1"/>
    </channel>
    <channel type="spicevmc">
      <target type="virtio" name="com.redhat.spice.0"/>
      <address type="virtio-serial" controller="0" bus="0" port="2"/>
    </channel>
    <input type="tablet" bus="usb">
      <address type="usb" bus="0" port="1"/>
    </input>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <graphics type="spice">
      <listen type="none"/>
      <gl enable="yes" rendernode="/dev/dri/by-path/pci-0000:00:02.0-render"/>
    </graphics>
    <video>
      <model type="none"/>
    </video>
    <hostdev mode="subsystem" type="mdev" managed="no" model="vfio-pci" display="on">
      <source>
        <address uuid="e03e1b1a-45cf-4876-8a09-99a0db1bd79a"/>
      </source>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
    </hostdev>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x09" function="0x0"/>
    </memballoon>
  </devices>
  <qemu:commandline>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.x-igd-opregion=on"/>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.ramfb=on"/>
    <qemu:arg value="-set"/>
    <qemu:arg value="device.hostdev0.driver=vfio-pci-nohotplug"/>
    <qemu:env name="INTEL_DEBUG" value="norbc"/>
  </qemu:commandline>
</domain>

3.上图看看效果。
屏幕截图 2021-10-07 013640.jpg




评论11

wjq_xpLv.10 发表于 2021-10-7 16:52:17 | 显示全部楼层
楼主用的是什么CPU?听说人脸识别跟CPU型号有关。
回复 点赞

使用道具 举报

ma20at楼主Lv.2 发表于 2021-10-7 20:38:08 | 显示全部楼层
wjq_xp 发表于 2021-10-7 16:52
楼主用的是什么CPU?听说人脸识别跟CPU型号有关。

我的是9代奔腾G5500T跟cpu无关,我虚拟机给的是kvm64的虚拟cpu一样可以识别,关键是显卡直通后能否识别,另外虚拟机得用bios引导uefi就是不行,可能跟显卡的firemware有关。只要i915能驱动的intel HD6xx系列应该都用吧。
root@dsm7:~# lsmod|grep i915;ll /dev/dri
i915                 1310034  0
drm_kms_helper        121097  1 i915
drm                   311151  3 i915,drm_kms_helper
iosf_mbi                4298  1 i915
fb                     34959  2 i915,drm_kms_helper
video                  27139  1 i915
backlight               6219  2 i915,video
button                  5105  1 i915
i2c_algo_bit            5456  1 i915
total 0
drwxr-xr-x  2 root root              80 Oct  7 01:16 .
drwxr-xr-x 12 root root           14240 Oct  7 01:17 ..
crw-------  1 root root        226,   0 Oct  7 01:16 card0
crw-rw----  1 root videodriver 226, 128 Oct  7 01:16 renderD128
root@dsm7:~#
回复 点赞

使用道具 举报

wjq_xpLv.10 发表于 2021-10-7 22:10:15 | 显示全部楼层
ma20at 发表于 2021-10-7 20:38
我的是9代奔腾G5500T跟cpu无关,我虚拟机给的是kvm64的虚拟cpu一样可以识别,关键是显卡直通后能否识别, ...

我是i3 8100,ESXI直通核显安装的918-7.01,目前EMBY可以硬解的,证明核显是认的;还可以登录QC,证明SN也是没问题的;引导试过UEFI和传统,都不能人脸识别。就是不知道ESXI下怎么设置了。
QQ截图20211007220555.jpg
回复 点赞

使用道具 举报

ma20at楼主Lv.2 发表于 2021-10-8 21:11:33 | 显示全部楼层
wjq_xp 发表于 2021-10-7 22:10
我是i3 8100,ESXI直通核显安装的918-7.01,目前EMBY可以硬解的,证明核显是认的;还可以登录QC,证明SN ...

把引导输出和synofoto.log的输出弄出来看看。
dmesg |grep i915  ; grep libsynophoto-plugin-face.so /var/log/synofoto.log
回复 点赞

使用道具 举报

ma20at楼主Lv.2 发表于 2021-10-8 21:17:05 | 显示全部楼层
试试删除索引重新reindex
/var/packages/SynologyPhotos/target/usr/bin/synofoto-bin-clear-index-task -t all
/var/packages/SynologyPhotos/target/usr/bin/synofoto-bin-index-tool -t reindex -i /volume4/photo(改成照片实际的目录)
回复 点赞

使用道具 举报

wjq_xpLv.10 发表于 2021-10-9 09:37:59 | 显示全部楼层
ma20at 发表于 2021-10-8 21:17
试试删除索引重新reindex
/var/packages/SynologyPhotos/target/usr/bin/synofoto-bin-clear-index-task -t ...

显示的错误信息是:
uncaught thread task exception /source/synofoto/src/daemon/plugin/plugin_worker.cpp:90 plugin init failed: /var/packages/SynologyPhotos/target/usr/lib/libsynophoto-plugin-face.so
回复 点赞

使用道具 举报

ma20at楼主Lv.2 发表于 2021-10-9 23:32:00 | 显示全部楼层
wjq_xp 发表于 2021-10-9 09:37
显示的错误信息是:
uncaught thread task exception /source/synofoto/src/daemon/plugin/plugin_worker ...

那就是不行了,这个就是人脸识别的模块,我之前用UEFI引导就是爆这个错误,改成bios引导就可以了。你试试vm改成bios引导,然后虚机配置文件vmx里加下面2个参数,还不行就只能说vmware搞不定。
pcipSaveOPROM=TRUE
pciPassthru0.opromEnabled=TRUE
回复 点赞

使用道具 举报

chi65215180Lv.2 发表于 2021-10-11 16:53:57 来自手机 | 显示全部楼层
mark一下,g5400,pve gvt 硬解转码成功,人脸不行
回复 点赞

使用道具 举报

xgxxlLv.3 发表于 2021-10-11 20:29:35 | 显示全部楼层
chi65215180 发表于 2021-10-11 16:53
mark一下,g5400,pve gvt 硬解转码成功,人脸不行

能否截图看下你的虚拟机硬件配置吗?
回复 点赞

使用道具 举报

chi65215180Lv.2 发表于 2021-10-11 21:07:11 来自手机 | 显示全部楼层
xgxxl 发表于 2021-10-11 20:29
能否截图看下你的虚拟机硬件配置吗?

人脸识别失败,已经给删了,教程网上有的,先做gvt-g直通,https://www.xltyu.com/3299.html,然后就是普通的pve虚拟机,usb引导方式进去的。
回复 点赞

使用道具 举报

xgxxlLv.3 发表于 2021-10-12 02:57:28 来自手机 | 显示全部楼层
Gvt-g 能给群晖转码?我表示怀疑
回复 点赞

使用道具 举报

回复

懒得打字嘛,点击右侧快捷回复 【本站酷狼4T,750元】
您需要登录后才可以回帖 登录 | 注册

本版积分规则

投诉/建议联系

support@gebi1.cn

未经授权禁止转载,复制和建立镜像,
如有违反,追究法律责任
  • 关注公众号
  • 添加微信客服
Copyright © 2001-2024 隔壁网 版权所有 All Rights Reserved. 粤ICP备14056481号-1
关灯 在本版发帖
扫一扫添加微信客服
返回顶部
快速回复 返回顶部 返回列表