Date: Sat, 3 Dec 2022 19:14:29 +0100 From: Mario Marietto <marietto2008@gmail.com> To: =?UTF-8?Q?Corvin_K=C3=B6hne?= <corvink@freebsd.org> Cc: virtualization@freebsd.org, freebsd-x11+help@freebsd.org, FreeBSD virtualization <freebsd-virtualization@freebsd.org>, hackers@freebsd.org Subject: Re: How to use the framebuffer as primary video device instead of the nvidia passed-through graphic card in a bhyve/linux vm Message-ID: <CA%2B1FSig_TNz6iVaVAEAJtUuXu6QuCGM_-oatDEje4yUsE4yRkw@mail.gmail.com> In-Reply-To: <2E8B4BF7-A39E-4B93-820D-FC66F8C2F94B@FreeBSD.org> References: <CA%2B1FSigGi%2BY-pqS9ARwY%2BdpRS2HBc-wxc0cd5ixKTAw%2Ba6uNZw@mail.gmail.com> <2E8B4BF7-A39E-4B93-820D-FC66F8C2F94B@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000000cf23f05eef06ff9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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,bootindex= =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=3D95= 0,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 <corvink@freebsd.= org> 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 primary >> graphic card on my bhyve-ubuntu vm instead of the nvidia RTX 2080 ti car= d >> 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 >> secondary the nvidia. I tried different Xorg configurations,but what I'v= e >> got is that Xorg failed to display some errors. So,the controller that y= ou >> 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 RTX= 2080 Ti] (rev a1) >> 08:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Con= troller (rev a1) >> 08:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Host Controller= (rev a1) >> 08:00.3 Serial bus controller: NVIDIA Corporation TU102 USB Type-C UCSI = 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,destroying= ghost vms\n' >> bhyvectl --vm=3D$session --destroy >> else >> printf 'Found VNC session %s\n' "${sessi= on},no ghost vms found,not destroying them" >> fi >> done >> >> vmdisk1=3D`geom disk list | awk '/^Geom name: /{d=3D$NF} /^ *ident: (201= 5020204055E)/ && 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,bootind= ex=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 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 >> >> >> but it didn't work. This is the log file that shows the errors reported = : https://pastebin.ubuntu.com/p/Gv7wgsDR4K/ >> I have also removed the xorg.conf file,but it didn't work either. This i= s 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 wher= e 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 > --=20 Mario. --0000000000000cf23f05eef06ff9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>ok. I tried like this,but it didn't work :</div><= div><pre dir=3D"ltr"><code>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 \ <code>-s 7,fbuf,tcp=3D<a href=3D"http://0.0.0.0:5919" target=3D"_blank">0.0= .0.0:5919</a>,w=3D1600,h=3D950,wait \<br></code>-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<br><br></code= ></pre></div><div>I tried specifying the bus ID of the framebuffer and I ha= ve used this xorg.conf file :</div><div><br></div><div><pre dir=3D"ltr"><co= de>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<br></code></pre>The error reported has been :</div><div><br></di= v><div><a href=3D"https://ibb.co/1KX2h26">https://ibb.co/1KX2h26</a><br><a = href=3D"https://ibb.co/Cv5FffB">https://ibb.co/Cv5FffB</a></div><div><br></= div><div>thanks. <br></div></div><br><div class=3D"gmail_quote"><div dir=3D= "ltr" class=3D"gmail_attr">Il giorno sab 3 dic 2022 alle ore 17:34 Corvin K= =C3=B6hne <<a href=3D"mailto:corvink@freebsd.org">corvink@freebsd.org</a= >> ha scritto:<br></div><blockquote class=3D"gmail_quote" style=3D"margi= n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex= "><div><div class=3D"gmail_quote">On December 3, 2022 4:49:46 PM GMT+01:00,= Mario Marietto <<a href=3D"mailto:marietto2008@gmail.com" target=3D"_bl= ank">marietto2008@gmail.com</a>> wrote:<blockquote class=3D"gmail_quote"= style=3D"margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);p= adding-left:1ex"> <div dir=3D"ltr">Hello to everyone.<br> <br> 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 :<br><di= v><br></div><div><div dir=3D"ltr"> <pre dir=3D"ltr"><code>00:1d.0 VGA compatible controller: Device fb5d:40f= b<br><br></code></pre> </div><div dir=3D"ltr"> while the ones you see below as secondary :</div><div dir=3D"ltr"><br></div= ></div><div><pre dir=3D"ltr"><code>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)</code></pre></div><div><br></div><div> The script that I use to launch the vm is the following :</div><div><br></d= iv><div><pre dir=3D"ltr"><code>#!/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=3D<a href=3D"http://0.0.0.0:5919" target=3D"_blank">0.0.0.0:= 5919</a>,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<br><br> <span style=3D"font-family:arial black,sans-serif">For sure ,on /boot/loade= r.conf I've added :<br><br></span></code></pre></div><div><pre dir=3D"l= tr"><code>/boot/loader.conf pptdevs=3D"2/0/0 2/0/1 2/0/2 2/0/3"<br><br> <span style=3D"font-family:arial black,sans-serif">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 :</span></code></pr= e></div><div><pre dir=3D"ltr"><code><br>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<br><br><br><span style=3D"font-family:arial black,sans-serif">bu= t it didn't work. This is the log file that shows the errors reported := <a href=3D"https://pastebin.ubuntu.com/p/Gv7wgsDR4K/" rel=3D"nofollow ugc = noopener" target=3D"_blank">https://pastebin.ubuntu.com/p/Gv7wgsDR4K/</a></= span><br><span style=3D"font-family:arial black,sans-serif">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 :</span><br><br><br><a href=3D"https://past= ebin.ubuntu.com/p/wNcfQTByQm/" target=3D"_blank">https://pastebin.ubuntu.co= m/p/wNcfQTByQm/</a><br><br> <span style=3D"font-family:arial black,sans-serif">Can someone give me some= suggestions that can help me to understand where the mistake is,please,tha= nks.</span> </code></pre></div><div>-- </div><div dir=3D"ltr">Mario.<br></div></div> </blockquote></div><br clear=3D"all">Try to assign a lower pci slot number = to the framebuffer device than to the nvidia gpu in your bhyve command.<br>= <div style=3D"white-space:pre-wrap"><div>-- <br>Best regards,<br>Corvin</di= v></div></div></blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"l= tr" class=3D"gmail_signature">Mario.<br></div> --0000000000000cf23f05eef06ff9--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B1FSig_TNz6iVaVAEAJtUuXu6QuCGM_-oatDEje4yUsE4yRkw>