1

I want to debug a native application on Intel Xeon Phi. I installed MPSS 3.2.3 which provides gdb-mic but that doesn't seem to run natively. In some documents, they mention a file "/usr/linux-k1om-4.7/linux-k1om/usr/bin/gdb", but in that directory I only have gdbserver, not gdb.

Anyone knows how to debug a native application on Intel Xeon Phi?

Rakib
  • 791
  • 8
  • 19

3 Answers3

4

As Taylor Kidd mentioned in the earlier post, Intel has moved the gdb out of the basic package. So, if anyone trying to find the gdb, if it is not present in the basic package, download it from https://software.intel.com/en-us/articles/intel-manycore-platform-software-stack-mpss .

The package for gdb that you need to download (for MPSS 3.2.3) is called "Software for Coprocessor OS (mpss-3.2-k1om.tar)" (current link: http://registrationcenter.intel.com/irc_nas/4245/mpss-3.2.3-k1om.tar)

After you download and untar the file, you will see a lot of rpm files under <untar-dir>/mpss-3.2.3/k1om . Here you will see some rpm files that start with gdb. These are the ones you need to install for native gdb debugging. Some other rpms from this directory are needed if you follow the instructions below.

Now to install these rpms, I read the section "Installing Card Side RPMs" (section 11.3) from the MPSS_Users_Guide.pdf (http://registrationcenter.intel.com/irc_nas/4245/MPSS_Users_Guide.pdf). Although they mention 3 different ways to install rpms, I used the first one i.e. copying the rpm files and using zypper to install them. Of course, you can use NFS so that you don't need to copy, but that's another issue.

So after I copy or share the rpms, I needed to run the following two commands from inside the card:

rpm -ihv coreutils*.rpm libgmp*.rpm
zypper install gdb*.rpm

After that, when you log in to the phi, you will be able to run gdb natively.

Hope this helps anyone who is looking for how to debug natively on Intel Xeon Phi.

Rakib
  • 791
  • 8
  • 19
3

Yeah, they've hidden it haven't they. They moved it to the RPM that has the optional stuff, instead of keeping it in the main distribution. I figure they expect everyone to do remote gdb debugging using gdbserver.

I believe you can find the native gdb in the "Software for Coprocesor OS". (I'm not 100% sure since I can't check easily at the moment.)

Look at the "MPSS 3.2.x release for Linux" tar file on https://software.intel.com/en-us/articles/intel-manycore-platform-software-stack-mpss.

Another useful link is http://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Debugging Natively.

osgx
  • 90,338
  • 53
  • 357
  • 513
Taylor Kidd
  • 1,463
  • 1
  • 9
  • 11
  • Thanks for your reply. They have hidden it indeed. But I already had found it! But I thought that would give me gdb-mic that I mentioned. I am planning to write a detailed step-by-step solution on how to do this gdb debugging natively. Your second link is actually where I got the gdb path that I mentioned. Anyway, thank you for your help. – Rakib Jun 09 '14 at 15:21
1

You could also look at commercial tools - such as Allinea DDT - which would bring with it both support for your questions and issues, and things that are not present in gdb such as memory debugging and MPI capability. This supports Xeon Phi native mode and other forms like offload mode.

David
  • 756
  • 5
  • 10