From nobody Sun Dec 4 13:33:33 2022 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NQ71y12sfz4jG5t; Sun, 4 Dec 2022 13:34:14 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NQ71x3M42z43vg; Sun, 4 Dec 2022 13:34:13 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ej1-x630.google.com with SMTP id gu23so21915376ejb.10; Sun, 04 Dec 2022 05:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=i5fYoJiF2Hgy3m0ltKAAffb3X+hx1t/9T8h5wKgQx1g=; b=auvWGFLbqif1PeIzJ8rCbE2YHLlJXY0Tor33qFvpBUTefmjCsp/0j9BavIhPTlOIng 8utHLoLRZPFoMXfXPYhVcw0pL8UDhP57e2rhGh2WchiVbjSrUemEyCYtxDj84gPQgJa4 TL/e3YJ/WKwI4In7pbrZkfmBsrvNTlwkCZr5ZIzn0MP4aBR4W1fxUxwUe0XNhsTCJBsj 5JmF8gZLwrUdUNNElM/cxHcS3zGf/n6Sn5zu/xukXqj1vvDWwBvuYxNCyP3IMqmTaSVn 1tpWMxtMEkE4aZoSQx2FMrDqBYHp7/5XbNMnIViEM24+8x5la9ViqmP4ZnTX2TibLPDU qV5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=i5fYoJiF2Hgy3m0ltKAAffb3X+hx1t/9T8h5wKgQx1g=; b=ewPV+afN/0nxUlxChhBR31eQBfEX+r4laD/OlwZWcMt6Lmu20eb73clKNBlHPqBORx YlQVViGyythTlWnopz0ZFIsc+fzDBo99Q2+CC6wDrX5SHyb/EQ17wOZAFvVcFcjK7Mqi Td8PcYyaHQbMgVq98IkZpMeUhRHbMTqqnWC7jaOpMbI8WXI/IS51GtqkN8HVCb6ECnSb WkPg7BieqDJdSFQQsCgCL6aPhMYouyPmOJFFQ00/3GKvKUsgwrbkPQC133CAPFSjTlGG 93EnizNZO3LpHRjlmN87VdvKK8Qa3q19DPm6ClweETTpUlC4y2nrT0zIiGkXnsxojL6W 8+9g== X-Gm-Message-State: ANoB5pnYEoas+mX7OGGMHkZjovOEj6p4sTCIzbYO3C848b7cua9AB+Lr bLp4ldELMvCD3sou+w7oR73h1Cw3PhriBqHi4il/SpzLpik/uA== X-Google-Smtp-Source: AA0mqf7kJ8pmZURY/o3QAobG8wZqapyaRqgUu/pJhLCRrMmyo2F9k6XCFPAvfKzICdr9JP2rXyVAHiI1XRWyMEEXTjA= X-Received: by 2002:a17:906:c08:b0:7bf:99a6:95aa with SMTP id s8-20020a1709060c0800b007bf99a695aamr27813941ejf.7.1670160850159; Sun, 04 Dec 2022 05:34:10 -0800 (PST) List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 References: <2E8B4BF7-A39E-4B93-820D-FC66F8C2F94B@FreeBSD.org> In-Reply-To: From: Mario Marietto Date: Sun, 4 Dec 2022 14:33:33 +0100 Message-ID: Subject: Re: How to use the framebuffer as primary video device instead of the nvidia passed-through graphic card in a bhyve/linux vm To: =?UTF-8?Q?Corvin_K=C3=B6hne?= Cc: virtualization@freebsd.org, FreeBSD virtualization , hackers@freebsd.org, freebsd-x11@freebsd.org Content-Type: multipart/alternative; boundary="000000000000310e4a05ef00a048" X-Rspamd-Queue-Id: 4NQ71x3M42z43vg X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000310e4a05ef00a048 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello. I know,but it does not work. If I use ONLY the framebuffer argument,it works : the desktop manager is loaded within the vm window,but if between the bhyve parameters I declare the framebuffer AND the nvidia slots,on the vm window I see the blinking pointer because the output is redirected to the screen that I have attached to the nvidia HDMI connector. The problem is that at the moment I can't use that monitor,since I'm using my PC in a different room. I made an experiment : I have excluded all the parameters that may be used in my old Ubuntu installation by installing Ubuntu (22.10) from scratch and between the bhyve parameters I have added both the framebuffer and the 4 nVidia slots. bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -m 4G -w -H -A \ -s 0,hostbridge \ -s 1,ahci-cd,/mnt/$vmdisk1'p2'/bhyve/iso/Linux/ubuntu-22.10-desktop-amd64.iso \ -s 7:0,fbuf,tcp=3D0.0.0.0:5916,w=3D1600,h=3D950,wait \ -s 8:0,passthru,2/0/0 \ -s 8:1,passthru,2/0/1 \ -s 8:2,passthru,2/0/2 \ -s 8:3,passthru,2/0/3 \ -s 10,virtio-net,tap16 \ -s 11,virtio-9p,sharename=3D/ \ -s 30,xhci,tablet \ -s 31,lpc \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \ vm0:16 < /dev/null & sleep 2 && vncviewer 0:16 When I choose "try and install Ubuntu" I see the blinking pointer because the output is redirected to the screen that I can't use. But if I choose "safe graphics" maybe it makes the magic. Below you can see what are the parameters used by Ubuntu to display the installer even if between the bhyve parameters I have used the framebuffer and the nVidia adapters. https://ibb.co/L9JqQbL Instead below you can see what are the parameters used by Ubuntu to display the installer if between the bhyve parameters I use both the framebuffer and the nVidia adapters but without choosing "safe graphics" on the ubuntu boot menu. https://ibb.co/wNJxxkV As you can see,the parameter that makes the difference is called "nomodeset". So,I presume that in a certain ubuntu configuration file I should add that parameter.... Il giorno dom 4 dic 2022 alle ore 10:41 Corvin K=C3=B6hne ha scritto: > On December 3, 2022 7:14:29 PM GMT+01:00, Mario Marietto < > marietto2008@gmail.com> wrote: >> >> ok. I tried like this,but it didn't work : >> >> bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -m 4G -w -H -A \ >> -s 0,hostbridge \ >> -s 2,virtio-blk,/mnt/$vmdisk1'p2'/bhyve/img/Linux/ubuntu2210.img,bootind= ex=3D1 \ >> -s 3,virtio-blk,/dev/$vmdisk4 \ >> -s 4,virtio-blk,/dev/$vmdisk2 \-s 7,fbuf,tcp=3D0.0.0.0:5919,w=3D1600,h= =3D950,wait \ >> -s 8:0,passthru,2/0/0 \ >> -s 8:1,passthru,2/0/1 \ >> -s 8:2,passthru,2/0/2 \ >> -s 8:3,passthru,2/0/3 \ >> -s 10,virtio-net,tap19 \ >> -s 11,virtio-9p,sharename=3D/ \ >> -s 30,xhci,tablet \ >> -s 31,lpc \ >> -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \ >> vm0:19 < /dev/null & sleep 2 && vncviewer 0:19 >> >> I tried specifying the bus ID of the framebuffer and I have used this >> xorg.conf file : >> >> Section "Files" >> ModulePath "/usr/lib/xorg/modules" >> FontPath "/usr/share/fonts/X11/misc" >> FontPath "/usr/share/fonts/X11/cyrillic" >> FontPath "/usr/share/fonts/X11/100dpi/:unscaled" >> FontPath "/usr/share/fonts/X11/75dpi/:unscaled" >> FontPath "/usr/share/fonts/X11/Type1" >> FontPath "/usr/share/fonts/X11/100dpi" >> FontPath "/usr/share/fonts/X11/75dpi" >> FontPath "built-ins" >> EndSection >> >> Section "Module" >> Load "vnc" >> Load "glx" >> EndSection >> >> >> Section "InputDevice" >> Identifier "Keyboard0" >> Driver "kbd" >> EndSection >> >> Section "InputDevice" >> Identifier "Mouse0" >> Driver "mouse" >> Option "Protocol" "auto" >> Option "Device" "/dev/input/mice" >> Option "ZAxisMapping" "4 5 6 7" >> >> EndSection >> >> Section "Monitor" >> Identifier "Monitor0" >> VendorName "Monitor Vendor" >> ModelName "Monitor Model" >> EndSection >> >> Section "Device" >> Identifier "Card0" >> Driver "modesetting" >> BusID "PCI:0:7:0" >> >> EndSection >> >> Section "Screen" >> Identifier "Screen0" >> Device "Card0" >> Monitor "Monitor0" >> SubSection "Display" >> Viewport 0 0 >> Depth 1 >> EndSubSection >> SubSection "Display" >> Viewport 0 0 >> Depth 4 >> EndSubSection >> SubSection "Display" >> Viewport 0 0 >> Depth 8 >> EndSubSection >> SubSection "Display" >> Viewport 0 0 >> Depth 15 >> EndSubSection >> SubSection "Display" >> Viewport 0 0 >> Depth 16 >> EndSubSection >> SubSection "Display" >> Viewport 0 0 >> Depth 24 >> EndSubSection >> EndSection >> >> The error reported has been : >> >> https://ibb.co/1KX2h26 >> https://ibb.co/Cv5FffB >> >> thanks. >> >> Il giorno sab 3 dic 2022 alle ore 17:34 Corvin K=C3=B6hne >> ha scritto: >> >>> On December 3, 2022 4:49:46 PM GMT+01:00, Mario Marietto < >>> marietto2008@gmail.com> wrote: >>>> >>>> Hello to everyone. >>>> >>>> what Im trying to do is to set the framebuffer video adapter as primar= y >>>> graphic card on my bhyve-ubuntu vm instead of the nvidia RTX 2080 ti c= ard >>>> that I have passed through. What I want to do really is to use both th= e >>>> graphic adapters,but the primary should be the framebuffer and the >>>> secondary the nvidia. I tried different Xorg configurations,but what I= 've >>>> got is that Xorg failed to display some errors. So,the controller that= you >>>> see below should be used as primary inside the ubuntu vm : >>>> >>>> 00:1d.0 VGA compatible controller: Device fb5d:40fb >>>> >>>> while the ones you see below as secondary : >>>> >>>> 08:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce R= TX 2080 Ti] (rev a1) >>>> 08:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio C= ontroller (rev a1) >>>> 08:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Host Controll= er (rev a1) >>>> 08:00.3 Serial bus controller: NVIDIA Corporation TU102 USB Type-C UCS= I Controller (rev a1) >>>> >>>> >>>> The script that I use to launch the vm is the following : >>>> >>>> #!/bin/sh >>>> setxkbmap it >>>> vms=3D"$(ls /dev/vmm/*)" >>>> vncs=3D"$(ps ax | awk '/vncviewer [0]/{print $6}')" >>>> >>>> for vm in $vms; do >>>> session=3D"${vm##*/}" >>>> echo "bhyve session =3D $session" >>>> echo "vnc session =3D $vncs" >>>> if ! printf '%s\n' "${vncs}" | grep "${session}"; then >>>> printf 'VNC session not found,destroyi= ng ghost vms\n' >>>> bhyvectl --vm=3D$session --destroy >>>> else >>>> printf 'Found VNC session %s\n' "${ses= sion},no ghost vms found,not destroying them" >>>> fi >>>> done >>>> >>>> vmdisk1=3D`geom disk list | awk '/^Geom name: /{d=3D$NF} /^ *ident: (2= 015020204055E)/ && d{print d}'` >>>> echo "TOSHIBA External USB 3.0 1.8 TB ; $vmdisk1" >>>> >>>> mount -t ufs /dev/$vmdisk1'p2' /mnt/$vmdisk1'p2' >>>> >>>> bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -m 4G -w -H -A \ >>>> -s 0,hostbridge \ >>>> -s 2,virtio-blk,/mnt/$vmdisk1'p2'/bhyve/img/Linux/ubuntu2210.img,booti= ndex=3D1 \ >>>> -s 3,virtio-blk,/dev/$vmdisk4 \ >>>> -s 4,virtio-blk,/dev/$vmdisk2 \ >>>> -s 8:0,passthru,2/0/0 \ >>>> -s 8:1,passthru,2/0/1 \ >>>> -s 8:2,passthru,2/0/2 \ >>>> -s 8:3,passthru,2/0/3 \ >>>> -s 10,virtio-net,tap19 \ >>>> -s 11,virtio-9p,sharename=3D/ \ >>>> -s 29,fbuf,tcp=3D0.0.0.0:5919,w=3D1600,h=3D950,wait \ >>>> -s 30,xhci,tablet \ >>>> -s 31,lpc \ >>>> -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \ >>>> vm0:19 < /dev/null & sleep 2 && vncviewer 0:19 >>>> >>>> For sure ,on /boot/loader.conf I've added : >>>> >>>> /boot/loader.conf >>>> >>>> pptdevs=3D"2/0/0 2/0/1 2/0/2 2/0/3" >>>> >>>> As I said before,I tried two xorg conf files to achieve the goal. On t= he >>>> first one I tried to add only the framebuffer,like this : >>>> >>>> >>>> Section "Files" >>>> ModulePath "/usr/lib/xorg/modules" >>>> FontPath "/usr/share/fonts/X11/misc" >>>> FontPath "/usr/share/fonts/X11/cyrillic" >>>> FontPath "/usr/share/fonts/X11/100dpi/:unscaled" >>>> FontPath "/usr/share/fonts/X11/75dpi/:unscaled" >>>> FontPath "/usr/share/fonts/X11/Type1" >>>> FontPath "/usr/share/fonts/X11/100dpi" >>>> FontPath "/usr/share/fonts/X11/75dpi" >>>> FontPath "built-ins" >>>> EndSection >>>> >>>> Section "Module" >>>> Load "vnc" >>>> Load "glx" >>>> EndSection >>>> >>>> >>>> Section "InputDevice" >>>> Identifier "Keyboard0" >>>> Driver "kbd" >>>> EndSection >>>> >>>> Section "InputDevice" >>>> Identifier "Mouse0" >>>> Driver "mouse" >>>> Option "Protocol" "auto" >>>> Option "Device" "/dev/input/mice" >>>> Option "ZAxisMapping" "4 5 6 7" >>>> >>>> EndSection >>>> >>>> Section "Monitor" >>>> Identifier "Monitor0" >>>> VendorName "Monitor Vendor" >>>> ModelName "Monitor Model" >>>> EndSection >>>> >>>> Section "Device" >>>> Identifier "Card0" >>>> Driver "modesetting" >>>> BusID "PCI:0:29:0" >>>> >>>> EndSection >>>> >>>> Section "Screen" >>>> Identifier "Screen0" >>>> Device "Card0" >>>> Monitor "Monitor0" >>>> SubSection "Display" >>>> Viewport 0 0 >>>> Depth 1 >>>> EndSubSection >>>> SubSection "Display" >>>> Viewport 0 0 >>>> Depth 4 >>>> EndSubSection >>>> SubSection "Display" >>>> Viewport 0 0 >>>> Depth 8 >>>> EndSubSection >>>> SubSection "Display" >>>> Viewport 0 0 >>>> Depth 15 >>>> EndSubSection >>>> SubSection "Display" >>>> Viewport 0 0 >>>> Depth 16 >>>> EndSubSection >>>> SubSection "Display" >>>> Viewport 0 0 >>>> Depth 24 >>>> EndSubSection >>>> EndSection >>>> >>>> >>>> but it didn't work. This is the log file that shows the errors reporte= d : https://pastebin.ubuntu.com/p/Gv7wgsDR4K/ >>>> I have also removed the xorg.conf file,but it didn't work either. This= is the log file that shows the errors reported : >>>> >>>> >>>> https://pastebin.ubuntu.com/p/wNcfQTByQm/ >>>> >>>> Can someone give me some suggestions that can help me to understand wh= ere the mistake is,please,thanks. >>>> >>>> -- >>>> Mario. >>>> >>> >>> Try to assign a lower pci slot number to the framebuffer device than to >>> the nvidia gpu in your bhyve command. >>> -- >>> Best regards, >>> Corvin >>> >> >> > I'm unfamiliar with X but according to your logs it looks like it selects > the framebuffer device as primary graphics in the first place: > > > (--) PCI:*(0@0:7:0) ... > (--) PCI: (0@0:8:0) ... > > -- > Best regards, > Corvin > --=20 Mario. --000000000000310e4a05ef00a048 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello.

I know,but it does no= t work. If I use ONLY the framebuffer argument,it works : the desktop manag= er is loaded within the vm window,but if between the bhyve parameters I dec= lare the framebuffer AND the nvidia slots,on the vm window I see the blinki= ng pointer because the output is redirected to the screen that I have attac= hed to the nvidia HDMI connector. The problem is that at the moment I can&#= 39;t use that monitor,since I'm using my PC in a different room.
I made an experiment : I have excluded all the parameters that may= be used in my old Ubuntu installation by installing Ubuntu (22.10) from sc= ratch and between the bhyve parameters I have added both the framebuffer an= d the 4 nVidia slots.

bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -m 4G -w -H -A \
-s 0,hostbridge \
-s 1,ahci-cd,/mnt/$vmdisk1'p2'/bhyve/iso/Linux/ubuntu-22.10-des= ktop-amd64.iso \
-s 7:0,fbuf,tcp=3D0.0= .0.0:5916,w=3D1600,h=3D950,wait \
-s 8:0,passthru,2/0/0 \
-s 8:1,passthru,2/0/1 \
-s 8:2,passthru,2/0/2 \
-s 8:3,passthru,2/0/3 \
-s 10,virtio-net,tap16 \
-s 11,virtio-9p,sharename=3D/ \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:16 < /dev/null & sleep 2 && vncviewer 0:16

W= hen I choose "try and install Ubuntu" I see the blinking pointer = because the output is redirected to the screen that I can't use. But if= I choose "safe graphics" maybe it makes the magic. Below you can= see what are the parameters used by Ubuntu to display the installer even i= f between the bhyve parameters I have used the framebuffer and the nVidia a= dapters.


Instead below you can se= e what are the parameters used by Ubuntu to display the=20 installer if between the bhyve parameters I use both the=20 framebuffer and the nVidia adapters but without choosing "safe graphic= s" on the ubuntu boot menu.


As yo= u can see,the parameter that makes the difference is called "nomodeset= ". So,I presume that in a certain ubuntu configuration file I should a= dd that parameter....


Il giorno dom 4 dic 2022 alle ore 10:41 Corvin K=C3=B6hne <corvink@freebsd.org<= /a>> ha scritto:
On December 3, 2022 7:14:29 PM GMT+01:0= 0, Mario Marietto <marietto2008@gmail.com> wrote:
ok. I tried like this,but it didn't work :
<= div>
bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -m=
 4G -w -H -A \
-s 0,hostbridge \
-s 2,virtio-blk,/mnt/$vmdisk1'p2'/bhyve/img/Linux/ubuntu2210.img,bo=
otindex=3D1 \
-s 3,virtio-blk,/dev/$vmdisk4 \
-s 4,virtio-blk,/dev/$vmdisk2 \
-s 7,fbuf,tcp=3D0.0=
.0.0:5919,w=3D1600,h=3D950,wait \
-s 8:0,passthru,2/0/0 \ -s 8:1,passthru,2/0/1 \ -s 8:2,passthru,2/0/2 \ -s 8:3,passthru,2/0/3 \ -s 10,virtio-net,tap19 \ -s 11,virtio-9p,sharename=3D/ \ -s 30,xhci,tablet \ -s 31,lpc \ -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \ vm0:19 < /dev/null & sleep 2 && vncviewer 0:19

I tried specifying the bus ID of the framebuffer and I ha= ve used this xorg.conf file :

Section "Files"
    ModulePath   "/usr/lib/xorg/modules"
    FontPath     "/usr/share/fonts/X11/misc"
    FontPath     "/usr/share/fonts/X11/cyrillic"
    FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
    FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
    FontPath     "/usr/share/fonts/X11/Type1"
    FontPath     "/usr/share/fonts/X11/100dpi"
    FontPath     "/usr/share/fonts/X11/75dpi"
    FontPath     "built-ins"
EndSection

Section "Module"
    Load  "vnc"
    Load  "glx"
EndSection


Section "InputDevice"
    Identifier  "Keyboard0"
    Driver      "kbd"
EndSection

Section "InputDevice"
    Identifier  "Mouse0"
    Driver      "mouse"
    Option        "Protocol" "auto"
    Option        "Device" "/dev/input/mice"
    Option        "ZAxisMapping" "4 5 6 7"

EndSection

Section "Monitor"
    Identifier   "Monitor0"
    VendorName   "Monitor Vendor"
    ModelName    "Monitor Model"
EndSection

Section "Device"
   Identifier  "Card0"
   Driver      "modesetting"
   BusID       "PCI:0:7:0"

EndSection

Section "Screen"
    Identifier "Screen0"
    Device     "Card0"
    Monitor    "Monitor0"
    SubSection "Display"
        Viewport   0 0
        Depth     1
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     4
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     8
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     15
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     16
    EndSubSection
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection
The error reported has been :

