请问一个 PVE 下群晖 7.X GVT-G 人脸识别的问题

2022-08-06 11:27:48 +08:00
 glouhao

本人群晖是在 PVE 下,然后用 GVT-G 把核显分了俩,一个给了群晖,识别正常。群晖是用 USB 虚拟引导的。根据教程搞人脸识别出了问题:

kvm: -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/604e42e4-2e90-11ec-8861-037c58d42915,addr=02.0,x-igd-opregion=on,driver=vfio-pci-nohotplug: vfio 604e42e4-2e90-11ec-8861-037c58d42915: error getting device from group 11: File exists

USB 虚拟引导是这样的:

args: -device 'qemu-xhci,addr=0x18' -drive 'id=synoboot,file=/root/synology/DS9180727.img,if=none,format=raw' -device 'usb-storage,id=synoboot,drive=synoboot,bootindex=5' 

别人教程里设这样设置人脸识别的:

args: -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/604e42e4-2e90-11ec-8861-037c58d42915,addr=02.0,x-igd-opregion=on,driver=vfio-pci-nohotplug

我把两句直接复制进去会上面的那一句被删除,估计是配置文件里只能有一个 args ,然后我把他们合并一行:

args: -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/604e42e4-2e90-11ec-8861-037c58d42915,addr=02.0,x-igd-opregion=on,driver=vfio-pci-nohotplug -device 'qemu-xhci,addr=0x18' -drive 'id=synoboot,file=/root/synology/DS9180727.img,if=none,format=raw' -device 'usb-storage,id=synoboot,drive=synoboot,bootindex=5'

就出现了上面的错误。

下面是完整配置:

args: -device vfio-pci,sysfsdev=/sys/bus/mdev/devices/604e42e4-2e90-11ec-8861-037c58d42915,addr=02.0,x-igd-opregion=on,driver=vfio-pci-nohotplug -device 'qemu-xhci,addr=0x18' -drive 'id=synoboot,file=/root/synology/DS9180727.img,if=none,format=raw' -device 'usb-storage,id=synoboot,drive=synoboot,bootindex=5'
balloon: 2048
boot: order=ide2;net0
cores: 2
cpu: host
hookscript: local:snippets/gvt_g_0x02.pl
hostpci0: 0000:01:00.0
hostpci1: 0000:00:02.0,mdev=i915-GVTg_V5_8
ide2: none,media=cdrom
machine: q35
memory: 4096
name: DSM7.1
net0: e1000e=E6:02:85:E1:A8:57,bridge=vmbr0,firewall=1
numa: 0
onboot: 1
ostype: l26
sata0: sdb-hhd:101/vm-101-disk-1.qcow2,size=100G,ssd=1
scsihw: virtio-scsi-pci
smbios1: uuid=c31154f6-793a-4d4a-884a-7fe7cd29467d
sockets: 1
usb1: host=152d:1567,usb3=1
usb2: host=1-6,usb3=1
vga: none
vmgenid: 91f2a2ff-91d9-42c1-b83e-41078c9eb516

这个是复制系统修改的脚本:

#!/usr/bin/perl

# Exmple hook script for PVE guests (hookscript config option)
# You can set this via pct/qm with
# pct set <vmid> -hookscript <volume-id>
# qm set <vmid> -hookscript <volume-id>
# where <volume-id> has to be an executable file in the snippets folder
# of any storage with directories e.g.:
# qm set 100 -hookscript local:snippets/hookscript.pl

use strict;
use warnings;

print "GUEST HOOK: " . join(' ', @ARGV). "\n";

# First argument is the vmid

my $vmid = shift;

# Second argument is the phase

my $phase = shift;

if ($phase eq 'pre-start') {

    # First phase 'pre-start' will be executed before the guest
    # is started. Exiting with a code != 0 will abort the start

    print "$vmid is starting, doing preparations.\n";
    system("echo 604e42e4-2e90-11ec-8861-037c58d42915 > /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_8/create");

    # print "preparations failed, aborting."
    # exit(1);

} elsif ($phase eq 'post-start') {

    # Second phase 'post-start' will be executed after the guest
    # successfully started.

    print "$vmid started successfully.\n";
    system("echo 1 > /sys/bus/mdev/devices/604e42e4-2e90-11ec-8861-037c58d42915/remove");

} elsif ($phase eq 'pre-stop') {

    # Third phase 'pre-stop' will be executed before stopping the guest
    # via the API. Will not be executed if the guest is stopped from
    # within e.g., with a 'poweroff'

    print "$vmid will be stopped.\n";

} elsif ($phase eq 'post-stop') {

    # Last phase 'post-stop' will be executed after the guest stopped.
    # This should even be executed in case the guest crashes or stopped
    # unexpectedly.

    print "$vmid stopped. Doing cleanup.\n";

} else {
    die "got unknown phase '$phase'\n";
}

exit(0);

求大佬们解惑。

1361 次点击
所在节点    问与答
6 条回复
glouhao
2022-08-06 16:42:31 +08:00
好吧,自己破案了。
czs1977
2022-11-06 13:41:20 +08:00
是怎么解决的呢
glouhao
2022-11-06 14:57:23 +08:00
@czs1977 忘了,不过服务器里有,需要的话可以分享。
jun9100
2023-04-20 14:28:36 +08:00
后来是咋解决呢?最近遇到了同样的问题。
glouhao
2023-04-20 19:16:13 +08:00
@jun9100 能写到一行,这两句很多重合的内容,分开两句肯定不行了。
glouhao
2023-04-20 19:17:06 +08:00
@glouhao 需要的画有时间给你找下配置文件。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/871050

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX