intel / intel/compute-runtime

[GSD-11595] "zello_sysman.cpp" build fails with mystery errors, does not check for required spec version

Open
#626 6 comments 0 reactions 0 assignees View on GitHub
Component: Level Zero Sysman Status: Backlog Type: Bug
Dominant language
C++
Stars
1.4k
Forks
300
PR merge metrics
No merged PRs in 30d

Description

While latest release version (23.05.25593.9) works fine, building Git head version of `zello_sysman`:
`g++ -O2 -Wall -o zello_sysman zello_sysman.cpp -lze_loader -locloc`

Fails to following mystery errors:
```
zello_sysman.cpp: In function 'void getSysmanDeviceHandles(_ze_driver_handle_t*&, std::vector<_ze_device_handle_t*>&)':
zello_sysman.cpp:166:18: error: 'zesInit' was not declared in this scope; did you mean 'zeInit'?
166 | VALIDATECALL(zesInit(0));
| ^~~~~~~
zello_sysman.cpp:94:25: note: in definition of macro 'VALIDATECALL'
94 | ze_result_t r = myZeCall; \
| ^~~~~~~~
zello_sysman.cpp:169:18: error: 'zesDriverGet' was not declared in this scope; did you mean 'zeDriverGet'?
169 | VALIDATECALL(zesDriverGet(&driverCount, nullptr));
| ^~~~~~~~~~~~
zello_sysman.cpp:94:25: note: in definition of macro 'VALIDATECALL'
94 | ze_result_t r = myZeCall; \
| ^~~~~~~~
zello_sysman.cpp:174:18: error: 'zesDriverGet' was not declared in this scope; did you mean 'zeDriverGet'?
174 | VALIDATECALL(zesDriverGet(&driverCount, &sysmanDriverHandle));
| ^~~~~~~~~~~~
zello_sysman.cpp:94:25: note: in definition of macro 'VALIDATECALL'
94 | ze_result_t r = myZeCall; \
| ^~~~~~~~
zello_sysman.cpp:177:18: error: 'zesDeviceGet' was not declared in this scope; did you mean 'zeDeviceGet'?
177 | VALIDATECALL(zesDeviceGet(sysmanDriverHandle, &deviceCount, nullptr));
| ^~~~~~~~~~~~
zello_sysman.cpp:94:25: note: in definition of macro 'VALIDATECALL'
94 | ze_result_t r = myZeCall; \
| ^~~~~~~~
zello_sysman.cpp:183:18: error: 'zesDeviceGet' was not declared in this scope; did you mean 'zeDeviceGet'?
183 | VALIDATECALL(zesDeviceGet(sysmanDriverHandle, &deviceCount, sysmanDevices.data()));
| ^~~~~~~~~~~~
zello_sysman.cpp:94:25: note: in definition of macro 'VALIDATECALL'
94 | ze_result_t r = myZeCall; \
| ^~~~~~~~
zello_sysman.cpp: In function 'void testSysmanFabricPort(_ze_device_handle_t*&)':
zello_sysman.cpp:1147:9: error: 'zes_fabric_port_error_counters_t' was not declared in this scope; did you mean 'zes_fabric_port_throughput_t'?
1147 | zes_fabric_port_error_counters_t fabricPortErrorCounters = {};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| zes_fabric_port_throughput_t
zello_sysman.cpp:1197:67: error: 'fabricPortErrorCounters' was not declared in this scope
1197 | VALIDATECALL(zesFabricPortGetFabricErrorCounters(handle, &fabricPortErrorCounters));
| ^~~~~~~~~~~~~~~~~~~~~~~
zello_sysman.cpp:94:25: note: in definition of macro 'VALIDATECALL'
94 | ze_result_t r = myZeCall; \
| ^~~~~~~~
zello_sysman.cpp:1197:22: error: 'zesFabricPortGetFabricErrorCounters' was not declared in this scope
1197 | VALIDATECALL(zesFabricPortGetFabricErrorCounters(handle, &fabricPortErrorCounters));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
zello_sysman.cpp:94:25: note: in definition of macro 'VALIDATECALL'
94 | ze_result_t r = myZeCall; \
| ^~~~~~~~
zello_sysman.cpp:1199:48: error: 'fabricPortErrorCounters' was not declared in this scope
1199 | std::cout << "Link Failures = " << fabricPortErrorCounters.linkFailureCount << std::endl;
| ^~~~~~~~~~~~~~~~~~~~~~~
```

Note: as this is very useful tool for testing Sysman implementation, I'm building it against release version of L0, not against Git head version. Others can do the same, as this tool has been mentioned in different public Sysman related tickets (not in just this project).

EDIT: therefore it should check that available L0 header is new enough and show understandable error if not, like this:
```
#if ZE_API_VERSION_CURRENT < ZE_MAKE_VERSION( 1, 13 )
# error "zello_sysman.cpp requires L0 API >= v1.13"
#endif
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.