This requires root permissions, so a normal “easybuilder” can’t enable it. He/she would have to talk to the system admin. Once it is activated it is totally transparent for EB (or any other software), provided that the script does a good job in that particular environment, of course.
There are no OS packages required, just the proper support on the kernel. I don’t know exactly when it was introduced, but I see references for it in the kernel since at least 2006 (this is as far as the git logs go for the kernel). There is no standard script but I can share one. First we need to enable support for K1OM in binfmt_misc: echo ':K1OM:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb5:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff:/opt/intel/tools/bin/micrun:' > /proc/sys/fs/binfmt_misc/register We can check that it was properly enabled because there will be a new entry in /proc/sys/fs/binfmt_misc: $> cat /proc/sys/fs/binfmt_misc/K1OM enabled interpreter /opt/intel/tools/bin/micrun flags: offset 0 magic 7f454c460201010000000000000000000200b5 mask fffffffffffefefffffffffffffffffffbffff An example of micrun is here https://software.intel.com/sites/default/files/comment/1734339/micrun.txt or here https://github.com/egaburov/benchamarks/blob/master/CPU/microbench/micrun Both examples assume that the paths are the same (same mount points for the shared filesystem) in the Xeon Phi and in the host. From: <[email protected]> on behalf of Kenneth Hoste <[email protected]> Reply-To: "[email protected]" <[email protected]> Date: Wednesday 1 June 2016 at 10:02 To: "[email protected]" <[email protected]> Subject: Re: [easybuild] Compiling with Intel Xeon Phi (via EasyBuild) On 01/06/16 09:52, Adrian Rodriguez Vilas wrote: I had no idea about binfmt_misc, but it's gonna be really helpful for sure. Thanks a lot for pointing it! Damian: is there a way we can leverage this in EasyBuild, to try and get a better success rate with EasyBuild for building for Xeon Phi? What is needed exactly (minimal kernel version, OS packages installed)? Is there a 'standard' script available (or do you have one that you can share)? regards, Kenneth 2016-06-01 9:46 GMT+02:00 Alvarez, Damian <[email protected]<mailto:[email protected]>>: <sidenote> For those that don’t know about it, binfmt_misc can help a LOT in some/many cases when cross-compiling for Xeon Phi. For instance, compiling HDF5 for Xeon Phi without it is a pain (or used to be, I don’t know if HDF5 now explicitly supports it). But with binfmt_misc it is as easy as for regular x86_64. binfmt_misc is a linux feature that checks for fingerprints in executable files, and if the fingerprint matches one of the registered entries, then one script is executed instead of the binary file. You can use for transparently executing java programs without prepending “java”, to do the same with windows binaries without prepending “wine”, or in this case to use a script to execute a Xeon Phi binary in a local or remote Xeon Phi. If the local host and the Xeon Phi share a file system, the script is particularly easy. Many checks done by configure scripts and/or make files (hdf5 for instance generates a binary that builds a configuration file that is used during the make) are transparently done this way without the cross-compilation getting in your way. </sidenote> On 01/06/16 03:45, "[email protected]<mailto:[email protected]> on behalf of Christopher Samuel" <[email protected]<mailto:[email protected]> on behalf of [email protected]<mailto:[email protected]>> wrote: >On 31/05/16 21:38, Adrian Rodriguez Vilas wrote: > >> It's interesting having this option knowing that most of the compilations for >> the Phi will need extra work? > >To be honest I'm not too surprised, it's pretty much the same situation >as BlueGene/Q where you cannot run binaries built for the host on the >compute nodes as the kernel there checks for a special ELF "note" header >that the IBM patched GNU toolchain adds in. :-/ > >BlueGene/P didn't have that issue which made some cross compilation >tasks easier to deal with. > >All the best, >Chris >-- > Christopher Samuel Senior Systems Administrator > VLSCI - Victorian Life Sciences Computation Initiative > Email: [email protected]<mailto:[email protected]> Phone: +61 (0)3 > 903 55545<tel:%2B61%20%280%293%20903%2055545> > http://www.vlsci.org.au/ http://twitter.com/vlsci ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------ Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender), Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, Prof. Dr. Sebastian M. Schmidt ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------

