<?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 There is not enough in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929035#M14422</link>
    <description>&lt;P&gt;There is not enough information in that portion of the error alone to draw any concrete conclusion on what might be the cause. Can you share the sample code that produced that error?&lt;/P&gt;
&lt;P&gt;Have you tried the MIC product samples that ship with the Composer XE 2013 Product or any of the examples/tutorials at &lt;A href="http://software.intel.com/mic-developer"&gt;http://software.intel.com/mic-developer&lt;/A&gt;&amp;nbsp;to know if other simple offload programs execute successfully?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2013 14:51:00 GMT</pubDate>
    <dc:creator>Kevin_D_Intel</dc:creator>
    <dc:date>2013-06-21T14:51:00Z</dc:date>
    <item>
      <title>offload error: cannot load library to the device 0 (error code 5)</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929033#M14420</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am porting a large C++ application to MIC. I wrote a bit sample which allocate data using to offload pragma. When I try to run executable file, I have error "offload error: cannot load library to the device 0 (error code 5)".&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2013 13:15:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929033#M14420</guid>
      <dc:creator>Alexander_Komarov</dc:creator>
      <dc:date>2013-06-21T13:15:53Z</dc:date>
    </item>
    <item>
      <title>Can any one help me?</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929034#M14421</link>
      <description>&lt;P&gt;Can any one help me?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2013 13:53:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929034#M14421</guid>
      <dc:creator>Alexander_Komarov</dc:creator>
      <dc:date>2013-06-21T13:53:51Z</dc:date>
    </item>
    <item>
      <title>There is not enough</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929035#M14422</link>
      <description>&lt;P&gt;There is not enough information in that portion of the error alone to draw any concrete conclusion on what might be the cause. Can you share the sample code that produced that error?&lt;/P&gt;
&lt;P&gt;Have you tried the MIC product samples that ship with the Composer XE 2013 Product or any of the examples/tutorials at &lt;A href="http://software.intel.com/mic-developer"&gt;http://software.intel.com/mic-developer&lt;/A&gt;&amp;nbsp;to know if other simple offload programs execute successfully?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2013 14:51:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929035#M14422</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2013-06-21T14:51:00Z</dc:date>
    </item>
    <item>
      <title>I added this line of code</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929036#M14423</link>
      <description>&lt;P&gt;I added this line of code&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;float x[4];&lt;BR /&gt; #pragma offload target (mic:0) \&lt;BR /&gt; inout(x : ALLOC)&lt;BR /&gt; {&lt;BR /&gt; #ifdef __MIC__&lt;BR /&gt; printf("MIC");&lt;BR /&gt; #else&lt;BR /&gt; printf("CPU");&lt;BR /&gt; #endif&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; #pragma offload target (mic:0) \&lt;BR /&gt; nocopy(x : FREE)&lt;BR /&gt; {&lt;BR /&gt; &lt;BR /&gt; }&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And there was this error.&lt;/P&gt;
&lt;P&gt;The MIC product samples that ship with the Composer XE 2013 Product&amp;nbsp;execute successfully.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2013 08:20:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929036#M14423</guid>
      <dc:creator>Alexander_Komarov</dc:creator>
      <dc:date>2013-06-22T08:20:48Z</dc:date>
    </item>
    <item>
      <title>Ok. So the sample code was</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929037#M14424</link>
      <description>&lt;P&gt;Ok. So the sample code was added to your large C++ app which when built produces the error. Is that extent of the error or is there more that you are not sharing?&lt;/P&gt;
&lt;P&gt;Typically there’s more that precedes the error you posted. Are there any errors regarding dlopen failed?&amp;nbsp; Or undefined symbol?&lt;/P&gt;
&lt;P&gt;When building your app, please try adding the following option to the final link step: &lt;STRONG&gt;-offload-option,mic,ld,"--no-undefined"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For any reported undefined references the associated entity likely requires decorating with &lt;STRONG&gt;__attribute__ ((target(mic)))&lt;/STRONG&gt; to ensure an instance is created in the offload executable.&lt;/P&gt;
&lt;P&gt;If you find none of this is applicable then more source code context is needed to show where this sample code appears to help understand what could lead to the error.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jun 2013 09:06:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929037#M14424</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2013-06-22T09:06:51Z</dc:date>
    </item>
    <item>
      <title>My project is daemon for</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929038#M14425</link>
      <description>&lt;P&gt;My project is daemon for Linux.&amp;nbsp;I created a minimal application that replicates my mistake.&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;int main(int argc, char *argv[]) {&lt;BR /&gt; ::chdir("/"); // allow file system unmounting&lt;/P&gt;
&lt;P&gt;printf("Hello\n");&lt;BR /&gt; float x[4];&lt;BR /&gt; #pragma offload target (mic:0) \&lt;BR /&gt; inout(x : ALLOC)&lt;BR /&gt; {&lt;BR /&gt; #ifdef __MIC__&lt;BR /&gt; printf("MIC");&lt;BR /&gt; #else&lt;BR /&gt; printf("CPU");&lt;BR /&gt; #endif&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; #pragma offload target (mic:0) \&lt;BR /&gt; nocopy(x : FREE)&lt;BR /&gt; {&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;If I delete this line "::chdir("/"); // allow file system unmounting", then error&amp;nbsp;disappear.&lt;/P&gt;
&lt;P&gt;For me this line of code is't critical. So&amp;nbsp;I resolved my problem.&lt;/P&gt;
&lt;P&gt;Thanks so much for the help.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2013 15:09:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929038#M14425</guid>
      <dc:creator>Alexander_Komarov</dc:creator>
      <dc:date>2013-06-24T15:09:04Z</dc:date>
    </item>
    <item>
      <title>Ah very interesting. Thank</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929039#M14426</link>
      <description>&lt;P&gt;Ah very interesting. Thank you for the efforts to find and post this. Yes, I can see now how this leads to only the error in your original post. When you change directory away from where the MIC image currently resides the load of this image fails.&lt;/P&gt;
&lt;P&gt;There are two ways to deal with this.&lt;/P&gt;
&lt;P&gt;1. Delay the chdir until after the first offload, or throw in a counterfeit offload_transfer before the chdir to cover all installed devices. Something like:&lt;/P&gt;
&lt;P&gt;[cpp]int main(int argc, char *argv[]) {&lt;BR /&gt;int i;&lt;BR /&gt;for (i=0; i &amp;lt; _Offload_number_of_devices(); i++)&lt;BR /&gt;{&lt;BR /&gt;#pragma offload_transfer target (mic:i)&lt;BR /&gt;}&lt;BR /&gt;chdir("/");&lt;BR /&gt;&amp;lt;rest of code&amp;gt;[/cpp]&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;2. Use the &lt;STRONG&gt;OFFLOAD_INIT=on_start&lt;/STRONG&gt; environment variable setting to initialize the target devices before entering main().&lt;/P&gt;
&lt;P&gt;Thanks for the interesting issue!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2013 16:22:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929039#M14426</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2013-06-24T16:22:00Z</dc:date>
    </item>
    <item>
      <title>Thanks for ways to deal with</title>
      <link>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929040#M14427</link>
      <description>&lt;P&gt;Thanks for ways to deal with this. I tried and all ok.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2013 12:08:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/offload-error-cannot-load-library-to-the-device-0-error-code-5/m-p/929040#M14427</guid>
      <dc:creator>Alexander_Komarov</dc:creator>
      <dc:date>2013-06-25T12:08:13Z</dc:date>
    </item>
  </channel>
</rss>

