From a0bfa0e44eb357d3ffa67972394b414b6802a738 Mon Sep 17 00:00:00 2001 From: "Galantsev, Dmitrii" Date: Wed, 15 May 2024 12:53:43 -0500 Subject: [PATCH 1/3] Azure - Add rocm-ci.yml Change-Id: I1086884fe70081822a79d0e7a814ceb81813d62c Signed-off-by: Galantsev, Dmitrii --- .azuredevops/rocm-ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .azuredevops/rocm-ci.yml diff --git a/.azuredevops/rocm-ci.yml b/.azuredevops/rocm-ci.yml new file mode 100644 index 0000000000..0a5ee0c584 --- /dev/null +++ b/.azuredevops/rocm-ci.yml @@ -0,0 +1,40 @@ +resources: + repositories: + - repository: pipelines_repo + type: github + endpoint: ROCm + name: ROCm/ROCm + +variables: +- group: common +- template: /.azuredevops/variables-global.yml@pipelines_repo + +trigger: + batch: true + branches: + include: + - develop + paths: + exclude: + - .github + - docs + - '.*.y*ml' + - '*.md' + - LICENSE + +pr: + autoCancel: true + branches: + include: + - develop + paths: + exclude: + - .github + - docs + - '.*.y*ml' + - '*.md' + - LICENSE + drafts: false + +jobs: + - template: ${{ variables.CI_COMPONENT_PATH }}/amdsmi.yml@pipelines_repo From c5da93ab906be4d6da0a1ab4edcd828e0c084bb3 Mon Sep 17 00:00:00 2001 From: Charis Poag Date: Mon, 20 May 2024 11:26:29 -0500 Subject: [PATCH 2/3] SWDEV-462728 Add update-pciids to install + remove subsystem name Added to install to update-pciids if there is network connection. Removed subsystem name from outputting under model. Added TODO to add later on. Change-Id: I028269f2931f61e094116a85a7a1286de548122a Signed-off-by: Charis Poag --- DEBIAN/postinst.in | 5 +++++ RPM/post.in | 5 +++++ src/amd_smi/amd_smi.cc | 15 +-------------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/DEBIAN/postinst.in b/DEBIAN/postinst.in index 3d0535d8a7..76c97b92f8 100755 --- a/DEBIAN/postinst.in +++ b/DEBIAN/postinst.in @@ -1,5 +1,9 @@ #!/bin/bash +do_updatepciids() { + update-pciids >/dev/null 2>&1 || true +} + do_configureLogrotate() { local IS_SYSTEMD=0 local packageName="amd-smi-lib" @@ -187,6 +191,7 @@ case "$1" in ( configure ) do_install_amdsmi_python_lib do_ldconfig + do_updatepciids do_configureLogrotate || exit 0 ;; ( abort-upgrade | abort-remove | abort-deconfigure ) diff --git a/RPM/post.in b/RPM/post.in index 653b365f8f..f8591489b5 100755 --- a/RPM/post.in +++ b/RPM/post.in @@ -1,5 +1,9 @@ #!/bin/bash +do_updatepciids() { + update-pciids >/dev/null 2>&1 || true +} + do_configureLogrotate() { local IS_SYSTEMD=0 local packageName="amd-smi-lib" @@ -186,5 +190,6 @@ do_install_amdsmi_python_lib() { if [ "$1" -ge 1 ]; then do_install_amdsmi_python_lib do_ldconfig + do_updatepciids do_configureLogrotate || exit 0 fi diff --git a/src/amd_smi/amd_smi.cc b/src/amd_smi/amd_smi.cc index d9c9b1244c..daa809247a 100644 --- a/src/amd_smi/amd_smi.cc +++ b/src/amd_smi/amd_smi.cc @@ -424,19 +424,6 @@ amdsmi_status_t amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_hand << "\n; info->product_name: |" << board_info->product_name << "|"; LOG_INFO(ss); - // Correct any missing details - if (board_info->model_number[0] == '\0') { - status = rsmi_wrapper(rsmi_dev_name_get, processor_handle, board_info->model_number, - AMDSMI_256_LENGTH); - if (status != AMDSMI_STATUS_SUCCESS) { - memset(board_info->model_number, 0, - AMDSMI_256_LENGTH * sizeof(board_info->model_number[0])); - } - ss << __PRETTY_FUNCTION__ << " | [rsmi_correction] board_info->model_number= |" - << board_info->model_number << "|"; - LOG_INFO(ss); - } - if (board_info->product_serial[0] == '\0') { status = rsmi_wrapper(rsmi_dev_serial_number_get, processor_handle, board_info->product_serial, AMDSMI_NORMAL_STRING_LENGTH); @@ -450,7 +437,7 @@ amdsmi_status_t amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_hand } if (board_info->product_name[0] == '\0') { - status = rsmi_wrapper(rsmi_dev_subsystem_name_get, + status = rsmi_wrapper(rsmi_dev_name_get, processor_handle, board_info->product_name, AMDSMI_256_LENGTH); if (status != AMDSMI_STATUS_SUCCESS) { From 1cee1baac258d77eb6ecbcff8aab51cbd1806426 Mon Sep 17 00:00:00 2001 From: Maisam Arif Date: Tue, 21 May 2024 01:04:55 -0500 Subject: [PATCH 3/3] Make product name empty when unable to find pciid Signed-off-by: Maisam Arif Change-Id: If2300bf2deb4fa099db695949bd4c74393dbbbfc --- src/amd_smi/amd_smi.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/amd_smi/amd_smi.cc b/src/amd_smi/amd_smi.cc index daa809247a..5fcee46eff 100644 --- a/src/amd_smi/amd_smi.cc +++ b/src/amd_smi/amd_smi.cc @@ -440,6 +440,13 @@ amdsmi_status_t amdsmi_get_gpu_board_info(amdsmi_processor_handle processor_hand status = rsmi_wrapper(rsmi_dev_name_get, processor_handle, board_info->product_name, AMDSMI_256_LENGTH); + // Check if the value is in hex format + if (status == AMDSMI_STATUS_SUCCESS) { + if (board_info->product_name[0] == '0' && board_info->product_name[1] == 'x') { + memset(board_info->product_name, 0, + AMDSMI_256_LENGTH * sizeof(board_info->product_name[0])); + } + } if (status != AMDSMI_STATUS_SUCCESS) { memset(board_info->product_name, 0, AMDSMI_256_LENGTH * sizeof(board_info->product_name[0]));