Failed to run a sample application

i have a follow trouble with gpu computations while running a sample application from your guides. I got “terminate called afted throwing an instance of sycl::V1::exception”
what(): Native API failed. Native API returns: 7(UR_RESULT_INVALID_BINARY)

Sycl-ls shows my devices as:
[opencl:cpu][opencl:0] AMD Ryzen 7 7700
[hip:gpu][hip:0] AMD HIP BECKEND, AMD Radeon RX 7600 gfx1102 [HIP 50731.92]
[hip:gpu][hip:1] AMD HIP BECKEND, AMD Radeon Graphics gfx1036 [HIP 50731.92]

I tried as gpu0 device as gpu1 device.

i have ROCM 5.7.1 and downloaded plugin for 2025 for 6.1. But when i start to settle 5.7.1 plugin got “File exist” exception. If it’s could be the problem, what files should be deleted though?

Hi @alex2671,

you can use the 6.1 installer you used to install the plugin to uninstall it again, with something like:

./oneapi-for-amd-gpus-2025.0.0-rocm-6.1.0-linux.sh -u

Then you should be able to install the correct version that matches your installed ROCm version. Unfortunately we are quite sensitive to the different ROCm versions.

Beyond that you’ll need to make sure that the versions of the device code match, it looks like you have two GPUs which will need different versions of the device binary. At the moment you’ll only be able to have one, unfortunately.

I hope this helps,
Duncan.

After all manipulations with plugins the problem is not disappeared.

Despite sycl-ls could detect 2 gpu, in reality i have the only one - RX7600. Might it be the problem?

Also attaching log from gdb-oneapi:

gdb-oneapi ./test 
GNU gdb (Intel(R) Distribution for GDB* 2025.0.0) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.; (C) 2024 Intel Corp.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.

For information about how to find Technical Support, Product Updates,
User Forums, FAQs, tips and tricks, and other support information, please visit:
<http://www.intel.com/software/products/support/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./test...
(No debugging symbols found in ./test)
(gdb) run
Starting program: /home/aleksei/code/TPT4/build/test 
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/printers.py:1201: SyntaxWarning: invalid escape sequence '\d'
  self.typename = re.sub('^std::experimental::fundamentals_v\d::', 'std::experimental::', self.typename, 1)
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/printers.py:1219: SyntaxWarning: invalid escape sequence '\w'
  mgrname = re.sub("std::string(?!\w)", str(gdb.lookup_type('std::string').strip_typedefs()), m.group(1))
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/printers.py:1249: SyntaxWarning: invalid escape sequence '\d'
  self.typename = re.sub('^std::(experimental::|)(fundamentals_v\d::|)(.*)', r'std::\1\3<%s>' % valtype, typename, 1)
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/xmethods.py:151: SyntaxWarning: invalid escape sequence '\d'
  if not re.match('^std::(__\d+::)?array<.*>$', class_type.tag):
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/xmethods.py:268: SyntaxWarning: invalid escape sequence '\d'
  if not re.match('^std::(__\d+::)?deque<.*>$', class_type.tag):
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/xmethods.py:312: SyntaxWarning: invalid escape sequence '\d'
  if not re.match('^std::(__\d+::)?forward_list<.*>$', class_type.tag):
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/xmethods.py:393: SyntaxWarning: invalid escape sequence '\d'
  if not re.match('^std::(__\d+::)?(__cxx11::)?list<.*>$', class_type.tag):
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/xmethods.py:508: SyntaxWarning: invalid escape sequence '\d'
  if not re.match('^std::(__\d+::)?vector<.*>$', class_type.tag):
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/xmethods.py:557: SyntaxWarning: invalid escape sequence '\d'
  if not re.match('^std::(__\d+::)?%s<.*>$' % self._name, class_type.tag):
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/xmethods.py:590: SyntaxWarning: invalid escape sequence '\d'
  if re.match('^std::(__\d+::)?__uniq_ptr_(data|impl)<.*>$', impl_type):
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/xmethods.py:592: SyntaxWarning: invalid escape sequence '\d'
  elif re.match('^std::(__\d+::)?tuple<.*>$', impl_type):
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/xmethods.py:654: SyntaxWarning: invalid escape sequence '\d'
  if not re.match('^std::(__\d+::)?unique_ptr<.*>$', class_type.tag):
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/xmethods.py:723: SyntaxWarning: invalid escape sequence '\['
  m = re.match('.*\[(\d+)]$', str(self._elem_type))
/lib/x86_64-linux-gnu/../../share/gcc/python/libstdcxx/v6/xmethods.py:775: SyntaxWarning: invalid escape sequence '\d'
  if not re.match('^std::(__\d+::)?shared_ptr<.*>$', class_type.tag):
Registering SYCL extensions for gdb
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffda1ff640 (LWP 10076)]
[New Thread 0x7fffd99fe640 (LWP 10077)]
[Thread 0x7fffd99fe640 (LWP 10077) exited]
[New Thread 0x7ffe911ff640 (LWP 10078)]
[New Thread 0x7ffe8abff640 (LWP 10080)]
[New Thread 0x7ffe909fe640 (LWP 10079)]
[New Thread 0x7ffe8a3fe640 (LWP 10081)]
[New Thread 0x7ffe89bfd640 (LWP 10082)]
[New Thread 0x7ffe893fc640 (LWP 10083)]
[New Thread 0x7ffe7bfff640 (LWP 10085)]
[New Thread 0x7ffe88bfb640 (LWP 10084)]
[New Thread 0x7ffe7b7fe640 (LWP 10086)]
[New Thread 0x7ffe797fa640 (LWP 10090)]
[New Thread 0x7ffe79ffb640 (LWP 10089)]
[New Thread 0x7ffe7affd640 (LWP 10087)]
[New Thread 0x7ffe7a7fc640 (LWP 10088)]
[New Thread 0x7ffe5bfff640 (LWP 10092)]
[New Thread 0x7ffe78ff9640 (LWP 10091)]
AMD Ryzen 7 7700 8-Core Processor               memS: 134158589952 MAX_WORK_GROUP_SIZE: 8192 MAX_SUB_GROUP_SIZE: 2048 id: 8192 8192 8192
AMD Radeon RX 7600 memS: 8573157376 MAX_WORK_GROUP_SIZE: 1024 MAX_SUB_GROUP_SIZE: 32 id: 1024 1024 1024
AMD Radeon Graphics memS: 536870912 MAX_WORK_GROUP_SIZE: 1024 MAX_SUB_GROUP_SIZE: 32 id: 1024 1024 1024
terminate called after throwing an instance of 'sycl::_V1::exception'
  what():  Native API failed. Native API returns: 7 (UR_RESULT_ERROR_INVALID_BINARY)

Thread 1 "test" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737352461376) at ./nptl/pthread_kill.c:44
warning: 44	./nptl/pthread_kill.c: No such file or directory

sycl-ls is likely showing your iGPU as well as your discrete GPU. So long as you stick to the first GPU shown by sycl-ls, we’re hopefully OK.

When you compile your code, did you definitely add -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch=gfx1102 ? Without this, it definitely won’t work, as you’ll have the wrong kind of bitcode, and I would expect to see the error you are getting here.

1 Like

Oh, I forgot about additional flags. Worked well!

1 Like