Closed mdessole closed 4 weeks ago
Duplicate of #8112?
@al42and Thank you for your suggestion.
@mdessole If the results of comparing HIP and SYCL programs are available on gfx90c, thanks for letting people know.
Sorry for answering so late.
I reinstalled from source including changes in [SYCL] Gracefully handle unknown device, using rocm-5.4.3 instead of rocm-5.7.0, and clang++ compiles the example without raising any error.
However, when I try to run the executable, the process just hangs forever. If I try to print out the device that holds the sycl queue before executing the kernel, I correctly get
AMD Radeon Graphics
Do you have any idea of what is happening, or can you suggest how to investigate it?
I include the code snippet I'm trying to execute - a very simple example - for completeness.
#include <iostream>
#include <sycl/sycl.hpp>
class vector_addition;
int main(int, char**) {
sycl::float4 a = { 1.0, 2.0, 3.0, 4.0 };
sycl::float4 b = { 4.0, 3.0, 2.0, 1.0 };
sycl::float4 c = { 0.0, 0.0, 0.0, 0.0 };
sycl::default_selector device_selector;
sycl::queue queue(device_selector);
std::cout << "Running on "
<< queue.get_device().get_info<sycl::info::device::name>()
<< "\n";
{
sycl::buffer<sycl::float4, 1> a_sycl(&a, sycl::range<1>(1));
sycl::buffer<sycl::float4, 1> b_sycl(&b, sycl::range<1>(1));
sycl::buffer<sycl::float4, 1> c_sycl(&c, sycl::range<1>(1));
queue.submit([&] (sycl::handler& cgh) {
auto a_acc = a_sycl.get_access<sycl::access::mode::read>(cgh);
auto b_acc = b_sycl.get_access<sycl::access::mode::read>(cgh);
auto c_acc = c_sycl.get_access<sycl::access::mode::discard_write>(cgh);
cgh.single_task<class vector_addition>([=] () {
c_acc[0] = a_acc[0] + b_acc[0];
});
});
}
std::cout << " A { " << a.x() << ", " << a.y() << ", " << a.z() << ", " << a.w() << " }\n"
<< "+ B { " << b.x() << ", " << b.y() << ", " << b.z() << ", " << b.w() << " }\n"
<< "------------------\n"
<< "= C { " << c.x() << ", " << c.y() << ", " << c.z() << ", " << c.w() << " }"
<< std::endl;
return 0;
@mdessole Would you please build the SYCL compiler from the latest source again ?
gfx90c is not officially supported by rocm, and hence not officially supported by dpc++ amd backend. See https://github.com/ROCm/ROCm/issues/1743 for some discussion. It seems that things don't work well for this gpu. Closing.
Bug Description
When compiling a simple example trying to target my AMD GPU, I get the following error:
When I try a different target, e.g. the NVIDIA GPU or the CPU, everything works fine.
To Reproduce
I installed the dpc++ compiler from source, targeting both my NVIDIA and AMD GPUs as follows:
In what follows tou can find the output of the compilation with the -### flag, where you can see that
-D__SYCL_ANY_DEVICE_HAS_ANY_ASPECT__=1
is passed as the argument to clang-18 binary.The
sycl-ls
command correctly identifies the two GPUs:Environment (please complete the following information):