<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hello, in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/How-to-debug-offload-application-using-GDB/m-p/1016550#M36342</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;officially we only support offload debugging by using the Eclipse* IDE integration as described here:&lt;BR /&gt;
	&lt;A href="https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Debugging%20with%20Eclipse*%20IDE"&gt;https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Debugging%20with%20Eclipse*%20IDE&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you still want to debug on the command line only, here is a &lt;STRONG&gt;not validated&lt;/STRONG&gt; way to do so:&lt;/P&gt;

&lt;OL&gt;
	&lt;LI&gt;Set two environment variables (depending on the MPSS version) before starting the offload enabled application as described here:&lt;BR /&gt;
		&lt;A href="https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Additional%20Requirements%20for%20Offload%20Debugging"&gt;https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Additional%20Requirements%20for%20Offload%20Debugging&lt;/A&gt;&lt;BR /&gt;
		&amp;nbsp;&lt;/LI&gt;
	&lt;LI&gt;Start the offload enabled application.&lt;BR /&gt;
		&amp;nbsp;&lt;/LI&gt;
	&lt;LI&gt;Start "gdbserver" on the coprocessor where the offloaded code is running on, e.g.:&lt;BR /&gt;
		$ micnativeloadex /opt/intel/composer_xe_2015.0.086/debugger/gdb/target/mic/bin/gdbserver -a "--multi :2000"&lt;BR /&gt;
		Note that it has to be started as "micuser" or whichever user the "coi_daemon" is running with. Hence we use "micnativeloadex" here which executes as "micuser" on the coprocessor.&lt;BR /&gt;
		&amp;nbsp;&lt;/LI&gt;
	&lt;LI&gt;Get the offloaded code's section:&lt;BR /&gt;
		Assuming the offloaded enabled application runs on host as "xxx" and the offloaded code section on the coprocessor as PID 5101:&lt;BR /&gt;
		micuser&amp;nbsp;&amp;nbsp;&amp;nbsp; 5101&amp;nbsp; 0.3&amp;nbsp; 0.0 217256&amp;nbsp; 4088 ?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sl&amp;nbsp;&amp;nbsp; 14:06&amp;nbsp;&amp;nbsp; 0:00 /tmp/coi_procs/1/5101/xxx?iccout6H59mG&lt;BR /&gt;
		(output from "ps aux")&lt;BR /&gt;
		&lt;BR /&gt;
		Then you'll find on the host:&lt;BR /&gt;
		/tmp/coi_procs/1/5101/xxx\?iccout6H59mG&lt;BR /&gt;
		This should be used for the "file" command below.&lt;BR /&gt;
		&amp;nbsp;&lt;/LI&gt;
	&lt;LI&gt;Start gdb-mic and attach, e.g.:&lt;BR /&gt;
		(gdb) target extended-remote mic0:2000&lt;BR /&gt;
		(gdb) set sysroot /opt/mpss/3.1.4/sysroots/k1om-mpss-linux/&lt;BR /&gt;
		(gdb) file /tmp/coi_procs/1/5101/xxx\?iccout6H59mG&lt;BR /&gt;
		(gdb) attach 5101&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Now you can debug the offloaded code section. However, if you have multiple coprocessors and/or multiple offloaded code sections then you'll see how cumbersome this gets. It's better to use the Eclipse* IDE integration, which does all of that transparently for you.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Georg Zitzlsberger&lt;/P&gt;</description>
    <pubDate>Wed, 06 Aug 2014 12:35:00 GMT</pubDate>
    <dc:creator>Georg_Z_Intel</dc:creator>
    <dc:date>2014-08-06T12:35:00Z</dc:date>
    <item>
      <title>How to debug offload application using GDB</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-debug-offload-application-using-GDB/m-p/1016549#M36341</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;i want to debug my application using gdb in offload mode. Unfortunately i could not find exact way to debug an offload application using GDB. This (https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host) articles talks about debugging remotely, natively using GDB. It seems there is eclipse plugin for debugging in offload mode(i can not use eclipse). I want to know is there any way I can debug my application using GDB?&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I tried running my application using &lt;STRONG&gt;gdb-mic &amp;lt;executable&amp;gt;.&lt;/STRONG&gt;&amp;nbsp;My application has some offloaded code in middle. When i run it is giving me segmentation fault. i am not able to fback trace to identify the method which is creating problem on MIC. I am attaching screen shots of error.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="gdb-error.jpg"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/6996iE330E9FEE529DF62/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="gdb-error.jpg" alt="gdb-error.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I am not able to see rouitne names using gdb-mic. How to get routine names and line number from where the problem is created?&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Can some please help me on this?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;sivaramakrishna&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2014 10:43:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-debug-offload-application-using-GDB/m-p/1016549#M36341</guid>
      <dc:creator>shiva_rama_krishna_b</dc:creator>
      <dc:date>2014-08-04T10:43:04Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/Software-Archive/How-to-debug-offload-application-using-GDB/m-p/1016550#M36342</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;officially we only support offload debugging by using the Eclipse* IDE integration as described here:&lt;BR /&gt;
	&lt;A href="https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Debugging%20with%20Eclipse*%20IDE"&gt;https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Debugging%20with%20Eclipse*%20IDE&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you still want to debug on the command line only, here is a &lt;STRONG&gt;not validated&lt;/STRONG&gt; way to do so:&lt;/P&gt;

