From nobody Thu Aug 14 15:24:16 2025 X-Original-To: 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 4c2ptn1thqz64cgQ for ; Thu, 14 Aug 2025 15:24:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c2ptn1911z3D1m for ; Thu, 14 Aug 2025 15:24:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755185057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GtwEDnvBwxV6GOcAqL1BcDzpDlNsqRDvbn0jzpf2z5g=; b=QDxN9xeltSx7CzAnapH6rz0paTSCtPh4QfOAlyKDlalg1byfNK57MHBnLiIDogHogS8pyp 8YICOsLWoEjHBJ/z4rnX9SPIN0DJcZogb+wAcUI1gGfY2CXw0HYCP+ii5LZ2lqa7MUKiBH E7hRnUgjL4EkDT9ZzUz7GiOlEmv++/o+7JQQWDa5zEEhod0ld6LP27gZFH6fxxpZJrz9g8 E9r7SHbg2BSZl7Tq6iLwxLR082gnjkZ0QRu5Jf1yIzDbK5Xf9H+2HGljuzyxGunY6P/vu/ hH/jCrD1ajoX8lLl1jQOzjHOoP2aO9/L6LtrjcLa7B+plrSs6K+zSsINiegybQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755185057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GtwEDnvBwxV6GOcAqL1BcDzpDlNsqRDvbn0jzpf2z5g=; b=fOvVqERWJ49Fa1R5WBpTnKK3h/Bxln7Dt58SWOIYcfqOTWk4/FnAo4UwV7HIY31472heNO HaS3eafAcyKQ5jeHUROBg3GgON1vrRyGzLh00Au9Rj5zzIuZyhlug4y3c2QJPRf5etBdOS 5CYr/pvIrEIYd2Cv6OTLbdtJCISOvGRevT+cmUJkjrdJD+0MUpxMB6Qp8dAz8W0mMaJVDe 2HcOQ42rYpNcj6N+rjyHTGp2LskqLxnfh6VIa/kJv9XbSfWAVMxu5VxpHV96/bkla37onx /ayCB41VOZQhWMiDaMvU4oWGFZuAQANOF4T1WwmlBPSBEkvn0KFLmzB0H1biOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1755185057; a=rsa-sha256; cv=none; b=DAq1iToSPqrxdtMdcRvMgXV4j0tkyF1O1HoUU8byeu1EayWmGkmD6uKbw8YcPYZ8BbJEHc y2heA3sFLp/a0FomAwIZ7K5P0Jte5Pq7tK7fOfA9fZ1Kcotm+7X/tmZ/xfx/GhmU17uYcA ij9mY0NSk568D6Ix166+UtpIKyEfhMUjd2B1KK1rlExWcijmjJQWhXDYrZ4yZ0og83dQ0h q+4ElH2ZdXej5gBBDglSVFIgsAFNOlve/hSkNnz9wvQKru+7jeTR4YCUBm2tMt8zImcBw9 POpEB2hqVPrkdvMFYntiqZnDFXCrC+g4ZvFcTM9agerF9oDTEUH4ym8l54H1Qg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4c2ptn0kBszydx for ; Thu, 14 Aug 2025 15:24:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 57EFOGVa070847 for ; Thu, 14 Aug 2025 15:24:16 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 57EFOGL8070846 for virtualization@FreeBSD.org; Thu, 14 Aug 2025 15:24:16 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: virtualization@FreeBSD.org Subject: [Bug 288848] bhyve GPU passthru for NVIDIA not working Date: Thu, 14 Aug 2025 15:24:16 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bhyve X-Bugzilla-Version: 14.3-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: vincent@landgrafx.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: virtualization@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D288848 --- Comment #4 from Vincent --- 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=3D \ 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=C3=B6hne + */ + +#include + +#include + +#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 =3D pi->pi_arg; + + vendor =3D pci_host_read_config(passthru_get_sel(sc), PCIR_VENDOR, = 0x02); + if (vendor !=3D PCI_VENDOR_NVIDIA) + return (ENXIO); + + class =3D pci_host_read_config(passthru_get_sel(sc), PCIR_CLASS, 0x= 01); + if (class !=3D PCIC_DISPLAY) + return (ENXIO); + + return (0); +} --=20 You are receiving this mail because: You are the assignee for the bug.=