Skip to content

Commit 7a7eeec

Browse files
authored
SWDEV-389829 - Fix hipModule_--tests_0x2 failure on MI100 (#3283)
- gfx908 and gfx908:sramecc+:xnack- together cannot be passed as --offload-arch to hipcc - Strip features from gcnArchName before passing to hipcc
1 parent eebd3b6 commit 7a7eeec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/src/runtimeApi/module/hipModule.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ bool testMultiTargArchCodeObj() {
130130
char command[COMMAND_LEN];
131131
hipDeviceProp_t props;
132132
hipGetDeviceProperties(&props, 0);
133+
// Extract the base GPU arch name excluding any feature
134+
std::string arch = std::string(props.gcnArchName);
135+
auto pos = arch.find(":");
136+
if (pos != std::string::npos)
137+
arch = arch.substr(0, pos);
138+
133139
// Hardcoding the codeobject lines in multiple string to avoid cpplint warning
134140
std::string CodeObjL1 = "#include \"hip/hip_runtime.h\"\n";
135141
std::string CodeObjL2 =
@@ -162,7 +168,7 @@ bool testMultiTargArchCodeObj() {
162168
const char* input_codeobj = "/tmp/vcpy_kernel.cpp";
163169
snprintf(command, COMMAND_LEN,
164170
"unset HIP_PATH;%s --genco %s=gfx801,gfx802,gfx803,gfx900,gfx908,%s %s -o %s",
165-
hipcc_path, genco_option, props.gcnArchName, input_codeobj,
171+
hipcc_path, genco_option, arch.c_str(), input_codeobj,
166172
CODE_OBJ_MULTIARCH);
167173

168174
printf("command = %s\n", command);

0 commit comments

Comments
 (0)