Tutorial: Passing through GPU to Hyper-V guest VM

Page 4 of 5 FirstFirst ... 2345 LastLast

  1. Posts : 52
    linux
       #31

    .\Update-VMGpuPartitionDriver.ps1 -VMName "GPUPV" -GPUName "AUTO" (it picked the wrong gpu,anyway)

    at this point I tried to help the script to pick the right GPU :

    .\Update-VMGpuPartitionDriver.ps1 -VMName "GPUPV" -GPUName "NVIDIA GeForce RTX 2080 Ti"

    then :

    nano new.ps1

    $vm = "GPUPV"
    if (Get-VMGpuPartitionAdapter -VMName $vm -ErrorAction SilentlyContinue) {
    Remove-VMGpuPartitionAdapter -VMName $vm
    }
    Set-VM -GuestControlledCacheTypes $true -VMName $vm
    Set-VM -LowMemoryMappedIoSpace 1Gb -VMName $vm
    Set-VM -HighMemoryMappedIoSpace 32Gb -VMName $vm
    Add-VMGpuPartitionAdapter -VMName $vm


    and :

    .\new.ps1
    ok

    the result is totally wrong :

    Tutorial: Passing through GPU to Hyper-V guest VM-2023-07-17_11-51-27.png
      My Computer


  2. Posts : 16
    Win10 Pro
    Thread Starter
       #32

    Sorry I'm not sure what went wrong.

    It looks like it copied the wrong drivers anyway. You manually specified "NVIDIA GeForce RTX 2080 Ti" but the VM is seeing "GeForce 1060 3gb"
      My Computer


  3. Posts : 52
    linux
       #33

    I made some progress,but it still does not work as expected. This is what I did :

    1) created a new Hyper-V VM called "Windows11-GNUP"
    2) .\Update-VMGpuPartitionDriver.ps1 -VMName "Windows-11-GNUP" -GPUName "NVIDIA GeForce RTX 2080 Ti"
    3) nano new.ps1

    $vm = "Windows-11-GNUP"
    if (Get-VMGpuPartitionAdapter -VMName $vm -ErrorAction SilentlyContinue) {
    Remove-VMGpuPartitionAdapter -VMName $vm
    }
    Set-VM -GuestControlledCacheTypes $true -VMName $vm
    Set-VM -LowMemoryMappedIoSpace 1Gb -VMName $vm
    Set-VM -HighMemoryMappedIoSpace 16Gb -VMName $vm
    Add-VMGpuPartitionAdapter -VMName $vm


    4) .\new.ps1

    this is what happened :

    Tutorial: Passing through GPU to Hyper-V guest VM-2023-07-18-00-42-29.png
    Tutorial: Passing through GPU to Hyper-V guest VM-2023-07-18-00-43-14.png

    it attached the GTX 1060 and not the RTX 2080 ti,but anyway,the drivers have been copied correctly. Infact I can launch Blender and Cycles has been able to recognize the CUDA libraries and the GPU. It's a shame that's the wrong one. Maybe with two GPUs,the script confuses itself.
      My Computer


  4. Posts : 16
    Win10 Pro
    Thread Starter
       #34

    Hmmmm ok interesting. Maybe creating the new VM caused it to be a Generation 2 VM? Because Generation 2 VM is required. I also see that you changed the high memory mapped in the script
      My Computer


  5. Posts : 52
    linux
       #35

    Yes, I have already chosen "generation 2" VM. And yes,I have chosen 16 GB of the default 32 Gb for caution. Could this be the reason?
      My Computer


  6. Posts : 16
    Win10 Pro
    Thread Starter
       #36

    i cannot say for sure
      My Computer


  7. Posts : 52
    linux
       #37

    ok. the important thing is that it worked. Anyway,I'm more interested to use Linux instead of Windows. I'm studying the script and the situation to understand if I can get the same result (such as the cuda libraries and my gpu recognized) using Linux. I have some ideas about how to achieve the same result. If someone wants to collaborate,I'm here.
      My Computer


  8. Posts : 52
    linux
       #38

    you can try to modify your script like this one :

    Code:
    $vm = "ubuntu"
    Remove-VMGpuPartitionAdapter -VMName $vm
    $gpu_list = Get-VMHostPartitionableGpu
    foreach ($k in $gpu_list){
        $instance_path = $k.Name
        $instance_path
        Add-VMGpuPartitionAdapter -VMName $vm -InstancePath $instance_path
    }
    Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionVRAM 1
    Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionVRAM 11
    Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionVRAM 10
    Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionEncode 1
    Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionEncode 11
    Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionEncode 10
    Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionDecode 1
    Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionDecode 11
    Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionDecode 10
    Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionCompute 1
    Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionCompute 11
    Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionCompute 10
    Set-VM -GuestControlledCacheTypes $true -VMName $vm
    Set-VM -LowMemoryMappedIoSpace 1Gb -VMName $vm
    Set-VM -HighMemoryMappedIoSpace 32GB -VMName $vm
    instead of this one :

    Code:
    $vm = "Name of your VM"
    if (Get-VMGpuPartitionAdapter -VMName $vm -ErrorAction SilentlyContinue) {
       Remove-VMGpuPartitionAdapter -VMName $vm
    }
    Set-VM -GuestControlledCacheTypes $true -VMName $vm
    Set-VM -LowMemoryMappedIoSpace 1Gb -VMName $vm
    Set-VM -HighMemoryMappedIoSpace 32Gb -VMName $vm
    Add-VMGpuPartitionAdapter -VMName $vm
      My Computer


  9. Posts : 2
    win10
       #39

    is there any considerations for updating video drivers? I would like to update mine on my host os.
      My Computer


  10. Posts : 16
    Win10 Pro
    Thread Starter
       #40

    Corpo said:
    is there any considerations for updating video drivers? I would like to update mine on my host os.
    👇👇👇

    Starlet7222 said:
    As far as I understand, everytime you update your graphics drivers on your host, you will similarly need to copy those new drivers into the guest VMs as well. We simply repeat Step 4 to do this.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 15:17.
Find Us




Windows 10 Forums