[PATCH] D153725: [clang] Make amdgpu-arch tool work on Windows

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 10 04:32:55 PDT 2023


JonChesterfield added a comment.

In D153725#4484747 <https://reviews.llvm.org/D153725#4484747>, @arsenm wrote:

> In D153725#4484711 <https://reviews.llvm.org/D153725#4484711>, @JonChesterfield wrote:
>
>> The right thing to do on Linux for this is to query the driver directly. That is, the kernel should populate some string under /sys that we read. That isn't yet implemented.
>
> It should definitely not do that. That's what this redundant thing does <https://github.com/RadeonOpenCompute/llvm-project/tree/amd-stg-open/llvm/lib/OffloadArch> . The kernel doesn't know the names of these devices. The kernel knows different names that map to PCI ids that are not the same as the gfx numbers. The compiler should not be responsible for maintaining yet another name mapping table and should go through a real API

There's a lot of pcie to gfx906 style tables lying around already. There used to be one in roct, last time I looked people wanted to move that to somewhere else. I don't really want to copy/paste it.

The problem with using the proper API via HSA or similar is twofold:

- we use this tool to enable tests, which means HSA has to exist before building clang or the tests don't run and HSA now requires clang to build
- if you open the driver too many times at once it fails to open, so running a parallel build that uses this tool doesn't work on fast machines


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153725/new/

https://reviews.llvm.org/D153725



More information about the cfe-commits mailing list