Skip to content

Commit c947b46

Browse files
Don't fail loader init due to missing getProcAddr symbols in driver
* Don't fail loader init due to missing getProcAddr symbols in driver Spec 1.5 added new proc addr tables for sysman. Init should not fail if a new proc addr table symbol is missing Signed-off-by: Brandon Yates <[email protected]> Co-authored-by: Lisanna <[email protected]>
1 parent 50101c8 commit c947b46

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/build
2+
/scripts/__pycache__/
3+
/scripts/templates/__pycache__/

scripts/templates/helper.py

+8
Original file line numberDiff line numberDiff line change
@@ -1763,3 +1763,11 @@ def get_loader_epilogue(namespace, tags, obj, meta):
17631763
})
17641764

17651765
return epilogue
1766+
1767+
"""
1768+
Public:
1769+
returns true if proc table is added after 1.0
1770+
"""
1771+
def isNewProcTable(tableName):
1772+
1773+
return tableName in ["zesGetGlobalProcAddrTable","zesGetOverclockProcAddrTable"]

scripts/templates/ldrddi.cpp.mako

+8
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,15 @@ ${tbl['export']['name']}(
277277
auto getTable = reinterpret_cast<${tbl['pfn']}>(
278278
GET_FUNCTION_PTR( drv.handle, "${tbl['export']['name']}") );
279279
if(!getTable)
280+
%if th.isNewProcTable(tbl['export']['name']) is True:
281+
{
282+
atLeastOneDriverValid = true;
283+
//It is valid to not have this proc addr table
284+
continue;
285+
}
286+
%else:
280287
continue;
288+
%endif
281289
auto getTableResult = getTable( version, &drv.dditable.${n}.${tbl['name']});
282290
if(getTableResult == ZE_RESULT_SUCCESS)
283291
atLeastOneDriverValid = true;

source/loader/zes_ldrddi.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -3846,7 +3846,11 @@ zesGetGlobalProcAddrTable(
38463846
auto getTable = reinterpret_cast<zes_pfnGetGlobalProcAddrTable_t>(
38473847
GET_FUNCTION_PTR( drv.handle, "zesGetGlobalProcAddrTable") );
38483848
if(!getTable)
3849+
{
3850+
atLeastOneDriverValid = true;
3851+
//It is valid to not have this proc addr table
38493852
continue;
3853+
}
38503854
auto getTableResult = getTable( version, &drv.dditable.zes.Global);
38513855
if(getTableResult == ZE_RESULT_SUCCESS)
38523856
atLeastOneDriverValid = true;
@@ -4744,7 +4748,11 @@ zesGetOverclockProcAddrTable(
47444748
auto getTable = reinterpret_cast<zes_pfnGetOverclockProcAddrTable_t>(
47454749
GET_FUNCTION_PTR( drv.handle, "zesGetOverclockProcAddrTable") );
47464750
if(!getTable)
4751+
{
4752+
atLeastOneDriverValid = true;
4753+
//It is valid to not have this proc addr table
47474754
continue;
4755+
}
47484756
auto getTableResult = getTable( version, &drv.dditable.zes.Overclock);
47494757
if(getTableResult == ZE_RESULT_SUCCESS)
47504758
atLeastOneDriverValid = true;

0 commit comments

Comments
 (0)