HIP icon indicating copy to clipboard operation
HIP copied to clipboard

[HIP][MI100] Virtual Memory Management API on MI100?

Open crozhon opened this issue 2 years ago • 8 comments

Does MI100 support the virtual memory management API? (functions hipMemAddressReserve, hipMemMap). I've been following this test case (https://github.com/ROCm-Developer-Tools/hip-tests/blob/094b9af382585a079d13c735fd170e69bea735b6/catch/unit/memory/hipMemVmm.cc), and virtual memory is always unsupported on all of our devices.

I've attached a small test program that queries for support and it always returns 0/false on rocm-5.4.2.

hipDeviceAttributeVirtualMemoryManagementSupported : 0

Is there something wrong with my setup or are these APIs just not supported on these devices?

#include <cstdio>

#include <hip/hip_runtime_api.h>

int main() {
    int vmm = 0;
    hipError_t result = hipDeviceGetAttribute(&vmm, hipDeviceAttributeVirtualMemoryManagementSupported, 0);
    if (result != hipSuccess) {
        return -1;
    }

    std::printf("hipDeviceAttributeVirtualMemoryManagementSupported : %d\n", vmm);
    return 0;
}

crozhon avatar Feb 01 '23 16:02 crozhon

Which OS are you running? For Ubuntu 20.04, you need the HWE stack. I'm not sure about other distros.

b-sumner avatar Feb 01 '23 17:02 b-sumner

Yup Ubuntu 20.04. Thanks, that makes sense - I'll try switching the kernel.

crozhon avatar Feb 02 '23 01:02 crozhon

Switched to the HWE stack and reinstalled, but it's still coming back as not supported. Here's my kernel and package versions:

$dkms status
amdgpu, 5.18.13-1528701.20.04, 5.15.0-58-generic, x86_64: installed
hip-dev/focal,now 5.4.22803.50402-104~20.04 amd64 [installed,automatic]
rocm-dev/focal,now 5.4.2.50402-104~20.04 amd64 [installed]

crozhon avatar Feb 02 '23 10:02 crozhon

I do not see here something HIP RT-related:

  case hipDeviceAttributeVirtualMemoryManagementSupported:
    *pi = static_cast<int>(g_devices[device]->devices()[0]->info().virtualMemoryManagement_);
    break;

Looks like HW or HSA RT specifics.

@gargrahul, could you please have a look too?

emankov avatar Feb 02 '23 12:02 emankov

Hey @gargrahul and @emankov, can we check back on this? Possible for us to get more info on your roadmap here / when it might be available? Email is fine, thanks. cc: @crozhon

jowens avatar Feb 20 '23 20:02 jowens

@gargrahul, @mangupta could you please let us know to whom we should address this ticket? We suspect HSA RT/HW.

Thank you in advance!

emankov avatar Mar 01 '23 16:03 emankov

@crozhon : The ROCm driver does not support Virtual Memory Management and hence HIP runtime reports hipDeviceAttributeVirtualMemoryManagementSupported as 0. The support is being added in a future ROCm release. Please keep an eye out on the ROCm release notes to track this.

mangupta avatar Apr 11 '24 14:04 mangupta

@crozhon We have an internal ticket to add support in future ROCm release. Will provide ROCm release info when available. Thanks!

ppanchad-amd avatar Apr 11 '24 15:04 ppanchad-amd

Hi @crozhon, this feature has been implemented since ROCm 6.2.

zichguan-amd avatar Dec 20 '24 19:12 zichguan-amd