{"id":28211342,"url":"https://github.com/airborne-commando/vfio-gpu-script","last_synced_at":"2026-05-10T02:44:16.183Z","repository":{"id":64746597,"uuid":"577205867","full_name":"airborne-commando/vfio-gpu-script","owner":"airborne-commando","description":"A gpu script partially generated by AI, tweeked out a little.","archived":false,"fork":false,"pushed_at":"2024-05-12T16:07:24.000Z","size":1873,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T18:09:18.887Z","etag":null,"topics":["ai","amd","bash","gpu","intel","iommu","iommu-group","linux","nvidia","shell","vfio","vfio-pci","virtualization"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/airborne-commando.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-12T08:07:19.000Z","updated_at":"2024-05-12T16:07:27.000Z","dependencies_parsed_at":"2024-05-12T17:22:19.515Z","dependency_job_id":null,"html_url":"https://github.com/airborne-commando/vfio-gpu-script","commit_stats":null,"previous_names":["airborne-commando/vfio-gpu-script","nthompson096/vfio-gpu-script"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airborne-commando%2Fvfio-gpu-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airborne-commando%2Fvfio-gpu-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airborne-commando%2Fvfio-gpu-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airborne-commando%2Fvfio-gpu-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/airborne-commando","download_url":"https://codeload.github.com/airborne-commando/vfio-gpu-script/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airborne-commando%2Fvfio-gpu-script/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259056143,"owners_count":22798884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","amd","bash","gpu","intel","iommu","iommu-group","linux","nvidia","shell","vfio","vfio-pci","virtualization"],"created_at":"2025-05-17T18:09:18.937Z","updated_at":"2026-05-10T02:44:16.150Z","avatar_url":"https://github.com/airborne-commando.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Check my troubleshooting guide for possible fixes to some issues.\n\n[the guide/wiki](https://github.com/Nthompson096/vfio-gpu-script/wiki/troubleshooting) This will be updated if I find anything so I won't clobber up the readme.\n\n# auto installs (windows)\n\n[A small guide here. which will link to a detailed wiki](https://github.com/Nthompson096/vfio-gpu-script/wiki/From-creating-an-automatic-install-(windows))\n\n# vfio-gpu-script\nA gpu script partially by AI, useful for blacklisting AMD or NVIDIA GPU's on a dual GPU machine for virtualization (AMD/NVidia).\n\n## How to activate\nsimply clone this archive (or download this script), then make this script executable with ```sudo chmod +x;``` afterwards run ```sudo ./vfio-gen-aio.sh``` or ```sudo sh ./vfio-gen-aio.sh``` in your terminal of choice.\n\nThis is what you'll need:\n\n* virt-manager\n* qemu-full \n* a rom for your GPU you can use a rom dumping utility or simply look on the internet [check the newly created page on the wiki](https://github.com/Nthompson096/vfio-gpu-script/wiki/Useful-guides-from-my-other-github-repo.).\n\nFor trying to pass though Nvidia you'll need to apply this patch and install either of these kernels listed in this wiki [if you use arch](https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_(ACS_override_patch))\nAnd for the sake of it, here's a video from [Pavol Elsig](https://www.youtube.com/watch?v=JBEzshbGPhQ) which should be an easier guide also a level1tech guide [here](https://forum.level1techs.com/t/how-to-apply-acs-override-patch-kubuntu-18-10-kernel-4-18-16/134204/2).\nThere's a repo on ASC+PCI patching [here](https://github.com/some-natalie/fedora-acs-override) however you'd have to rebuild the kernel apparently so if you do not wish to do so you may install [liquorix](https://liquorix.net/) instead if you'd like (fedora command is below).\n\nfor issues with the mouse/keyboard you'll need to use evdev, guide to do so is in inside the [archwiki](https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Passing_keyboard/mouse_via_Evdev) you may also use some of the qemu commands I've pointed out [here](https://github.com/Nthompson096/KVM-GPU-Passthrough#for-people-having-issues-with-games-such-as-red-dead-2-enter-this-value-here-inside-the-xml-document-for-your-newcurrent-vm).\nFor issues with a stuck keyboard mouse input you may need the VFIO drivers; here's an [ISO](https://fedorapeople.org/groups/virt/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso) file for it.\n\n## What this script does!\n\n* This script will ask you to blacklist either an AMD or NVIDIA drivers (GPUs)\n* Will also ask if it wants you to create a vfio file (if you have the vfio-linux kernel or an a equivalent such as liquorix)\n* Will ask you to input the values into your grub (pci.ids)\n* Will ask you if you'd want to generate AMD/Intel Iommu configs\n* Will ask you if you'd want to create GPU breakups with an ACS override patch (good for when groups are not grouped properly)\n* Will ask you if you'd want to remove the blacklist/vfio on start, also will ask you if you want to revert grub.\n* Will pull in other scripts for grub updates (or any bootloader you use) with grub-update and grub-backup shell scripts, will ask you to revert changes within grub revert; all customizable or at least easily customizable than compared to earlier; feel free to edit those files and the main vfio script should work for your disto.\n\n## I have issues with resetting a GPU from AMD\n\nThis should help; keep in mind that it will suspend your host so you'll have to just click a keyboard button; you'll need to run this script as a super user (sudo) also be sure to edit the values for the PCI devices and you may use ``sudo sh`` when running this script.\n\n    #!/bin/bash\n    echo 1 \u003e /sys/bus/pci/devices/0000:00:00.0/remove\n    echo 1 \u003e /sys/bus/pci/devices/0000:00:00.1/remove\n    echo \"Suspending...\"\n    rtcwake -m no -s 4\n    systemctl suspend\n    sleep 5s\n    echo 1 \u003e /sys/bus/pci/rescan    \n    echo \"Reset done\"\n\nyou can view your GFX card with ``lspci`` and it should give you the PCI-E numbers such as ``09:00.0`` and ``09:00.1`` for an example.\n\n### I have issues with my display, I am using AMD.\n\nYou would have to generate your initial ramdisk environments:\nexample for arch, which is what I'm using.\n\n    sudo mkinitcpio --allpresets\n\nBe sure to check the man pages, or install [tldr](https://tldr.sh/).\n\nUPDATE: This is now inside the script; this will happen when it asks you if you'd like to delete the vfio file and you'd enter [y]es\nAlso be sure to have `MODULES=(amdgpu)` inside your `/etc/mkinitcpio.conf` for this to work.\n\n# Patching your qemu-binary\n\nYou would need to install vim-common for this\n\n    #!/bin/bash\n\n    hexdump -ve '1/1 \"%.2x\"' ./qemu-system-x86_64 |\n    sed -e 's/424f4348/434f4348/g' -e 's/42585043/44585043/g' |\n    xxd -r -p \u003e ./qemu-system-x86_64-pass\n\nThis would patch your qemu-system to not be easily found for gaming basically; otherwise you'd have to do it manually.\n\n\n## liquorix\n\n    sudo dnf copr enable rmnscnce/kernel-lqx\n    sudo dnf in kernel-lqx\n\n\n\n## I have issues with SElinux with my NTFS drive, VM will not start and or it crashes, already set permissons and groups (fedora)\n\nUse this to enable VM's on a NTFS drive (selinux)\n\n    setsebool  virt_use_fusefs=on\n\nand before you run this script be sure to enter this following command to update grub and reboot (virt-manager crash windows any)\n\n\nYou'll also need to set your processor to QEMU and clear the current processor config from copying the current host; then you may set it back after a windows install.\n\n    sudo grubby --update-kernel=ALL --args='kvm.ignore_msrs=1'\n\n\u003cbr\u003e\n\nfor Arch edit kvm.conf inside /etc/modprobe.d/. this is for BSOD inside windows host-passthough cpu modes:\n\n    options kvm ignore_msrs=1\n\nIf all else fails you'll probably have to either set seliunx to ``permissive`` or ``disabled`` it inside ```/etc/selinux/config```\n\nYou can also set it wil grubby, that's inside the selinux config, will not cover here though.\n\n## I have no idea how to set permisisons and groups inside fedora \n\n    sudo usermod -a -G libvirt $(whoami)\n    \nand be sure to add yourself to the qemu file like so in ```/etc/libvirt/qemu.conf```\n\n      user = \"1000\"\n      \n    # The group for QEMU processes run by the system instance. It can be\n    # specified in a similar way to user.\n      group = \"kvm\"\n\nThe following above was an example and a Userid of the current user, which is you; you can change it to something you'd want.\n\n## Fstab (NTFS)\n\n     ntfs-3g default_permissons,allow_other,uid=1000,gid=1000,rw,umask=000 0 0\n     \n\nAn example of a fstab drive; change it to what you will but it seems to work pretty well under fedora.\n\n\n## GIF Examples\n\n*  *inital startup*\n\n![](https://i.imgur.com/N391AyF.gif)\n\n*  *CPU and other options*\n\n![](https://i.imgur.com/TuVIzoJ.gif)\n\n\n## Current list of compat distros with no black screens (least for my card experience may vary)\n\n### This will imply that you have dumped the ROM and loaded along with your PCI-e card UNDER FEDORA or possibly other Linux; remember mileage may vary.\n\n### AMD\n* AMD+Ubuntu=supported on the latest release.\n* AMD+Debian=Doesn't fully support AMD.\n* AMD+arch=supported\n* AMD+Fedora=Not supported\n* AMD*Windows=Supported\n\n### NVIDIA\n* NVIDIA+Ubuntu=supported\n* NVIDIA+Arch=supported\n* NVIDIA+Debian=supported\n* NVIDIA+Fedora=Supported\n* NVIDIA+Windows=Supported\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairborne-commando%2Fvfio-gpu-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fairborne-commando%2Fvfio-gpu-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairborne-commando%2Fvfio-gpu-script/lists"}