Skip to content

Commit

Permalink
2022.4 (#7)
Browse files Browse the repository at this point in the history
* 2022.4

* up
  • Loading branch information
amakarev authored Sep 29, 2023
1 parent c59e13d commit 2d774c5
Show file tree
Hide file tree
Showing 97 changed files with 4,030 additions and 3,345 deletions.
3 changes: 1 addition & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ omit =
*/.local/*
/usr/*
*/test_*
checkers_py/intel_gpu_detector_checker.py
checkers_py/oneapi_gpu_checker.py
# FIXME: Will be enabled later
modules/db_downloader.py

source =
Expand Down
9 changes: 2 additions & 7 deletions HOW_TO_BUILD_THE_PROJECT-Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@
# Documentation
$ sudo apt install doxygen graphviz sphinx-common
```

Please note that the required package is named "libsqlite3-dev" on Ubuntu,
but it may have a different name if you are using another OS: on
SLES/SuSE system the package name is sqlite3-devel, on RHEL the package
name is sqlite-libs.x86_64, and on RedHat the package name is
libsqlite3x-devel.
Please note: Version of CMake should be 3.11.x or greater

2. Install GPGPU level-zero API (instructions derived from [Installation Guide](https://dgpu-docs.intel.com/installation-guides/index.html)):

Expand Down Expand Up @@ -89,7 +84,7 @@ $ make install
```bash
$ cd .../diagnostics-utility
$ ./diagnostics.py --help
usage: diagnostics.py [--filter FILTER [FILTER ...]] [-l] [-c PATH_TO_CONFIG] [-o PATH_TO_OUTPUT | -t] [-s | -u] [-p PATH [PATH ...]] [--force] [-v] [-V] [-h]
usage: diagnostics.py [--select SELECTION [SELECTION ...]] [-l] [-c PATH_TO_CONFIG] [-o PATH_TO_OUTPUT | -t] [-u] [-p PATH [PATH ...]] [--force] [-v] [-V] [-h]
Diagnostics Utility for Intel® oneAPI Toolkits is a tool designed to diagnose the system status for using Intel® software.
...
Expand Down
4 changes: 2 additions & 2 deletions HOW_TO_BUILD_THE_PROJECT-Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ PS> cmake --build . --target INSTALL --config Release
👉 The application should be available to test in the root directory:

```powershell
PS> cd .../diagnostics-utility
PS> cd ...\diagnostics-utility
PS> python diagnostics.py --help
usage: diagnostics.py [--filter FILTER [FILTER ...]] [-l] [-c PATH_TO_CONFIG] [-o PATH_TO_OUTPUT | -t] [-s | -u] [-p PATH [PATH ...]] [--force] [-v] [-V] [-h]
usage: diagnostics.py [--select SELECTION [SELECTION ...]] [-l] [-c PATH_TO_CONFIG] [-o PATH_TO_OUTPUT | -t] [-u] [-p PATH [PATH ...]] [--force] [-v] [-V] [-h]
Diagnostics Utility for Intel® oneAPI Toolkits is a tool designed to diagnose the system status for using Intel® software.
...
Expand Down
32 changes: 16 additions & 16 deletions HOW_TO_WRITE_CHECKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ system for its intended purpose (host, target):

| Field | Description |
|:----------------|:------------|
| `RetVal`\* | Status of performed check (`PASS`, `FAIL`, `INFO`, `WARNING`, or `ERROR`).|
| `Value`\* | Information obtained as a result of the check. Nested checks are listed in this field.|
| `CheckStatus`\* | Status of performed check (`PASS`, `FAIL`, `INFO`, `WARNING`, or `ERROR`).|
| `CheckResult`\* | Information obtained as a result of the check. Nested checks are listed in this field.|
| `Message` | Important information for a user. In general, this is information about an error or failure.|
| `Command` | Command line or a description of how the information was obtained for verification or display.|
| `HowToFix` | Suggestion on how to fix the problem. Use when the check has completed with a problem that has a distinct prescription to fix.|
Expand All @@ -70,22 +70,22 @@ Consult the [`README`](README.md) documentation for more information on:

Example:

A check tree with one level of hierarchy (created by the `Value` field) could
A check tree with one level of hierarchy (created by the `CheckResult` field) could
look like this:

```json
{
"Value": {
"CheckResult": {
"name_of_check": {
"RetVal": "PASS",
"CheckStatus": "PASS",
"Verbosity": 0,
"Message": "Some message",
"Value": {
"CheckResult": {
"name_of_sub_check": {
"RetVal": "PASS",
"CheckStatus": "PASS",
"Verbosity": 0,
"Message": "Some message",
"Value": "Received value"
"CheckResult": "Received value"
}
}
}
Expand All @@ -103,7 +103,7 @@ A shell script-based checker should implement three command line options:
{
"name": "name_of_check_without_spaces",
"type": "",
"tags": "tag1,tag2,tag3",
"groups": "group1,group2,group3",
"descr": "Description of check",
"dataReq": "{}",
"merit": 0,
Expand All @@ -117,15 +117,15 @@ A shell script-based checker should implement three command line options:

```json
{
"result": "{}"
"result": {}
}
```

* `--get_api_version` option: this options simply returns the version of the
implemented API:

```txt
0.1
0.2
```

| /!\ Warning |
Expand Down Expand Up @@ -155,7 +155,7 @@ struct CheckMetadata
{
char name[MAX_STRING_LEN];
char type[MAX_STRING_LEN];
char tags[MAX_STRING_LEN];
char groups[MAX_STRING_LEN];
char descr[MAX_STRING_LEN];
char dataReq[MAX_STRING_LEN];
int merit;
Expand Down Expand Up @@ -185,7 +185,7 @@ The `CheckMetadataPy` and `CheckSummary` classes, defined as:
class CheckMetadataPy:
name: str
type: str
tags: str
groups: str
descr: str
dataReq: str
merit: int
Expand Down Expand Up @@ -217,7 +217,7 @@ You can to run checks from the custom checker in two different ways:

| [i] Note |
|:---------|
|In this case, the utility will load all the checks from the given paths in addition to the checks loaded by default. The set of checks to run will be determined by the value passed to the `--filter` option. For more information about filtering checks, see [`README`](README.md). |
|In this case, the utility will load all the checks from the given paths in addition to the checks loaded by default. The set of checks to run will be determined by the value passed to the `--select` option. For more information about selecting checks, see [`README`](README.md). |

## Run Example Checks

Expand All @@ -240,11 +240,11 @@ Run example checks:
* Run checks for all examples:

```bash
./diagnostics.py --filter example
./diagnostics.py --select example
```

* Run check by check name:

```bash
./diagnostics.py --filter example_c_check
./diagnostics.py --select example_c_check
```
17 changes: 17 additions & 0 deletions checkers_c/linux/gpu_backend_checker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,20 @@ if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")

install(TARGETS ${CHECKERS_EXE_NAME} DESTINATION ${SOURCES_INSTALL_PREFIX}/checkers_c)
endif()

if(BUILD_TESTS)
add_executable(test_gpu_backend_checker
tests/test_gpu_backend_checker.cpp
)
target_include_directories(test_gpu_backend_checker PRIVATE ../../../include)
target_include_directories(test_gpu_backend_checker PRIVATE include)
target_link_libraries(test_gpu_backend_checker PRIVATE
gtest
gtest_main
gmock
gmock_main
${CHECKERS_LIB_NAME}
)
gtest_discover_tests(test_gpu_backend_checker)
install(TARGETS test_gpu_backend_checker DESTINATION ${SOURCES_INSTALL_PREFIX}/tests/unittests)
endif()
16 changes: 8 additions & 8 deletions checkers_c/linux/gpu_backend_checker/include/CLDriverChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ class CL_DriverChecker {
CL_DriverChecker();
virtual ~CL_DriverChecker();

static bool Load(string &message);
static void GetDriverInfo(string& message);
static void GetDeviceInfo(cl_device_id deviceId, string& message);
virtual bool Load(string &message);
virtual void GetDriverInfo(string& message);
virtual void GetDeviceInfo(cl_device_id deviceId, string& message);

static string GetErrorMessage(cl_int error);
static string GetDeviceTypeString(cl_device_type type);
virtual string GetErrorMessage(cl_int error);
virtual string GetDeviceTypeString(cl_device_type type);
// Represent array as a comma separated string
static string GetArrayString(size_t* array, size_t array_size);
static string GetCacheTypeString(cl_device_mem_cache_type type);
static string GetLocalMemTypeString(cl_device_local_mem_type type);
virtual string GetArrayString(size_t* array, size_t array_size);
virtual string GetCacheTypeString(cl_device_mem_cache_type type);
virtual string GetLocalMemTypeString(cl_device_local_mem_type type);
};

#endif /* CLDRIVERCHECKER_H_ */
20 changes: 10 additions & 10 deletions checkers_c/linux/gpu_backend_checker/include/JsonNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ class JsonNode {
JsonNode();
virtual ~JsonNode();

static void AddJsonTopNode(json_object* parent, json_object * value);
static void AddJsonNode(json_object* parent, string name, string retVal, string message, string command, uint32_t verbosity, json_object * value);
static void AddJsonNode(json_object* parent, string name, string retVal, string message, string command, uint32_t verbosity, string value);
static void AddJsonNode(json_object* parent, string name, string retVal, string message, string command, uint32_t verbosity, uint32_t value);
static void AddJsonNode(json_object* parent, string name, string retVal, uint32_t verbosity, json_object * value);
static void AddJsonNode(json_object* parent, string name, string retVal, uint32_t verbosity, string value);
static void AddJsonNode(json_object* parent, string name, string retVal, uint32_t verbosity, uint32_t value);
static void AddJsonNode(json_object* parent, string name, string retVal, json_object * value);
static void AddJsonNode(json_object* parent, string name, string retVal, string value);
static void AddJsonNode(json_object* parent, string name, string retVal, uint32_t value);
static void AddJsonTopNode(json_object* parent, json_object * check_result);
static void AddJsonNode(json_object* parent, string name, string check_status, string message, string command, uint32_t verbosity, json_object * check_result);
static void AddJsonNode(json_object* parent, string name, string check_status, string message, string command, uint32_t verbosity, string check_result);
static void AddJsonNode(json_object* parent, string name, string check_status, string message, string command, uint32_t verbosity, uint32_t check_result);
static void AddJsonNode(json_object* parent, string name, string check_status, uint32_t verbosity, json_object * check_result);
static void AddJsonNode(json_object* parent, string name, string check_status, uint32_t verbosity, string check_result);
static void AddJsonNode(json_object* parent, string name, string check_status, uint32_t verbosity, uint32_t check_result);
static void AddJsonNode(json_object* parent, string name, string check_status, json_object * check_result);
static void AddJsonNode(json_object* parent, string name, string check_status, string check_result);
static void AddJsonNode(json_object* parent, string name, string check_status, uint32_t check_result);

static bool ParseFile(string name, json_object** root, string message);
static json_object* GetObject(json_object* root, const string path);
Expand Down
24 changes: 12 additions & 12 deletions checkers_c/linux/gpu_backend_checker/include/LZDriverChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ class LZ_DriverChecker {
LZ_DriverChecker();
virtual ~LZ_DriverChecker();

static bool Load(string& message);
static bool Initialize(string& message);
static bool GetLoaderVersion(string& message);
static void GetDriverInfo(string& message);
static void GetDeviceInfo(ze_driver_handle_t driver, string& message);

static string GetErrorMessage(ze_result_t error);
static string GetAPIVersionString(_ze_api_version_t version);
static string GetDriverVersionString(uint32_t version);
static string GetUUIDString(ze_driver_uuid_t uuid);
static string GetUUIDString(ze_device_uuid_t uuid);
static string GetDeviceTypeString(ze_device_type_t type);
virtual bool Load(string& message);
virtual bool Initialize(string& message);
virtual bool GetLoaderVersion(string& message);
virtual void GetDriverInfo(string& message);
virtual void GetDeviceInfo(ze_driver_handle_t driver, string& message);

virtual string GetErrorMessage(ze_result_t error);
virtual string GetAPIVersionString(_ze_api_version_t version);
virtual string GetDriverVersionString(uint32_t version);
virtual string GetUUIDString(ze_driver_uuid_t uuid);
virtual string GetUUIDString(ze_device_uuid_t uuid);
virtual string GetDeviceTypeString(ze_device_type_t type);
};

#endif /* SRC_LZDRIVERCHECKER_H_ */
12 changes: 12 additions & 0 deletions checkers_c/linux/gpu_backend_checker/include/gpu_backend_checker.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,17 @@ other than those that are expressly stated in the License.

using namespace std;

class GpuBackendChecker {
private:
LZ_DriverChecker* lzDriverChecker;
CL_DriverChecker* clDriverChecker;

public:
GpuBackendChecker(LZ_DriverChecker* lzDriverChecker, CL_DriverChecker* clDriverChecker);
~GpuBackendChecker() = default;

int PerformCheck(string &message);
};


#endif /* GPU_BACKEND_CHECK_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ CL_DriverChecker::~CL_DriverChecker() {
// TODO Auto-generated destructor stub
}


bool CL_DriverChecker::Load(string& message) {
void *handle;
char *error;
Expand Down
46 changes: 23 additions & 23 deletions checkers_c/linux/gpu_backend_checker/src/JsonNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ JsonNode::~JsonNode() {
// TODO Auto-generated destructor stub
}

void JsonNode::AddJsonTopNode(json_object* parent, json_object * value ) {
json_object_object_add(parent, "Value", value);
void JsonNode::AddJsonTopNode(json_object* parent, json_object * check_result ) {
json_object_object_add(parent, "CheckResult", check_result);
}


void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, json_object * value ) {
JsonNode::AddJsonNode(parent, name, retVal, "", "", 0, value);
void JsonNode::AddJsonNode(json_object* parent, string name, string check_status, json_object * check_result ) {
JsonNode::AddJsonNode(parent, name, check_status, "", "", 0, check_result);
}

void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, uint32_t verbosity, json_object * value ) {
JsonNode::AddJsonNode(parent, name, retVal, "", "", verbosity, value);
void JsonNode::AddJsonNode(json_object* parent, string name, string check_status, uint32_t verbosity, json_object * check_result ) {
JsonNode::AddJsonNode(parent, name, check_status, "", "", verbosity, check_result);
}

void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, string message, string command, uint32_t verbosity, json_object * value ) {
void JsonNode::AddJsonNode(json_object* parent, string name, string check_status, string message, string command, uint32_t verbosity, json_object * check_result ) {
json_object *json_value = json_object_new_object();
json_object_object_add(parent, name.c_str(), json_value);
if (!message.empty())
Expand All @@ -42,20 +42,20 @@ void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, stri
json_object_object_add(json_value, "Command", json_object_new_string(command.c_str()));
if (verbosity)
json_object_object_add(json_value, "Verbosity", json_object_new_int(verbosity));
json_object_object_add(json_value, "RetVal", json_object_new_string(retVal.c_str()));
json_object_object_add(json_value, "Value", value);
json_object_object_add(json_value, "CheckStatus", json_object_new_string(check_status.c_str()));
json_object_object_add(json_value, "CheckResult", check_result);
}


void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, string value ) {
JsonNode::AddJsonNode (parent, name, retVal, "", "", 0, value);
void JsonNode::AddJsonNode(json_object* parent, string name, string check_status, string check_result ) {
JsonNode::AddJsonNode (parent, name, check_status, "", "", 0, check_result);
}

void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, uint32_t verbosity, string value ) {
JsonNode::AddJsonNode (parent, name, retVal, "", "", verbosity, value);
void JsonNode::AddJsonNode(json_object* parent, string name, string check_status, uint32_t verbosity, string check_result ) {
JsonNode::AddJsonNode (parent, name, check_status, "", "", verbosity, check_result);
}

void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, string message, string command, uint32_t verbosity, string value ) {
void JsonNode::AddJsonNode(json_object* parent, string name, string check_status, string message, string command, uint32_t verbosity, string check_result ) {
json_object *json_value = json_object_new_object();
json_object_object_add(parent, name.c_str(), json_value);
if (!message.empty())
Expand All @@ -64,20 +64,20 @@ void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, stri
json_object_object_add(json_value, "Command", json_object_new_string(command.c_str()));
if (verbosity)
json_object_object_add(json_value, "Verbosity", json_object_new_int(verbosity));
json_object_object_add(json_value, "RetVal", json_object_new_string(retVal.c_str()));
json_object_object_add(json_value, "Value", json_object_new_string(value.c_str()));
json_object_object_add(json_value, "CheckStatus", json_object_new_string(check_status.c_str()));
json_object_object_add(json_value, "CheckResult", json_object_new_string(check_result.c_str()));
}


void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, uint32_t value ) {
JsonNode::AddJsonNode(parent, name, retVal, "", "", 0, value);
void JsonNode::AddJsonNode(json_object* parent, string name, string check_status, uint32_t check_result ) {
JsonNode::AddJsonNode(parent, name, check_status, "", "", 0, check_result);
}

void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, uint32_t verbosity, uint32_t value ) {
JsonNode::AddJsonNode(parent, name, retVal, "", "", verbosity, value);
void JsonNode::AddJsonNode(json_object* parent, string name, string check_status, uint32_t verbosity, uint32_t check_result ) {
JsonNode::AddJsonNode(parent, name, check_status, "", "", verbosity, check_result);
}

void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, string message, string command, uint32_t verbosity, uint32_t value ) {
void JsonNode::AddJsonNode(json_object* parent, string name, string check_status, string message, string command, uint32_t verbosity, uint32_t check_result ) {
json_object *json_value = json_object_new_object();
json_object_object_add(parent, name.c_str(), json_value);
if (!message.empty())
Expand All @@ -86,8 +86,8 @@ void JsonNode::AddJsonNode(json_object* parent, string name, string retVal, stri
json_object_object_add(json_value, "Command", json_object_new_string(command.c_str()));
if (verbosity)
json_object_object_add(json_value, "Verbosity", json_object_new_int(verbosity));
json_object_object_add(json_value, "RetVal", json_object_new_string(retVal.c_str()));
json_object_object_add(json_value, "Value", json_object_new_int64(value)); // use int64 to prevent overflow because it accepts signed integer
json_object_object_add(json_value, "CheckStatus", json_object_new_string(check_status.c_str()));
json_object_object_add(json_value, "CheckResult", json_object_new_int64(check_result)); // use int64 to prevent overflow because it accepts signed integer

}

Expand Down
4 changes: 2 additions & 2 deletions checkers_c/linux/gpu_backend_checker/src/LZDriverChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ bool LZ_DriverChecker::GetLoaderVersion(string &message)
{
string out;
// Extract information about installed packages
int retval = CheckerHelper::RunCommand("dpkg --no-pager -l 'level-zero' 2>/dev/null | grep ii", out);
if (retval != 0) {
int exit_status = CheckerHelper::RunCommand("dpkg --no-pager -l 'level-zero' 2>/dev/null | grep ii", out);
if (exit_status != 0) {
message = "Level-zero package is not installed or not accessible.";
return false;
}
Expand Down
Loading

0 comments on commit 2d774c5

Please sign in to comment.