Smart Access Memory vs Qemu/KVM

Does anyone know if Smart Access Memory can be used from a guest running inside qemu/kvm ?
I would assume this is a CPU flag, which might or might not be visible to the guest… How-ever, I have no clue if BAR resize from within the guest will ever work ?

2 Likes

I would imagine if you did if you passed the GPU through to the guest, and set the cpu topology to host-passthrough, then it SHOULD be fine, assuming of course the feature is enabled in the BIOS, but I would still like to see if anybody actually gets it to work. Also, FWIW, there are some cpuflags that still have to be manually enabled, even after using host-passthrough, so it might take some tinkering

I would like to know if this is working. I think this is an interesting question.

@wendell You have some insight here or hardware you could use for a quick test. Unfortunately I do not have a GPU that new.

Digging through the QEMU source-code, it would seem BAR Resize is being hidden from the guest (and not supported):

I would suspect this means Smart Access Memory will not work for a VFIO setup then.
I don’t have the required hardware to confirm this tough. :frowning:

2 Likes

Tested this on Qemu 5.2.0 with 6900XT, 5950X and MSI X570 CREATION with Agesa 1.2.0.0.
The GPU is working and there is a video output but the driver will not work when BAR Resize is enabled.
So its end up with using the generic GPU driver.

2 Likes

Thanks Pixo for your input. I will have to revisit this and will keep an eye out for any updates. Good job with the source dive GlemSom. This may interest someone enough to dig further.

So patching the line disabling REBAR capabilities out will allow the driver to work if SAM is enabled.
And according to GPU-Z it is.
But the system is unstable so something is not working correctly.