Merge amd-staging into amd-master 20240118

Signed-off-by: guanyu12 <guanyu12@amd.com>
Change-Id: I22971ade4774319930cb0a9bced2e3c3d7e91265
Esse commit está contido em:
guanyu12
2024-01-18 10:29:57 +08:00
19 arquivos alterados com 87 adições e 27 exclusões
+1 -1
Ver Arquivo
@@ -6,7 +6,7 @@
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/docs/.sphinx" # Location of package manifests
directory: "/docs/sphinx" # Location of package manifests
open-pull-requests-limit: 10
schedule:
interval: "daily"
+2 -3
Ver Arquivo
@@ -10,12 +10,11 @@ formats: [htmlzip, pdf, epub]
python:
install:
- requirements: docs/.sphinx/requirements.txt
- requirements: docs/sphinx/requirements.txt
build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.8"
apt_packages:
- "doxygen"
- "graphviz" # For dot graphs in doxygen
+5 -1
Ver Arquivo
@@ -1,21 +1,25 @@
# Change Log for ROCm SMI Library
Full documentation for rocm_smi_lib is available at [https://docs.amd.com/](https://docs.amd.com/category/SMI%20API%20Guides).
Full documentation for rocm_smi_lib is available at [https://docs.amd.com/](https://rocm.docs.amd.com/projects/rocm_smi_lib/en/latest/).
## rocm_smi_lib for ROCm 5.5.0
### Optimizations
- Add new test to measure api execution time.
- Remove the shared mutex if no process is using it.
### Added
- ROCm SMI CLI: Add --showtempgraph Feature.
### Changed
- Relying on vendor ID to detect AMDGPU.
- Change pragma message to warning for backward compatibility.
### Fixed
- Fix --showproductname when device's SKU cannot be parsed out of the VBIOS string.
- Fix compile error: memcpy was not declared.
- Fix order of CE and UE reporting in ROCm SMI CLI.
+1 -1
Ver Arquivo
@@ -51,7 +51,7 @@ The following is an example of how to build the docs:
```shell
python3 -m venv .venv
.venv/bin/python3 -m pip install -r docs/.sphinx/requirements.txt
.venv/bin/python3 -m pip install -r docs/sphinx/requirements.txt
.venv/bin/python3 -m sphinx -T -E -b html -d docs/_build/doctrees -D language=en docs docs/_build/html
```
-1
Ver Arquivo
@@ -1 +0,0 @@
docBin/
-7
Ver Arquivo
@@ -1,7 +0,0 @@
defaults:
numbered: False
maxdepth: 6
root: index
subtrees:
- entries:
- file: .doxygen/docBin/html/index
-1
Ver Arquivo
@@ -1 +0,0 @@
rocm-docs-core[api_reference]==0.26.0
+22 -2
Ver Arquivo
@@ -4,12 +4,32 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import re
from rocm_docs import ROCmDocs
docs_core = ROCmDocs("ROCm SMI LIB")
docs_core.run_doxygen(doxygen_root='.doxygen', doxygen_path='.')
with open('../CMakeLists.txt', encoding='utf-8') as f:
match = re.search(r'get_package_version_number\(\"?([0-9.]+)[^0-9.]+', f.read())
if not match:
raise ValueError("VERSION not found!")
version_number = match[1]
left_nav_title = f"ROCm SMI LIB {version_number} Documentation"
# for PDF output on Read the Docs
project = "ROCm SMI LIB Documentation"
author = "Advanced Micro Devices, Inc."
copyright = "Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved."
version = version_number
release = version_number
external_toc_path = "./sphinx/_toc.yml"
docs_core = ROCmDocs(left_nav_title)
docs_core.run_doxygen(doxygen_root="doxygen", doxygen_path="doxygen/xml")
docs_core.enable_api_reference()
docs_core.setup()
external_projects_current_project = "rocm_smi_lib"
for sphinx_var in ROCmDocs.SPHINX_VARS:
globals()[sphinx_var] = getattr(docs_core, sphinx_var)
+2
Ver Arquivo
@@ -0,0 +1,2 @@
html/
xml/
@@ -68,7 +68,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = docBin
OUTPUT_DIRECTORY = .
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
# sub-directories (in 2 levels) under the output directory of each output format
@@ -1839,7 +1839,7 @@ EXTRA_SEARCH_MAPPINGS =
# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = YES
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
@@ -2124,7 +2124,7 @@ MAN_LINKS = NO
# captures the structure of the code including all documentation.
# The default value is: NO.
GENERATE_XML = NO
GENERATE_XML = YES
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+4
Ver Arquivo
@@ -0,0 +1,4 @@
# License
```{include} ../License.txt
```
Arquivo executável → Arquivo normal
+6 -2
Ver Arquivo
@@ -5,5 +5,9 @@ defaults:
maxdepth: 6
root: index
subtrees:
- entries:
- file: .doxygen/docBin/html/index
- caption: API
entries:
- file: doxygen/html/index
- caption: About
entries:
- file: license
+1
Ver Arquivo
@@ -0,0 +1 @@
rocm-docs-core[api_reference]>=0.30.3
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile requirements.in
@@ -105,6 +105,8 @@ pynacl==1.5.0
# via pygithub
pyparsing==3.0.9
# via doxysphinx
pytz==2023.3.post1
# via babel
pyyaml==6.0
# via
# myst-parser
@@ -114,7 +116,7 @@ requests==2.28.2
# via
# pygithub
# sphinx
rocm-docs-core[api_reference]==0.26.0
rocm-docs-core[api_reference]>=0.30.3
# via -r requirements.in
smmap==5.0.0
# via gitdb
@@ -159,7 +161,11 @@ tqdm==4.66.1
# via mpire
typing-extensions==4.5.0
# via pydata-sphinx-theme
urllib3==2.0.3
urllib3==1.26.18
# via requests
wrapt==1.15.0
# via deprecated
zipp==3.17.0
# via
# importlib-metadata
# importlib-resources
+4
Ver Arquivo
@@ -277,6 +277,10 @@ class ScopedAcquire {
DISALLOW_COPY_AND_ASSIGN(ScopedAcquire)
};
// The best effort way to decide whether it is in VM guest environment:
// In VM environment, the /proc/cpuinfo set hypervisor flag by default
bool is_vm_guest();
} // namespace smi
} // namespace amd
+2 -2
Ver Arquivo
@@ -697,7 +697,7 @@ int Device::readDevInfoStr(DevInfoTypes type, std::string *retStr) {
<< " | " << (fs.fail() ? "[ERROR] Failed read - format error" :
"[GOOD] No fail - Successful read operation")
<< " | " << (fs.eof() ? "[ERROR] Failed read - EOF error" :
"[GOOD] No eof error - Successful read operation")
"[GOOD] No eof - Successful read operation")
<< " | " << (fs.good() ? "[GOOD] read good - Successful read operation" :
"[ERROR] Failed read - good error");
LOG_INFO(ss);
@@ -759,7 +759,7 @@ int Device::writeDevInfoStr(DevInfoTypes type, std::string valStr,
<< " | " << (fs.fail() ? "[ERROR] Failed write - format error" :
"[GOOD] No fail - Successful write operation")
<< " | " << (fs.eof() ? "[ERROR] Failed write - EOF error" :
"[GOOD] No eof error - Successful write operation")
"[GOOD] No eof - Successful write operation")
<< " | " << (fs.good() ?
"[GOOD] Write good - Successful write operation" :
"[ERROR] Failed write - good error");
+19
Ver Arquivo
@@ -329,6 +329,25 @@ rsmi_status_t ErrnoToRsmiStatus(int err) {
}
}
bool is_vm_guest() {
// the cpuinfo will set hypervisor flag in VM guest
const std::string hypervisor = "hypervisor";
std::string line;
// default to false if cannot find the file
std::ifstream infile("/proc/cpuinfo");
if (infile.fail()) {
return false;
}
while (std::getline(infile, line)) {
if (line.find(hypervisor) != std::string::npos) {
return true;
}
}
return false;
}
std::string leftTrim(const std::string &s) {
if (!s.empty()) {
return std::regex_replace(s, std::regex("^\\s+"), "");
@@ -54,6 +54,7 @@
#include "gtest/gtest.h"
#include "rocm_smi/rocm_smi.h"
#include "rocm_smi_test/functional/power_cap_read_write.h"
#include "rocm_smi/rocm_smi_utils.h"
#include "rocm_smi_test/test_common.h"
@@ -121,6 +122,11 @@ void TestPowerCapReadWrite::Run(void) {
continue;
}
if (amd::smi::is_vm_guest()) {
std::cout << "VM guest is not supported for power cap test. Skipping test for " << dv_ind << std::endl;
continue;
}
new_cap = (max + min)/2;
IF_VERB(STANDARD) {