-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Suggestion Description
This code uses rocm_agent_enumerator
on Linux:
llvm-project/amd/hipcc/src/hipBin_amd.h
Lines 778 to 796 in 4e3aee9
// No AMDGPU target specified at commandline. So look for HCC_AMDGPU_TARGET | |
if (default_amdgpu_target == 1) { | |
if (!var.hccAmdGpuTargetEnv_.empty()) { | |
targetsStr = var.hccAmdGpuTargetEnv_; | |
} else if (os != windows) { | |
// Else try using rocm_agent_enumerator | |
string ROCM_AGENT_ENUM; | |
ROCM_AGENT_ENUM = roccmPath + "/bin/rocm_agent_enumerator"; | |
targetsStr = ROCM_AGENT_ENUM +" -t GPU"; | |
SystemCmdOut sysOut = hipBinUtilPtr_->exec(targetsStr.c_str()); | |
regex toReplace("\n+"); | |
targetsStr = hipBinUtilPtr_->replaceRegex(sysOut.out, toReplace, ","); | |
} | |
default_amdgpu_target = 0; | |
} | |
// Parse the targets collected in targetStr | |
// and set corresponding compiler options. | |
vector<string> targets = hipcc::utils::splitStr(targetsStr, ','); | |
string GPU_ARCH_OPT = " --offload-arch="; |
Windows currently has hipInfo.exe
(which is similar to rocminfo
). Windows and Linux have amdgpu-arch
. It seems like hipcc
could try using amdgpu-arch
? I'm also wondering if we would want to provide rocm_agent_enumerator
on Windows too, and why we have both that and amdgpu-arch
.
Context: ROCm/TheRock#1571. We had a test running on Linux and Windows that omitted --offload-arch
. This was passing on Linux but silently failing on Windows, until ROCm/rocm-systems@e79eaaa turned the silent failure into a crash. That PR changes the test to explicitly pass --offload-arch
on both platforms using amdgpu-arch
to look up the gfx target.
Operating System
Windows
GPU
N/A
ROCm Component
hipcc