[llvm][tools] Improve llvm-gpu-loader checks#184791
Conversation
| } | ||
| InitArgs.NumPlatforms = 1; | ||
| InitArgs.Platforms = &Backend; | ||
| } else { |
There was a problem hiding this comment.
This was an intentional fall-through. When we can't determine it from the ELF flags we let olInit initialize every architecture.
There was a problem hiding this comment.
I'm not sure I see the benefit of doing that. The only other format we support right now is the bitcode and we could add a check here. I think it's better to error here with a more meaningful message than later with a "no device found" error which was due to an unsupported format.
There was a problem hiding this comment.
This was an intentional fall-through. When we can't determine it from the ELF flag we let olInit initialize every plugin. If it fails to find a compatible device that will fail later.
There was a problem hiding this comment.
ok, but by the same token shouldn't we let fall-through ELFs that are not EM_AMDGPU or EM_CUDA instead of erring out?
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/129/builds/40418 Here is the relevant piece of the build log for the reference |
When the file format is incorrect, or the platform or devices are not properly initialized llvm-gpu-loader follows corrupt pointers which result in hard to debug crashes.
This improves the checks to avoid such situations.