Jump to content
matthope

[SOLVED] [6.3.5] Passing through intel IGD with Win10 = abnormally high mem usage

7 posts in this topic Last Reply

Recommended Posts

Issue:

 

When I passthough the intel IGD to my VM, the task manager report a usage of 5.2Gb at idle. I've tried using more or less RAM and I figure out that under 4Gb of RAM, the IGD wont work (error 43), therefore the idle ram usage is around 1.2Gb. The VM crash when I allocate between 4 and 5.5 Gb of RAM. However, with higher RAM value the idle value stay stable a 5.2~5.3Gb. Since the OS take ~1.2Gb of ram normally, my guess is that the IGD/QEMU does a memalloc of 4Gb or something like this. It's maybe just a parameter somewhere but losing 4Gb of RAM is kind of annoying.

 

OS:

 

Windows 10 Pro x64 (fresh install)

Virtio 0.1.126

Latest Intel Driver

 

Hardware:

 

CPU: Intel G4600

IGD: Intel HD 630

MOBO: B150N-GSM

RAM: 16Gb DDR3

 

unraid-srv-diagnostics-20170912-2258.zip

Share this post


Link to post

Following up my last post, I looked at my pool memory with poolmon and I've found that my IGD is indeed taking up 4.3Gb of memory. I'm now trying to found why.

 

@GMM - <unknown>    - (Intel video driver) Memory manager

 

image.png.97a523973682eb481ae2e04c21f3c9f0.png

Share this post


Link to post

I might have found something interesting from the QEMU Github . It's said that legacy mode require a fw_cfg file, however i've look at the qemu command that unraid auto-generate and it doesn't contains any -fw_cfg parameter. 

Legacy mode IGD support imposes two fw_cfg requirements on the VM firmware:

1) "etc/igd-opregion"

   This fw_cfg file exposes the OpRegion for the IGD device.  A reserved
   region should be created below 4GB (recommended 4KB alignment), sized
   sufficient for the fw_cfg file size, and the content of this file copied
   to it.  The dword based address of this reserved memory region must also
   be written to the ASLS register at offset 0xFC on the IGD device.  It is
   recommended that firmware should make use of this fw_cfg entry for any
   PCI class VGA device with Intel vendor ID.  Multiple of such devices
   within a VM is undefined.

2) "etc/igd-bdsm-size"

   This fw_cfg file contains an 8-byte, little endian integer indicating
   the size of the reserved memory region required for IGD stolen memory.
   Firmware must allocate a reserved memory below 4GB with required 1MB
   alignment equal to this size.  Additionally the base address of this
   reserved region must be written to the dword BDSM register in PCI config
   space of the IGD device at offset 0x5C.  As this support is related to
   running the IGD ROM, which has other dependencies on the device appearing
   at guest address 00:02.0, it's expected that this fw_cfg file is only
   relevant to a single PCI class VGA device with Intel vendor ID, appearing
   at PCI bus address 00:02.0.

 

From the Qemu man page : 

 

-fw_cfg [name=]name,file=file
Add named fw_cfg entry with contents from file file.
-fw_cfg [name=]name,string=str
Add named fw_cfg entry with contents from string str.
The terminating NUL character of the contents of str will not be included as part of the fw_cfg item data. To insert contents with embedded NUL characters, you have to use the file parameter.

The fw_cfg entries are passed by QEMU through to the guest.

Example:

        -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
creates an fw_cfg entry named opt/com.mycompany/blob with contents from ./my_blob.bin.

 

Anybody to help me with this, or at least look at it?

 

Share this post


Link to post

I've also had memory issues, random hard locks on unraid etc for a while, hopefully this is the problem.

 

Here is output of my poolmon in case it is of use

 

image.png.5fb8f30ad92fad12051164e29e5f5991.png

Share this post


Link to post

I've found a solution in the vfio-users@redhat.com archives, just add those line at the end of the VM XML config. If you're passingtrough more than one device, just make sure to select the hostdev# accordingly to your intel IGD.

 

[...]  
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.hostdev0.x-igd-opregion=on'/>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.hostdev0.x-igd-gms=1'/>
  </qemu:commandline>
</domain>

 

Share this post


Link to post
On ‎08‎/‎10‎/‎2017 at 6:39 PM, matthope said:

I've found a solution in the vfio-users@redhat.com archives, just add those line at the end of the VM XML config. If you're passingtrough more than one device, just make sure to select the hostdev# accordingly to your intel IGD.

 


[...]  
  <qemu:commandline>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.hostdev0.x-igd-opregion=on'/>
    <qemu:arg value='-set'/>
    <qemu:arg value='device.hostdev0.x-igd-gms=1'/>
  </qemu:commandline>
</domain>

 

Excellent, thanks for this. Just applied it and so far appears to be massive improvement.

Edited by KShips

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.