Software Archive
Read-only legacy content
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
17065 Discussions

Offload from dynamic link library

Fedor_Z_
Beginner
93 Views

Hello,

I am new to programming for the Xeon Phi, and I am having trouble getting explicit offload to work when the offload is done in a dynamic-link library. The code fails at run time at the offload location, with a messages:

"offload error: Cannot find host executable
offload error: cannot start process on the device 0 (error code 6)"

If I am setting environment variable OFFLOAD_INIT=on_start I get the next message:

"[Offload] [MIC 0] [File]                    c:\temp\init_xeon.cpp
[Offload] [MIC 0] [Line]                    28
[Offload] [MIC 0] [Tag]                     Tag 0
offload error: cannot create pipeline on the device 0 (error code 14)"

I am using C++ on  Windows Server 2012R2, using Parallel Studio XE 2015 Update 6 Cluster Edition, MPSS version 3.6.1.

A simple example of what I'm trying to do is below :

A basic main program which loads the dynamic library and calls the function in it :

int _tmain(int argc, _TCHAR* argv[])
{
	HINSTANCE hInstLib = LoadLibraryA("TestXeonDll.dll");
 
	_StartDllXeonInit	StartDllXeonInit	= (_StartDllXeonInit)	GetProcAddress(hInstLib, "StartDllXeonInit");
 
 	StartDllXeonInit();
 
 	FreeLibrary(hInstLib);
	
	return 0;
}

And the contents of dynamic library:

void StartDllXeonInit()
{
	init_xeon();
}


void init_xeon()
{
	uint32_t  a = 0;

#pragma offload target(mic) inout(a)
	{
		a += 1;
	}
}

If I do the offload in the main program, it works fine. Any clues as to what I'm doing wrong ?

Thanks,

Fedor.

0 Kudos
1 Reply
Linm_F_
Beginner
93 Views

 Hi,Fedor Z !  

      Nowadays,  I have the same problem with you, have you solved this problem?  

      I'm  nearly crazy about this problem, so I very looking forward your help.

      Thanks !

Reply