libhsakmt: Init apertures in AcquireSystemProperties

This allows init_process_apertures to use the whole consistent topoology
instead of taking its own partial snapshot.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Change-Id: Ia13e7aa7fcd090ea8d6cacd4babb29a27c20207f


[ROCm/ROCR-Runtime commit: 87aca673e8]
This commit is contained in:
Felix Kuehling
2022-07-13 16:51:56 -04:00
parent 7ccda4ba26
commit e8ba7dc5c2
4 changed files with 51 additions and 42 deletions
-14
View File
@@ -179,14 +179,6 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtOpenKFD(void)
if (result != HSAKMT_STATUS_SUCCESS)
goto topology_sysfs_failed;
result = fmm_init_process_apertures(sys_props.NumNodes);
if (result != HSAKMT_STATUS_SUCCESS)
goto init_process_aperture_failed;
result = init_process_doorbells(sys_props.NumNodes);
if (result != HSAKMT_STATUS_SUCCESS)
goto init_doorbell_failed;
kfd_open_count = 1;
if (init_device_debugging_memory(sys_props.NumNodes) != HSAKMT_STATUS_SUCCESS)
@@ -212,10 +204,6 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtOpenKFD(void)
pthread_mutex_unlock(&hsakmt_mutex);
return result;
init_doorbell_failed:
fmm_destroy_process_apertures();
init_process_aperture_failed:
topology_sysfs_failed:
kfd_version_failed:
close(fd);
@@ -235,8 +223,6 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtCloseKFD(void)
if (--kfd_open_count == 0) {
destroy_counter_props();
destroy_device_debugging_memory();
destroy_process_doorbells();
fmm_destroy_process_apertures();
if (kfd_fd) {
close(kfd_fd);
kfd_fd = 0;