intel / intel/llvm

hipErrorNoBinaryForGpu: Unable to find code object for all current devices?

Open
#7,993 18 comments 0 reactions 0 assignees View on GitHub
bug hip
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

![bea4ed4589f79a757a8fd7af8770b9d](https://user-images.githubusercontent.com/22990858/212073811-708707c6-6918-49ff-b5d7-9e2e32e9bc73.png)

**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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.