[llvm] [Offload] Optimistically accept SM architectures (PR #142399)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 2 13:41:39 PDT 2025
================
@@ -75,8 +75,7 @@ checkMachineImpl(const object::ELFObjectFile<ELFT> &ELFObj, uint16_t EMachine) {
} else if (Header.e_machine == EM_CUDA) {
if (~Header.e_flags & EF_CUDA_64BIT_ADDRESS)
return createError("Invalid CUDA addressing mode");
- if ((Header.e_flags & EF_CUDA_SM) < EF_CUDA_SM35 ||
- (Header.e_flags & EF_CUDA_SM) > EF_CUDA_SM90)
+ if ((Header.e_flags & EF_CUDA_SM) < EF_CUDA_SM35)
----------------
Artem-B wrote:
> It's supposed to check if we can run it,
Well, then these checks are neither here, nor there.
Even when the checks on SM version succeed, you may not be able to run the executable because the machine has no GPU, has GPU of a wrong kind, does not have the recent enough version of the driver, and possibly other reasons.
The check may also reject perfectly valid ELF that would be runnable on the given machine (old GPU, with old drivers). The remaining check may make sense if we only intend to run the ELF executables created by us, and carrying something that would not be present in the older binaries, but then I'd argue that it's that *something* that we should be checking. GPU arch is not a good proxy for that info.
In the end it probably does not matter -- new GPUs are accepted now, and I doubt anybody cares about sm_30 any more.
https://github.com/llvm/llvm-project/pull/142399
More information about the llvm-commits
mailing list