It seems that GPU passthrough (with hostpci entry) forces full memory allocation?

phizaz

New Member
Jul 7, 2018
3
0
1
27
I have seen a suspicious behavior of my GPU-passthrough VM (Linux) for quite some time. That is no matter how small the actual memory usage is (even when the ballooning is enabled), upon starting the VM, it will "try" to allocate the full memory (as configured). This doesn't mean that ballooning doesn't work though, it does work but it happens afterward. To this end, I need to have that the maximum amount of free memory at the time of startup.

However, I can verify that this behavior is not at all "normal" to all my other VMs. Others only require bare-minimum memory for starting up. I tried to replicate the configuration as close to the GPU-passthrough one as possible. I found if I comment the line "hostpci0: 01:00,x-vga=on,pcie=1,romfile=vbios.bin" the behavior vanishes. That is if GPU is not passed-through, the memory usage remains minimal. This seems odd enough. What does GPU passthrough have to do with memory management? Is this really an intended behavior? It is not automatically clear for me though.
 

Jacob

Member
Dec 17, 2017
20
3
8
32
I'm guessing that this is the way that Linux uses to block off the ram allocation. Inside the VM though once it's started, not much ram is used by the VM itself.
 

phizaz

New Member
Jul 7, 2018
3
0
1
27
I'm guessing that this is the way that Linux uses to block off the ram allocation. Inside the VM though once it's started, not much ram is used by the VM itself.
Does it make sense given that without PCIe passthrough Linux uses a different method of RAM allocation?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!