-
Notifications
You must be signed in to change notification settings - Fork 822
Bad error message when SYCL app is not built for the device #21627
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestruntimeRuntime library related issueRuntime library related issue
Description
Describe the bug
If an application for example is built for NVIDIA GPUs with -fsycl-targets=nvptx64 but then run on a device with an Intel GPU only, an error like this is reported:
❯ icpx -fsycl -fsycl-targets=nvptx64-nvidia-cuda main.cpp
❯ ./a.out
terminate called after throwing an instance of 'sycl::_V1::exception'
what(): No kernel named _ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlvE_ was found
[1] 415163 IOT instruction (core dumped) ./a.outProbably the other way around the same happens, but I don't have access to machine with an NVIDIA GPU to test.
To reproduce
- Include a code snippet that is as short as possible
#include <sycl/sycl.hpp>
int main() {
sycl::queue q;
int *d_result = sycl::malloc_device<int>(1, q);
q.submit([&](sycl::handler &cgh) {
cgh.single_task([=]() { *d_result = 1; });
});
return 0;
}- Specify the command which should be used to compile the program
clang -fsycl -fsycl-targets=nvptx64-nvidia-cuda main.cpp- Specify the command which should be used to launch the program
./a.out- Indicate what is wrong and what was expected
The error message from the SYCL runtime looks like this:
No kernel named _ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_EUlvE_ was found
this is pretty bad, we get a mangled name for the kernel lambda that's very intimidating, but is just noise, but no actual indication that the problem could be with how the application was built.
Environment
- OS: Linux
- Target device and vendor: Mixed
- DPC++ version:
- Dependencies version:
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestruntimeRuntime library related issueRuntime library related issue