hipErrorNoBinaryForGpu: Unable to find code object for all current devices?
- Dominant language
- LLVM
- Stars
- 1.5k
- Forks
- 854
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 137
Description
**Describe the bug**
When I execute the program under the hip gpu, the following error occurs.
hipErrorNoBinaryForGpu: Unable to find code object for all current devices

**To Reproduce**
The example code is as follows.
simple-sycl-app
#include
void show_platforms() {
auto platforms = sycl::platform::get_platforms();
for (auto &platform : platforms) {
std::cout << "Platform: "
<< platform.get_info()
<< std::endl;
auto devices = platform.get_devices();
for (auto &device : devices ) {
std::cout << " Device: "
<< device.get_info()
<< std::endl;
}
}
}
int main() {
#if (defined(ONEAPI) && ONEAPI)
std::cout<<"found oneapi compile flag params !"< Buffer(4);
//sycl::gpu_selector s;
// Creating SYCL queue
sycl::queue Queue;
//sycl::queue Queue();
auto dev = Queue.get_device();
std::cout<<"================================"<()
<< std::endl;
// Size of index space for kernel
sycl::range<1> NumOfWorkItems{Buffer.size()};
// Submitting command group(work) to queue
Queue.submit([&](sycl::handler &cgh) {
// Getting write only access to the buffer on a device
auto Accessor = Buffer.get_access(cgh);
// auto out = sycl::stream(1024, 768, cgh);
// auto task = [=]() { out << "In a task\n"; };
// Executing kernel
cgh.parallel_for(
NumOfWorkItems, [=](sycl::id<1> WIid) {
// out<<"parallel for before\n";
// Fill buffer with indexes
//Accessor[WIid] = (sycl::cl_int)WIid.get(0);
Accessor[WIid] = (sycl::cl_int)WIid.get(0);
});
// cgh.single_task(task);
});
// Getting read only access to the buffer on the host.
// Implicit barrier waiting for queue to complete the work.
const auto HostAccessor = Buffer.get_access();
// Check the results
bool MismatchFound = false;
for (size_t I = 0; I < Buffer.size(); ++I) {
if (HostAccessor[I] != I) {
std::cout << "The result is incorrect for element: " << I
<< " , expected: " << I << " , got: " << HostAccessor[I]
<< std::endl;
MismatchFound = true;
}
}
if (!MismatchFound) {
std::cout << "The results are correct!" << std::endl;
}
return MismatchFound;
}
**Environment (please complete the following information):**
- OS: Ubuntu20.04
- Target device and vendor: HYGON DCU gfx
- DPC++ version: 2022-09 release
- Dependencies version: rocm-5
**Additional context**
how to solve the problem?
Contributor guide
Assessment
This issue has not been assessed yet.