From nobody Mon Jun 20 16:41:17 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 B9B19874F86 for ; Mon, 20 Jun 2022 16:41:33 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from webmail5.jnielsen.net (webmail5.jnielsen.net [IPv6:2607:f170:34:11::b0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.freebsdsolutions.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LRb585bpdz4vNZ for ; Mon, 20 Jun 2022 16:41:32 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from smtpclient.apple ([IPv6:2001:470:4aee:2:6106:b206:b20e:b159]) (authenticated bits=0) by webmail5.jnielsen.net (8.17.1/8.17.1) with ESMTPSA id 25KGfMqX037353 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Mon, 20 Jun 2022 10:41:25 -0600 (MDT) (envelope-from lists@jnielsen.net) X-Authentication-Warning: webmail5.jnielsen.net: Host [IPv6:2001:470:4aee:2:6106:b206:b20e:b159] claimed to be smtpclient.apple Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: John Nielsen 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 (1.0) Subject: Re: bhyve GPU passthrough + romfile Date: Mon, 20 Jun 2022 10:41:17 -0600 Message-Id: <6EA38DA2-37FC-40E7-99D5-FFA600B65276@jnielsen.net> References: Cc: freebsd-virtualization@freebsd.org In-Reply-To: To: =?utf-8?Q?Corvin_K=C3=B6hne?= X-Mailer: iPhone Mail (19F77) X-Rspamd-Queue-Id: 4LRb585bpdz4vNZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lists@jnielsen.net designates 2607:f170:34:11::b0 as permitted sender) smtp.mailfrom=lists@jnielsen.net X-Spamd-Result: default: False [-2.80 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[jnielsen.net]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-virtualization]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6364, ipnet:2607:f170:30::/44, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N > On Jun 20, 2022, at 12:08 AM, Corvin K=C3=B6hne wr= ote: >=20 > first of all, the ROM is only required for Linux/BSD amdgpu driver. Window= s works without a ROM file. Additionally, the ROM is required for pre-OS gra= phics (e.g. EFI boot, bootloader, etc.). >=20 > Currently, OVMF doesn't processes the ROM file. Processing the ROM would i= nclude: > - executing the ROM > - shadowing the ROM >=20 > The amdgpu driver searches for the shadowed ROM. So, for Linux/BSD guest, a= patched OVMF is required. If you like to try a patched OVMF, please apply f= ollowing commits to BhyveX64.dsc: > https://github.com/Beckhoff/edk2/commit/bed77d4bb374fa6450fa2781eeddfbc360= 4edf6a > https://github.com/Beckhoff/edk2/commit/aeaa9c4c1d1222723cbf9c1c7dd7f5ff39= 11deac > https://github.com/Beckhoff/edk2/commit/a7b01394682874508d65c6f4b5815cdbb6= c6eb6c Thank you for the detailed response. I will try these for my own curiosity. I= s there a reason these patches aren=E2=80=99t in the upstream project or oth= erwise available as a FreeBSD port/package? > As said, Windows requires no ROM. So, that's not the issue. For many years= AMD GPUs have issues to reset themselves. It's a well known hardware bug. Y= ou didn't mention which AMD GPU your using so I can't check if your GPU is a= ffected too. A possible workaround is descripted at: > https://curtisshoward.com/post/fixing-amd-gpu-passthrough-reset-issues-in-= windows/ I have a Radeon RX 580 FWIW. Disabling the card in Windows for every boot i= s a pretty ugly hack but I might play around with it. Too bad Windows Update= is so heavy handed in the consumer editions of Windows. > Btw: On Linux there's some work to solve the GPU reset bug by hardware spe= cific reset routines (https://github.com/gnif/vendor-reset) but I don't thin= k that such kind of work will be merged soon into FreeBSD. >=20 >> PS: Is there a known/supported way to get a GPU ROM file from FreeBSD? Th= e one I have I obtained from a Linux host where this GPU was secondary. >=20 > No, there's no known/supported way yet. The best way is to boot another OS= .