Giter Site home page Giter Site logo

jack2007 / macos-kvm-gpu-passthrough Goto Github PK

View Code? Open in Web Editor NEW

This project forked from biganteater/macos-kvm-gpu-passthrough

0.0 0.0 0.0 120.27 MB

Run macOS on QEMU/KVM. With OpenCore + Big Sur + Monterey support now! Only commercial (paid) support is available now to avoid spammy issues. No Mac system is required.

Shell 44.48% Python 50.34% Makefile 5.18%

macos-kvm-gpu-passthrough's Introduction

This is a fork of kholia/OSX-KVM, so make sure to check them out!

This is an automatic installer for making a MacOS VM with GPU passthrough.

Preperations

To prepare, make sure you have virtualization enabled in your BIOS.

For chad AMD this could be done by enabling

• IOMMU • NX Mode • SVM Mode

For you lame Intel users, just enable

• VT-d • VT-x

And then clone the repository by typing: To start, make sure to clone the repository in the folder you want your VM to be stored.

git clone --depth 1 --recursive https://github.com/BigAnteater/MacOS-KVM-GPU-Passthrough && cd MacOS-KVM-GPU-Passthrough

Setting up GRUB

if you have already set your bootloader up, you can skip this step but this is for the people who are doing this for the first time.

Preparing GRUB is very simple. Just follow these instructions.

  1. Mark the script as executable: for AMD: chmod +x grub_setup_amd.sh for Intel: chmod +x grub_setup_intel.sh.
  2. Then run the script: AMD: sudo ./grub_setup_amd.sh Intel: sudo ./grub_setup_intel.sh.
  3. Then just follow the instructions in script!
  4. Once you finish, reboot.

Configuring Libvirt + other applications

To configure libvirt run my script which configures libvirt and QEMU for you. Mark the script as executable

chmod +x libvirt_configuration.sh

Then run the script

sudo ./libvirt_configuration.sh

Note: if it asks you to replace iptables with iptables-nft, just say yes.

Creating the VM

To make this very simple to set up and install, I created a script that installs the VM for you. To run it, do the following:

chmod +x setup.sh

Then once it's executable, run the script.

./setup.sh

The script will walk you through making the VM.

NOTE: if you have an older nvidia card (most cards that came before the 1080 ti), you might be able to run high sierra with GPU acceleration.

Once you have made the VM, it will show up in virtual machine manager. You can edit the RAM settings and the CPU configuration. I reccomend settings the CPU mode to host-passthrough.

NOTE: the VM will only boot if you give it either 2, 4, or 8 cores.

Lastly, make sure the other two drives are bootable.

Screen Capture_select-area_20220129125925

Setting up the passthrough hooks

To set up the passthrough hooks, we will be using a QEMU hooks script made by RisingPrismTV. To install it, we will want to type the following commands:

git clone https://gitlab.com/risingprismtv/single-gpu-passthrough/ && cd single-gpu-passthrough

Then we will be running the install script:

sudo ./install_hooks.sh

Now your hooks should be good to go!

Adding the GPU to the VM

Note: I'm skipping patching the ROM just because AMD graphics cards don't need them. If you happen to be using a compatible NVIDIA card, I've linked a timestamp to my video where I showcase how to do so. https://youtu.be/R5c25kV4tZ0?t=306

Adding the GPU is very simple.

  1. Open your VM in virt-manager.
  2. Cick add hardware and choose PCI host device. Screen Capture_select-area_20220129132902
  3. Choose your everything related to your graphics card. For AMD GPU users, if your GPU and GPU audio device are in different groups, that's fine.
  4. Finally, add your USB controller, and your audio controller.

Closing notes

Now you should be able to power on your VM, and use your GPU with it!

macos-kvm-gpu-passthrough's People

Contributors

biganteater avatar kholia avatar sickcodes avatar thenickdude avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.