Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
1114 Discussions

Debugging AVX-512 application with Intel SDE

borrow
Beginner
2,815 Views

Hello,

 

I am trying to debug AVX-512 instructions on an emulated CPU using Intel® Software Development Emulator but it doesn't work as desired after setting a breakpoint. I followed this blog post: Debugging Emulated Code on Linux* 

 

In window #1:

 

 

~$ g++ -g -O0 -mavx512f main.cpp -o main # compile main.cpp file
~$ sde -debug -- ./main

Application stopped until continued from debugger.
Start GDB, then issue this command at the (gdb) prompt:
target remote :54105

 

 

 

In window #2

 

 

~$ gdb ./main
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./main...

(gdb) target remote :54105
Remote debugging using :54105
warning: remote target does not support file transfer, attempting to access files from local filesystem.
Reading symbols from /lib64/ld-linux-x86-64.so.2...
(No debugging symbols found in /lib64/ld-linux-x86-64.so.2)
0x00007fa7bbbcc100 in ?? () from /lib64/ld-linux-x86-64.so.2

(gdb) break main
Breakpoint 1 at 0x2c9c: file /home/developer/source/repos/se-test/main.cpp, line 165.

(gdb) c
Continuing.
warning: Probes-based dynamic linker interface failed.
Reverting to original interface.
[Inferior 1 (Remote target) exited normally]

 

 

 

It should run the program until the breakpoint but gives me a warning message:

 

 

warning: Probes-based dynamic linker interface failed.

 

 

 
In window #1: The program runs and ends (without stopping). How can I solve this problem?
 
 Program code looks like this:
 
//  main.cpp
float a[256] = {0};
float b[256] = {0};
float c[256] = {0};


void foo()
{
       __m512 result,B,C;
       for (int i=0; i<256; i+=16)
      {
           B = _mm512_load_ps(&b[i]);
           C = _mm512_load_ps(&c[i]);
           result = _mm512_add_ps(B,C);
           _mm512_store_ps(&a[i], result);
       }
}
 
int main() {
     ...
     foo();
     ...
}
 
 
I tried running AVX2 code without SDE emulator using gdb and it worked. First I start it on an emulated CPU with SDE, it fails.
 
 
 
 
 
 
0 Kudos
2 Replies
AdyT_Intel
Moderator
2,683 Views

From the GDB output at line:

Breakpoint 1 at 0x2c9c: file /home/developer/source/repos/se-test/main.cpp, line 165.

 

It looks like the executable is PIE (position independent).
If this is the case, then it is a known problem that we plan to fix.
Until this fix is available please build the executable without PIE.

0 Kudos
Reply