Il giorno sa= b 3 dic 2022 alle ore 17:34 Corvin K=C3=B6hne <corvink@freebsd.org> ha scritto:
=
On December 3, 2022 4:49:46 PM GMT+01:00, Mario Marietto <<= a href=3D"mailto:marietto2008@gmail.com" target=3D"_blank">marietto2008@gma= il.com> wrote:
Hello to everyone.

what Im trying to do is to set the framebuffer video adapter as primary=20 graphic card on my bhyve-ubuntu vm instead of the nvidia RTX 2080 ti=20 card that I have passed through. What I want to do really is to use both the graphic adapters,but the primary should be the framebuffer and the=20 secondary the nvidia. I tried different Xorg configurations,but what I'= ve got is that Xorg failed to display some errors. So,the controller that you see below should be used as primary inside the ubuntu vm :

00:1d.0 VGA compatible controller: Device fb5d:40f=
b

while the ones you see below as secondary :

08:00.0 VGA compatible controller: NVIDI=
A Corporation TU102 [GeForce RTX 2080 Ti] (rev a1)
08:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Contro=
ller (rev a1)
08:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Host Controller (r=
ev a1)
08:00.3 Serial bus controller: NVIDIA Corporation TU102 USB Type-C UCSI Con=
troller (rev a1)

