- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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?
I tried running my application using gdb-mic <executable>. 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.
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?
Can some please help me on this?
Thanks
sivaramakrishna
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
officially we only support offload debugging by using the Eclipse* IDE integration as described here:
https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Debugging%20with%20Eclipse*%20IDE
If you still want to debug on the command line only, here is a not validated way to do so:
- Set two environment variables (depending on the MPSS version) before starting the offload enabled application as described here:
https://software.intel.com/en-us/articles/debugging-intel-xeon-phi-applications-on-linux-host#Additional%20Requirements%20for%20Offload%20Debugging
- Start the offload enabled application.
- Start "gdbserver" on the coprocessor where the offloaded code is running on, e.g.:
$ micnativeloadex /opt/intel/composer_xe_2015.0.086/debugger/gdb/target/mic/bin/gdbserver -a "--multi :2000"
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.
- Get the offloaded code's section:
Assuming the offloaded enabled application runs on host as "xxx" and the offloaded code section on the coprocessor as PID 5101:
micuser 5101 0.3 0.0 217256 4088 ? Sl 14:06 0:00 /tmp/coi_procs/1/5101/xxx?iccout6H59mG
(output from "ps aux")
Then you'll find on the host:
/tmp/coi_procs/1/5101/xxx\?iccout6H59mG
This should be used for the "file" command below.
- Start gdb-mic and attach, e.g.:
(gdb) target extended-remote mic0:2000
(gdb) set sysroot /opt/mpss/3.1.4/sysroots/k1om-mpss-linux/
(gdb) file /tmp/coi_procs/1/5101/xxx\?iccout6H59mG
(gdb) attach 5101
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.
Best regards,
Georg Zitzlsberger
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page