Software Archive
Read-only legacy content
17061 Discussions

Cannot execute binary error on an Intel Xeon Phi

Michail_P_
Beginner
575 Views

I am having a C code that compiles and runs properly locally on my machine.
But when I am trying to compile with the icc and the -mmic flag and test it on Intel Xeon Phi, I am getting the following message:

***/cm/local/apps/sge/current/spool/node079/job_scripts/5438755: line 14: ./sequential.mic: cannot execute binary file***


I run all my tests in a cluster which uses SGE job submission system.

**My makefile contains these lines:**

    sequential: Makefile
    icc -mmic -o sequential.mic sequential.c
    qsub sequential.job

***The job file for submitting the job is:***

    #!/bin/sh
    #$ -S /bin/sh
    #$ -l h_rt=00:10:00
    #$ -j y
    #$ -l fat,accel=XeoPhi
    #$ -cwd

    . /etc/bashrc
    
    module load intel/compiler/64/13.3/2013.3.163

    ./sequential.mic


Notes:

 - If i compile it with gcc and submit it to a regular node (XEON 5620)
   everything works as expected.
 - Also, i tried the file command to examine to the mic executable and the output is : **sequential.mic: ELF 64-bit LSB executable, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.0, not stripped**
 


Any suggestions are more than welcome.

 

0 Kudos
1 Solution
Kevin_D_Intel
Employee
575 Views

Compiling with -mmic and then running the resulting executable natively requires shipping the executable to the coprocessor. Perhaps in your case you can leverage the /usr/bin/micnativeloadex command. Within your batch script change the execution of your program to be this:

/usr/bin/micnativeloadex  ./sequential.mic

View solution in original post

0 Kudos
3 Replies
Kevin_D_Intel
Employee
576 Views

Compiling with -mmic and then running the resulting executable natively requires shipping the executable to the coprocessor. Perhaps in your case you can leverage the /usr/bin/micnativeloadex command. Within your batch script change the execution of your program to be this:

/usr/bin/micnativeloadex  ./sequential.mic

0 Kudos
Michail_P_
Beginner
575 Views

Thank you very much that worked perfectly.

But now I got another issue. The program stores its output to a .txt file that now is not copies back from the Xeon Phi.

Do I need a specific command or something to copied back?

0 Kudos
Kevin_D_Intel
Employee
575 Views

Glad to hear that.

I don't know what capabilities exist for the system you are using. Typically one uses scp to move files to/from the coprocessor. Some have NFS mounted filesystems between the host and coprocessor which enables rather convenient file sharing.

Can you check with the system admins for the system you are using to see if you have 'scp' access to the coprocessor?

If so then it should just be a matter of having your program open/create the output file in a known location (e.g. /tmp), and then you can use scp to pull the file back to the host after the micnativeloadex command has completed.

0 Kudos
Reply