ilayna / Single-GPU-passthrough-amd-nvidia

My way of doing single gpu passthrough the simplest way, I've gathered many sources together to make the perfect Single GPU passthrough guide the simplest and easiest way.
GNU General Public License v3.0
397 stars 39 forks source link

Fix for virsh issues and addition of hugepages #12

Closed Micim987 closed 2 years ago

Micim987 commented 2 years ago

This remove the virsh commands from the hooks fixing numerous issues as well as adding a system for automatically allocating and de-allocating hugepages. Hugepages may not be available for every system so you should create a function in the python script for checking by running the alloc_hugepages.sh to verify that it works and then running dealloc_hugepages.sh to free the ram back up. It will also need the hugepages function listed below in win10.xml as well as a memory value in MiB in kvm.conf matching that of the VM. The hugepages scripts are optional but highly recommend as they reduce stuttering.

<domain type='kvm'>
...
  <currentMemory unit='KiB'>16777216</currentMemory>
  <memoryBacking>
    <hugepages/>
  </memoryBacking>
  <vcpu placement='static'>8</vcpu>
...
</domain>
ilayna commented 2 years ago

When is the gpu deattached and reaatach now ? Since its no longer in start.sh, Also its gonna take me abit to go over this since im at school rn.

Micim987 commented 2 years ago

It's an internal function of virsh. As long as the PCI devices are in the config virsh itself will attempt to detach them. The start and stop scripts prepare the GPU to be detached but running any virsh commands from within a hook can lead to virsh hanging for extended periods of time or completely hanging until a hard reset.

ilayna commented 2 years ago

PCI devices are in the config

what config are you talking about ? is it the kvm.conf file ?