<?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 Thanks, I lucky solved the in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016262#M36223</link>
    <description>&lt;P&gt;Thanks, I lucky solved the problem after I compile the program with static link:)&amp;nbsp;&lt;/P&gt;

&lt;P&gt;But I am now facing a new problem: In the offload area like below&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;int *a=(int *)_mm_malloc(100*sizeof(double),64);

#pragma offload target(mic:0) in(a:length(100))
{
...
_mm512_mask_load_epi64(.. , writemask , &amp;amp;(a[3]));
}

&lt;/PRE&gt;

&lt;P&gt;it produces error"&amp;nbsp;process on the device 0 was terminated by signal 11 (SIGSEGV)"&lt;/P&gt;

&lt;P&gt;I looked up in the Intel doc and found &amp;nbsp;that the 3th argument of&amp;nbsp;_mm512_mask_load_epi64 function should be a&amp;nbsp;&amp;nbsp;64-byte-aligned address. But I have already make pointer a&amp;nbsp;&lt;SPAN style="line-height: 19.5120010375977px;"&gt;aligned&amp;nbsp;&lt;/SPAN&gt;in the _mm_malloc&amp;nbsp;function.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Dec 2014 11:39:22 GMT</pubDate>
    <dc:creator>Vincent_L_</dc:creator>
    <dc:date>2014-12-11T11:39:22Z</dc:date>
    <item>
      <title>cannot load library to the device 0 (error code 5)</title>
      <link>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016256#M36217</link>
      <description>&lt;P&gt;hi， I recently met a error while using Xeon Phi. When the program run into the #pragma offload area, it occur error “offload error: cannot load library to the device 0 (error code 5)” and then exit. I wonder what the "error code 5" mean? Can anyone provide me the error code list of the offload error? I can not find such thing through the Internet. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2014 04:30:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016256#M36217</guid>
      <dc:creator>Vincent_L_</dc:creator>
      <dc:date>2014-12-09T04:30:02Z</dc:date>
    </item>
    <item>
      <title>We need more details to be of</title>
      <link>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016257#M36218</link>
      <description>&lt;P&gt;We need more details to be of assistance. Knowing the error will likely not be enough. The error code 5 (COI_DOES_NOT_EXIST) is an indication that the specified object was not found which might mean functions used within offload sections are not declared properly in the program.&lt;/P&gt;

&lt;P&gt;Depending on the installed version of MPSS, the error codes derive from &lt;STRONG&gt;/usr/include/intel-coi/common/COIResult_common.h&lt;/STRONG&gt; (MPSS 3.x) or &lt;STRONG&gt;/opt/intel/mic/coi/include/common/COIResult_common.h&lt;/STRONG&gt; (MPSS 2.x).&lt;/P&gt;

&lt;P&gt;Can you provide more details about the offload area added to the program?&amp;nbsp;&amp;nbsp; Or provide the program itself, a code snippet?&lt;BR /&gt;
	Also, which version of MPSS and the compiler (icc/icpc/ifort/icl) are you using?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2014 10:16:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016257#M36218</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2014-12-09T10:16:15Z</dc:date>
    </item>
    <item>
      <title>Quote:Kevin Davis (Intel)</title>
      <link>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016258#M36219</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Kevin Davis (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;We need more details to be of assistance. Knowing the error will likely not be enough. The error code 5 (COI_DOES_NOT_EXIST) is an indication that the specified object was not found which might mean functions used within offload sections are not declared properly in the program.&lt;/P&gt;

&lt;P&gt;Depending on the installed version of MPSS, the error codes derive from &lt;STRONG&gt;/usr/include/intel-coi/common/COIResult_common.h&lt;/STRONG&gt; (MPSS 3.x) or &lt;STRONG&gt;/opt/intel/mic/coi/include/common/COIResult_common.h&lt;/STRONG&gt; (MPSS 2.x).&lt;/P&gt;

&lt;P&gt;Can you provide more details about the offload area added to the program?&amp;nbsp;&amp;nbsp; Or provide the program itself, a code snippet?&lt;BR /&gt;
	Also, which version of MPSS and the compiler (icc/icpc/ifort/icl) are you using?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;My code is like below：&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;//in main.c 
foowrapper();


//in foo.c
#pragma offload_attribute (push,target(mic))
void foo()
	{
#ifdef __MIC__
			__m512i x....;
			__m512d y.....;
			__mmask8 mask;
	kmp_set_defaults("KMP_AFFINITY=scatter,granularity=thread");
#pragma omp parallel for
			for(i=0;i&amp;lt;m;i++)
			{
				
					int rem=end-idx;
					mask=_mm512_int2mask(...);
					x=_mm512_mask_load_epi64(...);
					y=_mm512_mask_load_pd(...);
					x=_mm512_mask_i32logather_pd(...);
					y=_mm512_mask_fmadd_pd(...);
				}
				y+=_mm512_reduce_add_pd(...);
			}
			
#endif
	}
#pragma offload_attribute (pop)

void foowrapper()
{
#pragma offload target(mic:0)
     foo();
}

&lt;/PRE&gt;

