From nobody Fri Sep 26 05:39:45 2025 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 4cXztk6dxQz69FFH for ; Fri, 26 Sep 2025 05:39:58 +0000 (UTC) (envelope-from jon@xyinn.org) Received: from mail-10626.protonmail.ch (mail-10626.protonmail.ch [79.135.106.26]) (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 "protonmail.com", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cXztg6yY9z3qK9 for ; Fri, 26 Sep 2025 05:39:55 +0000 (UTC) (envelope-from jon@xyinn.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=xyinn.org header.s=protonmail3 header.b=onYYkRWO; dmarc=pass (policy=none) header.from=xyinn.org; spf=pass (mx1.freebsd.org: domain of jon@xyinn.org designates 79.135.106.26 as permitted sender) smtp.mailfrom=jon@xyinn.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xyinn.org; s=protonmail3; t=1758865192; x=1759124392; bh=pEwQI5pp2btL8QPNYF3ctTJscpRXfy5i7wDmx+TTajk=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=onYYkRWOKR26AoYIaKLef5/D3oS/6z1z9aqjx8GgL04srBgqEuVsOhoaS6/3vhCqm bi0C2oO1VTklP1NwIV4BBi1UQLSXxY9QDCQTZDmh66yFxea4sRteknE3oMRJM6ayJ7 qgKwgfkW9i++VifOdAIYXLxnOI7o8gpIIn6ZSExRbM77GIMARKrdLypPvCPdTh54ca gFtvpHaZ2kIJE6qaOywnDBXYElEDSdHAy5GlJBJ9kylwJhPAjqfuRuGy7zPrxDW9S9 lM9t1gBhpFiaWZWaz5isWW9lg8bSaUWjCVe9VNcQAEBeQQnEwVdRb2BqfvlQxAQU2x zYad4x01Z5EgA== Date: Fri, 26 Sep 2025 05:39:45 +0000 To: "freebsd-virtualization@freebsd.org" From: Jonathan Vasquez Subject: Re: GPU Passthrough on FreeBSD 14.3 (AMD Radeon RX 6900 XT and Windows 10 Pro) Message-ID: In-Reply-To: References: <6CV-OY6BcErrWRit9jSpi6fWsYBG3E_Z3u6eTLPcz6foPAZV1gQpZYaZTR7JA_1ot5RQVqrWQaLxJFySXjspIhSbBJGxmckcDQyzxhALNus=@xyinn.org> <77221679b528434788d667441d1a32a2@userve.net> <44d9286c-0866-4805-827d-5cb91511800b@tilda.center> <3HATaLlOogPiMZWbxSnWPCnJC11_unXloaoQzyF8Ek01s9gZGVqnKKruZgFTrqHQBCi5xWNEzLzK37xiNdn3yCwXG8U7NfXKRmwY8_5xCLw=@xyinn.org> <7CNs3oS07TqJcWsTrJCZmDlAypBuy9yh4xr_iAgGnUOGjqAP5iRl1JMkuna8LwFSNIvphQLojKi214B4w6ef2q2IRgvjdolLwUD8KCnXaSQ=@xyinn.org> <9c53f1805e22fcf2c9eb878e0c7cc9a723c30dd8.camel@FreeBSD.org> <-rzPcOUnhEy7jFcu7cF7V_kjAVPV_2deuhv7EY-eJl536fUllXK-3SSnWq13HStABMZuphkRAysMMhDXvd_MWIlH4QaMGU-8l2nXKeOY-Eo=@xyinn.org> Feedback-ID: 12351801:user:proton X-Pm-Message-ID: 526f3dbd2c6d0fb2b7b64ab5c5c76bc8c996e406 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.39 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.988]; DMARC_POLICY_ALLOW(-0.50)[xyinn.org,none]; RWL_MAILSPIKE_EXCELLENT(-0.40)[79.135.106.26:from]; R_DKIM_ALLOW(-0.20)[xyinn.org:s=protonmail3]; R_SPF_ALLOW(-0.20)[+ip4:79.135.106.0/24]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEFALL_USER(0.00)[jon]; RCVD_COUNT_ZERO(0.00)[0]; MID_RHS_MATCH_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[79.135.106.26:from]; TO_DN_EQ_ADDR_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-virtualization@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[xyinn.org:+] X-Rspamd-Queue-Id: 4cXztg6yY9z3qK9 I'm continuing my investigation of why I don't see the "Shutting down" mess= age when I run "shutdown -r now" but I do if I do "service vm_gaming stop".= I'm wondering if it's actually gracefully shutting down but I just don't s= ee my monitor update because things are happening quickly. There was 1-2 ti= mes I did get the "shutdown -r now" to cause my vm to show me that screen, = but it doesn't show it to me every time. So far I haven't gotten any Window= s disk corruption or anything, but just not confident about the graceful sh= utdown. I implemented a "status" function to see if maybe it's some early terminati= on logic that's causing it not to run (or exit too early), and I've also re= placed my "sleep 10" with a proper while loop that will check the existence= of the child pid. Once the child pid no longer exists, then execution cont= inues in the stop function. The script currently looks like this: #!/bin/sh # PROVIDE: vm_gaming # REQUIRE: LOGIN # KEYWORD: nojail shutdown . /etc/rc.subr name=3Dvm_gaming rcvar=3Dvm_gaming_enable vm_path=3D"/atlantis/vms/gaming" vm_name=3D"gaming" start_cmd=3D"${name}_start" stop_cmd=3D"${name}_stop" restart_cmd=3D"${name}_restart" status_cmd=3D"${name}_status" pidfile=3D"/var/run/${name}.child.pid" vm_gaming_start() { =09echo "starting gaming vm ..." =09daemon \ =09=09-o /var/log/${name}.log \ =09=09-p "${pidfile}" \ =09=09bhyve -AHPSw -c sockets=3D1,cores=3D16,threads=3D1 -m 32G \ =09=09-s 0,hostbridge \ =09=09-s 1,nvme,${vm_path}/disk0.img \ =09=09-s 3:0,passthru,3/0/0 \ =09=09-s 3:1,passthru,3/0/1 \ =09=09-s 13:0,passthru,13/0/0 \ =09=09-s 30,xhci,tablet \ =09=09-s 31,lpc \ =09=09-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,fwcfg=3Dqemu = \ =09=09-o console=3Dstdio \ =09=09${vm_name} } vm_gaming_stop() { =09echo "stopping gaming vm ..." =09# Send SIGTERM twice to make sure Windows listens to =09# the ACPI shutdown signal. =09pid=3D"$(cat ${pidfile})" =09kill ${pid} =09kill ${pid} =09# Wait a bit for the guest to shutdown properly before =09# we continue shutting down the host. =09is_pid_running=3D"$(ps ${pid} -o pid=3D)" =09while [ ! -z "${is_pid_running}" ]; do =09=09is_pid_running=3D"$(ps ${pid} -o pid=3D)" =09done =09bhyvectl --vm=3D${vm_name} --destroy =09echo "gaming vm stopped!" } vm_gaming_restart() { =09# NOTE: AMD users will most likely experience the famous =09# AMD Hardware Reset Bug. This means that after you reboot =09# the guest, you most likely won't have video out. If this =09# happens, you'll need to restart the host. Sometimes this =09# command will work for AMD users though. So you can try a =09# restart and see if it works. =09vm_gaming_stop =09vm_gaming_start } vm_gaming_status() { =09if [ -f "${pidfile}" ]; then =09=09echo "$(cat ${pidfile})" =09fi } load_rc_config $name : ${vm_gaming_enable:=3D"NO"} run_rc_command "$1"