The script that I use to launch the vm is the following :

#!/bin/sh
setxkbmap it
vms=3D"$(ls /dev/vmm/*)"
vncs=3D"$(ps ax | awk '/vncviewer [0]/{print $6}')"

for vm in $vms; do
                session=3D"${vm##*/}"
                echo "bhyve session =3D $session"
                echo "vnc session =3D $vncs"
                if ! printf '%s\n' "${vncs}" | grep "=
;${session}"; then
                                printf 'VNC session not found,destroyin=
g ghost vms\n'
                                bhyvectl --vm=3D$session --destroy         =
                 =20
                else
                                printf 'Found VNC session %s\n' &qu=
ot;${session},no ghost vms found,not destroying them"
                fi
done

vmdisk1=3D`geom disk list | awk '/^Geom name: /{d=3D$NF} /^ *ident: (20=
15020204055E)/ && d{print d}'`
echo "TOSHIBA External USB 3.0 1.8 TB ; $vmdisk1"

mount -t ufs /dev/$vmdisk1'p2' /mnt/$vmdisk1'p2'

bhyve -S -c sockets=3D1,cores=3D2,threads=3D2 -m 4G -w -H -A \
-s 0,hostbridge \
-s 2,virtio-blk,/mnt/$vmdisk1'p2'/bhyve/img/Linux/ubuntu2210.img,bo=
otindex=3D1 \
-s 3,virtio-blk,/dev/$vmdisk4 \
-s 4,virtio-blk,/dev/$vmdisk2 \
-s 8:0,passthru,2/0/0 \
-s 8:1,passthru,2/0/1 \
-s 8:2,passthru,2/0/2 \
-s 8:3,passthru,2/0/3 \
-s 10,virtio-net,tap19 \
-s 11,virtio-9p,sharename=3D/ \
-s 29,fbuf,tcp=3D0.0.0.0:=
5919,w=3D1600,h=3D950,wait \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:19 < /dev/null & sleep 2 && vncviewer 0:19