&lt;P&gt;the program can not enter the offload area and throw error mentioned in the title.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2014 03:41:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016258#M36219</guid>
      <dc:creator>Vincent_L_</dc:creator>
      <dc:date>2014-12-10T03:41:25Z</dc:date>
    </item>
    <item>
      <title>Thanks for the code outline.</title>
      <link>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016259#M36220</link>
      <description>&lt;P&gt;Thanks for the code outline. Unfortunately, try as I did to induce the failure, I can’t, thus I’m either not replicating your environment settings, your source and/or how you are compiling and linking everything.&lt;/P&gt;

&lt;P&gt;While it’s not typical to wrap the routine using the push/pop in the way you showed, and it doesn’t seem to be a factor, you could replace those with just the __attribute__ ((target(mic))).&amp;nbsp; [ e.g.&amp;nbsp; &lt;STRONG&gt;__attribute__((target(mic))) void foo()&lt;/STRONG&gt; ]&lt;/P&gt;

&lt;P&gt;I’m guessing you probably are using a 14.0 (or maybe earlier) compiler so something else to try and help identify a possible missing routine is to add to the compilation/link for the offloaded source file the compiler option: &lt;STRONG&gt;-offload-option,mic,ld,”-z defs”&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Another run-time method for debugging this is to set the environment variable &lt;STRONG&gt;OFFLOAD_REPORT=3&lt;/STRONG&gt; and see what information is reported about what is loaded or not.&lt;/P&gt;

&lt;P&gt;Also, can you check and post the setting of the environment variable: &lt;STRONG&gt;MIC_LD_LIBRARY_PATH&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;If you can offer any insight into how you are compiling/linking that might help but even better would be if you could provide a complete reproducer. That would certainly be most helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2014 18:08:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016259#M36220</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2014-12-10T18:08:59Z</dc:date>
    </item>
    <item>
      <title>Thanks for the reply, my icc</title>
      <link>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016260#M36221</link>
      <description>&lt;P&gt;Thanks for the reply, my icc version is&amp;nbsp;15.0.0.090 and I compile the program with "icc -openmp &amp;nbsp;*.c" in a CMAKE framework.I think my environment &lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;settings have no problem&lt;/SPAN&gt;&amp;nbsp;because I have tested and passed some other simple offload programs. The problem in my project seem to be very weird. &amp;nbsp;Could I send you the whole source code &lt;SPAN style="line-height: 19.5120010375977px;"&gt;If you don't mind&amp;nbsp;&lt;/SPAN&gt;?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2014 07:11:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016260#M36221</guid>
      <dc:creator>Vincent_L_</dc:creator>
      <dc:date>2014-12-11T07:11:37Z</dc:date>
    </item>
    <item>
      <title>Yes, you can send me the</title>
      <link>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016261#M36222</link>
      <description>&lt;P&gt;Yes, you can send me the complete source. You can attached that to a reply here (publicly for all to access) or for secure access (Intel only) send me a private reply (via &lt;STRONG&gt;Send Author A Message &lt;/STRONG&gt;link) and attach the file to the private reply.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2014 09:02:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016261#M36222</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2014-12-11T09:02:59Z</dc:date>
    </item>
    <item>
      <title>Thanks, I lucky solved the</title>
      <link>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016262#M36223</link>
      <description>&lt;P&gt;Thanks, I lucky solved the problem after I compile the program with static link:)&amp;nbsp;&lt;/P&gt;

&lt;P&gt;But I am now facing a new problem: In the offload area like below&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;int *a=(int *)_mm_malloc(100*sizeof(double),64);

#pragma offload target(mic:0) in(a:length(100))
{
...
_mm512_mask_load_epi64(.. , writemask , &amp;amp;(a[3]));
}

&lt;/PRE&gt;

&lt;P&gt;it produces error"&amp;nbsp;process on the device 0 was terminated by signal 11 (SIGSEGV)"&lt;/P&gt;

&lt;P&gt;I looked up in the Intel doc and found &amp;nbsp;that the 3th argument of&amp;nbsp;_mm512_mask_load_epi64 function should be a&amp;nbsp;&amp;nbsp;64-byte-aligned address. But I have already make pointer a&amp;nbsp;&lt;SPAN style="line-height: 19.5120010375977px;"&gt;aligned&amp;nbsp;&lt;/SPAN&gt;in the _mm_malloc&amp;nbsp;function.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2014 11:39:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016262#M36223</guid>
      <dc:creator>Vincent_L_</dc:creator>
      <dc:date>2014-12-11T11:39:22Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016263#M36224</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;But I have already make pointer a&amp;nbsp;aligned&amp;nbsp;in the _mm_malloc&amp;nbsp;function.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;If a is 64 bytes aligned, then &amp;amp;a[3] (where a is of type double, so each element occupies eight bytes) is guaranteed to be at a 24 byte offset from 64 byte alignment...&lt;/P&gt;

&lt;P&gt;You need an offload expert (which I am not) to tell you whether the alignment that you specified on the host is guaranteed to be implemented on the target, though.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2014 11:59:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/cannot-load-library-to-the-device-0-error-code-5/m-p/1016263#M36224</guid>
      <dc:creator>James_C_Intel2</dc:creator>
      <dc:date>2014-12-11T11:59:00Z</dc:date>
    </item>
  </channel>
</rss>

