question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatically infer HCC_AMDGPU_TARGET

See original GitHub issue
  • build: Support CUPY_NVCC_GENERATE_CODE=current equivalent in ROCm to set HCC_AMDGPU_TARGET automatically
  • runtime: Automatically infer HCC_AMDGPU_TARGET (this environment variable is only needed for hipcc case?)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
kmaehashicommented, Feb 25, 2021

I skimmed hipcc code (it’s written in perl 😅 ), it seems the output from /opt/rocm/bin/rocm_agent_enumerator -t GPU (which prints arch for each GPU installed) is used when HCC_AMDGPU_TARGET is unset. I’m curious how hiprtc would behave, though.

1reaction
leofangcommented, Feb 23, 2021
  • build: Support CUPY_NVCC_GENERATE_CODE=current equivalent in ROCm to set HCC_AMDGPU_TARGET automatically

I just did a quick test locally. It seems if only building for local use, as mentioned in the above linked comment hipcc can also infer HCC_AMDGPU_TARGET correctly. I confirmed this by removing the cub and thrust modules, unset both HCC_AMDGPU_TARGET and __HIP_PLATFORM_HCC__, and rebuild. It builds just fine.

After that, we can examine the binary by ROCm’s built-in tool (similar to cuobjdump on CUDA):

$ extractkernel -i cupy/cuda/thrust.cpython-37m-x86_64-linux-gnu.so

which generates three files, two of which are for my arch (gfx906):

$ cd cupy/cuda; ls -lh thrust.cp*
-rw-rw-r-- 1 leofang leofang 328K Feb 23 16:16 thrust.cpp
-rwxrwxr-x 1 leofang leofang 7.6M Feb 23 16:19 thrust.cpython-37m-x86_64-linux-gnu.so
-rw-rw-r-- 1 leofang leofang 6.2M Feb 23 16:20 thrust.cpython-37m-x86_64-linux-gnu.so-000.bundle
-rw-rw-r-- 1 leofang leofang 6.2M Feb 23 16:20 thrust.cpython-37m-x86_64-linux-gnu.so-000-gfx906.hsaco
-rw-rw-r-- 1 leofang leofang  73M Feb 23 16:20 thrust.cpython-37m-x86_64-linux-gnu.so-000-gfx906.isa

Could be relevant to #4720.

Read more comments on GitHub >

github_iconTop Results From Across the Web

New Features of C++: Automatic Type Inference
Automatic type inference (or type deduction) is where you allow the compiler to infer the type information used for a declaration by ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found