Date: Thu, 14 Aug 2025 15:24:16 +0000 From: bugzilla-noreply@freebsd.org To: virtualization@FreeBSD.org Subject: [Bug 288848] bhyve GPU passthru for NVIDIA not working Message-ID: <bug-288848-27103-AynuoLuIby@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-288848-27103@https.bugs.freebsd.org/bugzilla/> References: <bug-288848-27103@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288848 --- Comment #4 from Vincent <vincent@landgrafx.de> --- I applied the patches against 14.3 and can confirm it works! I only had to do a minor change to the Makefile. Thanks again Corvin! --- 8< --- diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile index f4dae2f09904..1ec4623375a1 100644 --- a/usr.sbin/bhyve/Makefile +++ b/usr.sbin/bhyve/Makefile @@ -41,6 +41,7 @@ SRCS= \ pci_hostbridge.c \ pci_nvme.c \ pci_passthru.c \ + pci_passthru_quirks.c \ pci_virtio_9p.c \ pci_virtio_block.c \ pci_virtio_console.c \ diff --git a/usr.sbin/bhyve/pci_passthru_quirks.c b/usr.sbin/bhyve/pci_passthru_quirks.c new file mode 100644 index 000000000000..805e469303ba --- /dev/null +++ b/usr.sbin/bhyve/pci_passthru_quirks.c @@ -0,0 +1,49 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Beckhoff Automation GmbH & Co. KG + * Author: Corvin Köhne <c.koehne@beckhoff.com> + */ + +#include <dev/pci/pcireg.h> + +#include <errno.h> + +#include "pci_passthru.h" + +#define PCI_VENDOR_NVIDIA 0x10DE + +static int +nvidia_gpu_probe(struct pci_devinst *const pi) +{ + struct passthru_softc *sc; + uint16_t vendor; + uint8_t class; + + sc = pi->pi_arg; + + vendor = pci_host_read_config(passthru_get_sel(sc), PCIR_VENDOR, 0x02); + if (vendor != PCI_VENDOR_NVIDIA) + return (ENXIO); + + class = pci_host_read_config(passthru_get_sel(sc), PCIR_CLASS, 0x01); + if (class != PCIC_DISPLAY) + return (ENXIO); + + return (0); +} -- You are receiving this mail because: You are the assignee for the bug.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-288848-27103-AynuoLuIby>
