hipErrorNoBinaryForGpu, but reversed
Labels: module: rocm, triaged

### 🐛 Describe the bug

When running a self-Compiled PyTorch on an AMD 6800XT, I get this error:
>>> import torch
>>> print(torch.cuda.is_available())
:3:rocdevice.cpp            :416 : 11110111952 us: 215481: [tid:0x7f945a871740] Initializing HSA stack.
:3:comgrctx.cpp             :33  : 11110122738 us: 215481: [tid:0x7f945a871740] Loading COMGR library.
:3:rocdevice.cpp            :205 : 11110122781 us: 215481: [tid:0x7f945a871740] Numa selects cpu agent[0]=0x55cb99239340(fine=0x55cb9acc7a30,coarse=0x55cb9ad5e1a0) for gpu agent=0x55cb9ad5eb10
:3:rocdevice.cpp            :1610: 11110122915 us: 215481: [tid:0x7f945a871740] HMM support: 1, xnack: 0, direct host access: 0
:4:rocdevice.cpp            :1918: 11110122931 us: 215481: [tid:0x7f945a871740] Allocate hsa host memory 0x7f942d59a000, size 0x28
:4:rocdevice.cpp            :1918: 11110123072 us: 215481: [tid:0x7f945a871740] Allocate hsa host memory 0x7f915d600000, size 0x101000
:4:rocdevice.cpp            :1918: 11110123214 us: 215481: [tid:0x7f945a871740] Allocate hsa host memory 0x7f915d400000, size 0x101000
:4:rocdevice.cpp            :2054: 11110123253 us: 215481: [tid:0x7f945a871740] Allocate hsa device memory 0x7f915d000000, size 0x100000
:4:runtime.cpp              :83  : 11110123255 us: 215481: [tid:0x7f945a871740] init
:3:hip_context.cpp          :50  : 11110123257 us: 215481: [tid:0x7f945a871740] Direct Dispatch: 1
:1:hip_code_object.cpp      :459 : 11110123371 us: 215481: [tid:0x7f945a871740] hipErrorNoBinaryForGpu: Unable to find code object for all current devices!
:1:hip_code_object.cpp      :461 : 11110123374 us: 215481: [tid:0x7f945a871740]   Devices:
:1:hip_code_object.cpp      :463 : 11110123377 us: 215481: [tid:0x7f945a871740]     amdgcn-amd-amdhsa--gfx1030 - [Not Found]
:1:hip_code_object.cpp      :468 : 11110123379 us: 215481: [tid:0x7f945a871740]   Bundled Code Objects:
:1:hip_code_object.cpp      :485 : 11110123380 us: 215481: [tid:0x7f945a871740]     host-x86_64-unknown-linux - [Unsupported]
:1:hip_code_object.cpp      :482 : 11110123383 us: 215481: [tid:0x7f945a871740]     hipv4-amdgcn-amd-amdhsa--gfx803 - [code object v4 is amdgcn-amd-amdhsa--gfx803]
"hipErrorNoBinaryForGpu: Unable to find code object for all current devices!"

The opposite error has been documented, but I see nowhere this one being mentioned. This does NOT happen using the official Wheel, which works fine. Only when I self compile it.
I have made sure my compilation folder does not mention gfx803 in any text file, only gfx1030. 
I needed to apply rocBLAS patch from AUR to compile this.
I am using Arch Linux, with arch4edu repos.

### Versions

This is using the wheel, as this crashes on my compiled version.
Collecting environment information...
PyTorch version: 1.12.1+rocm5.1.1
Is debug build: False
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: 5.1.20531-cacfa990

OS: Arch Linux (x86_64)
GCC version: (GCC) 11.3.0
Clang version: 14.0.6
CMake version: version 3.24.1
Libc version: glibc-2.36

Python version: 3.10.6 (main, Aug  3 2022, 17:39:45) [GCC 12.1.1 20220730] (64-bit runtime)
Python platform: Linux-5.19.1-arch2-1-x86_64-with-glibc2.36
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration: AMD Radeon RX 6800 XT
Nvidia driver version: Could not collect
cuDNN version: Could not collect
HIP runtime version: 5.1.20531
MIOpen runtime version: 2.16.0
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.22.4
[pip3] pytorch-benchmark==0.3.4
[pip3] torch==1.12.1+rocm5.1.1
[pip3] torchaudio==0.12.1+rocm5.1.1
[pip3] torchvision==0.13.1+rocm5.1.1
[conda] Could not collect

cc @jeffdaily @sunway513 @jithunnair-amd @ROCmSupport @KyleCZH