&lt;OL&gt;
	&lt;LI&gt;Set two environment variables (depending on the MPSS version) before starting the offload enabled application as described here:&lt;BR /&gt;
		&lt;A href="https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Additional%20Requirements%20for%20Offload%20Debugging"&gt;https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Additional%20Requirements%20for%20Offload%20Debugging&lt;/A&gt;&lt;BR /&gt;
		&amp;nbsp;&lt;/LI&gt;
	&lt;LI&gt;Start the offload enabled application.&lt;BR /&gt;
		&amp;nbsp;&lt;/LI&gt;
	&lt;LI&gt;Start "gdbserver" on the coprocessor where the offloaded code is running on, e.g.:&lt;BR /&gt;
		$ micnativeloadex /opt/intel/composer_xe_2015.0.086/debugger/gdb/target/mic/bin/gdbserver -a "--multi :2000"&lt;BR /&gt;
		Note that it has to be started as "micuser" or whichever user the "coi_daemon" is running with. Hence we use "micnativeloadex" here which executes as "micuser" on the coprocessor.&lt;BR /&gt;
		&amp;nbsp;&lt;/LI&gt;
	&lt;LI&gt;Get the offloaded code's section:&lt;BR /&gt;
		Assuming the offloaded enabled application runs on host as "xxx" and the offloaded code section on the coprocessor as PID 5101:&lt;BR /&gt;
		micuser&amp;nbsp;&amp;nbsp;&amp;nbsp; 5101&amp;nbsp; 0.3&amp;nbsp; 0.0 217256&amp;nbsp; 4088 ?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sl&amp;nbsp;&amp;nbsp; 14:06&amp;nbsp;&amp;nbsp; 0:00 /tmp/coi_procs/1/5101/xxx?iccout6H59mG&lt;BR /&gt;
		(output from "ps aux")&lt;BR /&gt;
		&lt;BR /&gt;
		Then you'll find on the host:&lt;BR /&gt;
		/tmp/coi_procs/1/5101/xxx\?iccout6H59mG&lt;BR /&gt;
		This should be used for the "file" command below.&lt;BR /&gt;
		&amp;nbsp;&lt;/LI&gt;
	&lt;LI&gt;Start gdb-mic and attach, e.g.:&lt;BR /&gt;
		(gdb) target extended-remote mic0:2000&lt;BR /&gt;
		(gdb) set sysroot /opt/mpss/3.1.4/sysroots/k1om-mpss-linux/&lt;BR /&gt;
		(gdb) file /tmp/coi_procs/1/5101/xxx\?iccout6H59mG&lt;BR /&gt;
		(gdb) attach 5101&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Now you can debug the offloaded code section. However, if you have multiple coprocessors and/or multiple offloaded code sections then you'll see how cumbersome this gets. It's better to use the Eclipse* IDE integration, which does all of that transparently for you.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Georg Zitzlsberger&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2014 12:35:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/How-to-debug-offload-application-using-GDB/m-p/1016550#M36342</guid>
      <dc:creator>Georg_Z_Intel</dc:creator>
      <dc:date>2014-08-06T12:35:00Z</dc:date>
    </item>
  </channel>
</rss>