For sure ,on /boot/loade= r.conf I've added :

/boot/loader.conf

pptdevs=3D"2/0/0 2/0/1 2/0/2 2/0/3"

As I said before,I tried= two xorg conf files to achieve the goal. On the first one I tried to add only the framebuffer,like this :

Section "Files" ModulePath "/usr/lib/xorg/modules" FontPath "/usr/share/fonts/X11/misc" FontPath "/usr/share/fonts/X11/cyrillic" FontPath "/usr/share/fonts/X11/100dpi/:unscaled" FontPath "/usr/share/fonts/X11/75dpi/:unscaled" FontPath "/usr/share/fonts/X11/Type1" FontPath "/usr/share/fonts/X11/100dpi" FontPath "/usr/share/fonts/X11/75dpi" FontPath "built-ins" EndSection Section "Module" Load "vnc" Load "glx" EndSection Section "InputDevice" Identifier "Keyboard0" Driver "kbd" EndSection Section "InputDevice" Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/input/mice" Option "ZAxisMapping" "4 5 6 7" EndSection Section "Monitor" Identifier "Monitor0" VendorName "Monitor Vendor" ModelName "Monitor Model" EndSection Section "Device" Identifier "Card0" Driver "modesetting" BusID "PCI:0:29:0" EndSection Section "Screen" Identifier "Screen0" Device "Card0" Monitor "Monitor0" SubSection "Display" Viewport 0 0 Depth 1 EndSubSection SubSection "Display" Viewport 0 0 Depth 4 EndSubSection SubSection "Display" Viewport 0 0 Depth 8 EndSubSection SubSection "Display" Viewport 0 0 Depth 15 EndSubSection SubSection "Display" Viewport 0 0 Depth 16 EndSubSection SubSection "Display" Viewport 0 0 Depth 24 EndSubSection EndSection


bu= t it didn't work. This is the log file that shows the errors reported := https://pastebin.ubuntu.com/p/Gv7wgsDR4K/
I have also rem= oved the xorg.conf file,but it didn't work either. This is the log file= that shows the errors reported :


https://pastebin.ubuntu.co= m/p/wNcfQTByQm/

Can someone give me some= suggestions that can help me to understand where the mistake is,please,tha= nks.
--
Mario.

Try to assign a lower pci slot number = to the framebuffer device than to the nvidia gpu in your bhyve command.
=
--
Best regards,
Corvin


I'm unfamiliar with X but according to your logs it looks = like it selects the framebuffer device as primary graphics in the first pla= ce:


(--) PCI:*(0@0:7:0) ...
(--) PCI: (0@0:8:0) ...

--
Best regards,
Corvin
=


--
Mario.
--000000000000310e4a05ef00a048--