Search code examples
debugginggdbxeon-phi

Debugging Intel Xeon Phi Native application


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?


Solution

  • 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.