{"id":9156,"date":"2024-09-18T06:08:05","date_gmt":"2024-09-18T06:08:05","guid":{"rendered":"https:\/\/www.infinitivehost.com\/knowledge-base\/?p=9156"},"modified":"2024-09-18T07:42:22","modified_gmt":"2024-09-18T07:42:22","slug":"fixing-dda-device-out-of-resource-error-12-in-hyper-v-vm","status":"publish","type":"post","link":"https:\/\/www.infinitivehost.com\/knowledge-base\/fixing-dda-device-out-of-resource-error-12-in-hyper-v-vm\/","title":{"rendered":"Fixing DDA device out of resource (Error 12) in Hyper-V VM"},"content":{"rendered":"<div class='epvc-post-count'><span class='epvc-eye'><\/span>  <span class=\"epvc-count\"> 3,516<\/span><span class='epvc-label'> Views<\/span><\/div>\n<p>The <strong>&#8220;DDA device out of resources (Error 12)&#8221;<\/strong> in a <strong>Hyper-V VM<\/strong> typically occurs when using <strong>Discrete Device Assignment (DDA)<\/strong> to pass through a physical GPU to a virtual machine, but there are insufficient resources (such as memory, I\/O space, or interrupts) to assign the device. Here&#8217;s how to Fixing DDA device issue:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Resolve Error 12 (DDA Resource Issue) in Hyper-V:<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong>Check if DDA is Enabled and Configured Correctly<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ensure <strong>Discrete Device Assignment (DDA)<\/strong> is enabled and that the GPU has been properly detached from the host and assigned to the VM.<\/li>\n\n\n\n<li>The GPU should be correctly reserved for the VM using <strong>PowerShell<\/strong> commands. Example PowerShell commands to detach the GPU from the host and assign it to the VM:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"># Disable the device on the host (run this on the Hyper-V host)\n   Disable-PnpDevice -InstanceId \"PCI\\VEN_xxxx&amp;DEV_xxxx&amp;SUBSYS_xxxxxxxx\"\n\n   # Assign the device to the VM (run on the host)\n   Add-VMAssignableDevice -VMName \"YourVMName\" -LocationPath \"PCIROOT(0)#PCI(1A03)#PCI(0000)\"<\/mark><\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>Allocate More Memory to the VM<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Error 12<\/strong> often arises when the VM doesn\u2019t have enough memory to allocate to the GPU.<\/li>\n\n\n\n<li>Increase the VM\u2019s memory allocation in <strong>Hyper-V Manager<\/strong>:\n<ol class=\"wp-block-list\">\n<li>Go to <strong>Hyper-V Manager<\/strong> \u2192 Select your VM \u2192 <strong>Settings<\/strong>.<\/li>\n\n\n\n<li>Under <strong>Memory<\/strong>, increase the assigned memory and ensure it&#8217;s enough to accommodate the GPU&#8217;s memory requirements.<\/li>\n\n\n\n<li>You may need to use <strong>Static Memory Allocation<\/strong> instead of dynamic memory, as DDA does not work well with dynamic memory.<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>Configure PCI Express Settings<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>GPUs require adequate <strong>PCIe resources<\/strong>, and Error 12 can result from the VM being unable to map the PCIe resources needed by the GPU.<\/li>\n\n\n\n<li>Adjust the <strong>PCI Express<\/strong> settings for the VM. You might need to reserve specific resources for the PCIe device in the <strong>BIOS\/UEFI<\/strong> or use virtualization options that allocate more PCIe I\/O space to the VM.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>Limit the Number of Devices Passed to the VM<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Reduce the number of devices passed through to the VM to free up system resources.<\/li>\n\n\n\n<li>Ensure only the GPU and essential devices are being assigned through DDA.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>Update GPU Drivers on Host and VM<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Make sure the <strong>GPU drivers<\/strong> on both the <strong>Hyper-V host<\/strong> and the <strong>VM<\/strong> are up-to-date. Outdated drivers may not properly handle resource allocation, leading to Error 12.<\/li>\n\n\n\n<li>Check the vendor (e.g., NVIDIA or AMD) for updated drivers that support GPU passthrough in virtual environments.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">6. <strong>Modify VM&#8217;s Firmware Settings<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ensure that the VM is using <strong>Generation 2<\/strong> firmware (if supported). Generation 2 VMs provide better hardware compatibility for DDA and PCIe devices.\n<ul class=\"wp-block-list\">\n<li>Go to <strong>Hyper-V Manager<\/strong> \u2192 Right-click on the VM \u2192 <strong>Settings<\/strong> \u2192 <strong>Firmware<\/strong> \u2192 Ensure it&#8217;s set to <strong>Generation 2<\/strong> (if applicable).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">7. <strong>Check for BIOS\/UEFI Updates<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ensure that the Hyper-V host\u2019s BIOS\/UEFI firmware is up-to-date. Some systems require firmware updates to support GPU passthrough and proper PCIe resource management.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">8. <strong>Check for Conflicting Devices<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Verify if there are any other conflicting devices (such as additional GPUs, NICs, etc.) consuming resources. Disable unnecessary devices or reassign them to other VMs or back to the host.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">9. <strong>Reserve Memory in the Hyper-V Host<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can use PowerShell to reserve more memory for the GPU on the Hyper-V host:<br><code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">powershell Set-VM \"YourVMName\" -LowMemoryMappedIoSpace 3Gb Set-VM \"YourVMName\" -HighMemoryMappedIoSpace 32Gb<\/mark><\/code><\/li>\n\n\n\n<li>This reserves more memory-mapped I\/O space, which might resolve the Error 12 if the issue is related to insufficient addressable memory.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">10. <strong>Reboot the Host and VM<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After making the necessary changes, reboot both the <strong>Hyper-V host<\/strong> and the <strong>VM<\/strong> to apply the new settings and see if the issue is resolved.<\/li>\n<\/ul>\n\n\n\n<p><strong>Conclusion<\/strong><\/p>\n\n\n\n<p>The&nbsp;\u201cDDA device out of resources (Error 12)\u201d&nbsp;in the case of&nbsp;Hyper-V VM&nbsp;usually occurs at the time of utilizing&nbsp;Discrete Device Assignment (DDA)&nbsp;to simply pass through any physical and the <a href=\"https:\/\/www.infinitivehost.com\/gpu-dedicated-server\"><mark style=\"background-color:#8ed1fc\" class=\"has-inline-color\"><strong>best GPU dedicated server<\/strong><\/mark><\/a> to a VM, but there are inadequate assets (like I\/O space, interrupts, or memory) to allot the device.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>3,516 Views The &#8220;DDA device out of resources (Error 12)&#8221; in a Hyper-V VM typically occurs when using Discrete Device Assignment (DDA) to pass through a physical GPU to a virtual machine, but there are insufficient resources (such as memory, I\/O space, or interrupts) to assign the device. Here&#8217;s how to Fixing DDA device issue: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[202],"tags":[],"class_list":["post-9156","post","type-post","status-publish","format-standard","hentry","category-gpu-server"],"_links":{"self":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/9156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/comments?post=9156"}],"version-history":[{"count":3,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/9156\/revisions"}],"predecessor-version":[{"id":9164,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/9156\/revisions\/9164"}],"wp:attachment":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=9156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/categories?post=9156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/tags?post=9156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}