all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Nikola Brković via Bug reports for GNU Guix" <bug-guix@gnu.org>
To: "55907@debbugs.gnu.org" <55907@debbugs.gnu.org>
Subject: bug#55907: VFIO kernel module fails to capture PCI device
Date: Thu, 04 Jul 2024 21:37:24 +0000	[thread overview]
Message-ID: <VuGXUGjGQnHxEiL7CJApZEAU1eqUAndvtqNH7YqDhdef982qR0yMCHqTd8DcAWFXTueEcXdK3sHbxtYvGAjW4g0L_3eERvp1mXX_RjZztSA=@protonmail.com> (raw)
In-Reply-To: <ed5747f5-eaa6-4ae5-8434-d9db467079b5@www.fastmail.com>

I have managed to get VFIO working by creating a service of boot-service-type which overrides the GPU driver with vfio-pci and binds the GPU to VFIO:

>(simple-service 'vfio-override boot-service-type
>    '(and (call-with-output-file "/sys/bus/pci/devices/0000:04:00.0/driver_override"
>      (lambda (p)
>       (display "vfio-pci" p)))
>     (call-with-output-file "/sys/bus/pci/drivers/vfio-pci/new_id"
>      (lambda (p)
>       (display "1002 665f" p)))
>  )
>)

Sorry for the hard-coded IDs, you should replace them with your own. You might need to unbind the GPU's audio card from its driver as well, after you're fully booted. QEMU will refuse to pass-through the GPU if the audio card is in the same IOMMU group and not using vfio-pci.

In my case, the service runs early enough in the boot process where amdgpu has not initialized the GPU yet. There might be a better way to accomplish this, I'm still new to Guix and Scheme.

Thanks,
Nikola




      parent reply	other threads:[~2024-07-06 21:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-11 13:40 bug#55907: VFIO kernel module fails to capture PCI device Nick Zalutskiy
2023-09-08  8:43 ` Lars Rustand
2024-07-04 21:37 ` Nikola Brković via Bug reports for GNU Guix [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='VuGXUGjGQnHxEiL7CJApZEAU1eqUAndvtqNH7YqDhdef982qR0yMCHqTd8DcAWFXTueEcXdK3sHbxtYvGAjW4g0L_3eERvp1mXX_RjZztSA=@protonmail.com' \
    --to=bug-guix@gnu.org \
    --cc=55907@debbugs.gnu.org \
    --cc=nikolabrk@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.