Tuesday, 17 March 2015

How to add a native user to the Xeon Phi Co-processor ?

In this post I will be discussing on how to add a new user to the Xeon Phi Co-processor. While using the offload programming model of the Xeon Phi co-processor system, a new user account is not essential for running programs. Offloaded programming model uses a default user called as micuser to execute the programs on the Xeon Phi. But, while running native programs, a programmer might have to get a new user account to do so, inorder to login/ ssh into the co-processor itself.

The  system administration guide by Intel  for Xeon Phi states that, "Users will automatically be added to the /etc/passwd file for the coprocessor if they have an entry in the host’s /etc/passwd file, the user authentication method is set to local and their user id falls in the range specified in the /etc/sysconfig/mic/default.conf file.
(See “User Access” in Intel® Manycore Platform Software Stack (Intel® MPSS) Boot Configuration Guide.)
At the same time, a home directory will be created for them in the disk image used to make the co-processor’s RAM file system"

However, in my case it was not so. And i had to try the other methods suggested.

Since the first method didnot work, i tried the second suggestion which says users can also be added to the co-processor’s /etc/passwd file using the micctrl --useradd command.

micctrl --useradd=<username> --uid=<uid> --gid=<gid> [--home=<dir>] [--comment=<string>] [--app=<exec>] [--sshkeys=<keyloc] [MIC list]

The user name, user ID and group ID must be supplied. If home is not set to the home directory of the user, then /home/<name> will be used.  If a comment is not entered then 'User Account <name>' will be entered in this field.  The default start application is /bin/sh if no other is entered.  The 'sshkeys' parameter allows the specification of a directory to find the users ssh keys.

example :  micctrl --useradd=tejeswini  --uid=10058 --gid=10058 --home=path/to/home/dir/ mic0

Note: The gid and uid can be obtained by typing "id" on the terminal. 

You ought to reboot the system by typing

service mpss stop 
micctrl --reboot mic0
service mpss start

however it didn't allow me to ssh into xeon phi after this. I, also tried micctrl --passwd=<username> mic0 to change the password and unfortunately, nothing changed.

The next method we tried was logging into xeon phi as root by

$ ssh root@mic0
password: *******
[root@<hostname>-mic0 /]# useradd tejeswini
New password : *******
Retype New password: *******
[root@<hostname>-mic0 /]# su - tejeswini
[root@<hostname>-mic0 /]# exit
[tejeswini@<hostname>]$ ssh tejeswini@mic0
password for tejeswini@mic0 : *******

This worked. And it was that simple!! I am still trying to figure out how to make the first two methods work. Do leave a comment if you  have any suggestions.

No comments:

Post a Comment