Software Archive
Read-only legacy content

How to set ulimit -l on MIC cards?

Fiona_R_
Beginner
1,104 Views

Hello, 

I'm currently having some problems getting a code to run on our MIC cards. The same binary runs on two other MIC's and the only difference I can see between the systems is that our system has the amount of locked memory set to 64kb (e.g ulimit -a | grep locked gives "-l: locked memory (kb) 64" whereaas the other two cards have this set as unlimited. I don't have permission to change the amount of locked memory so need my Sysadmin to do this. 

Our Sysadmin can change the limit whilst he is logged in but as soon as he logs out it goes back to 64kb. Can anyone advise how to change the ulimit values on a MIC permanently? e.g. which file needs edited etc? Apologies if this is a daft question. 

Thanks in advance. 

Fiona

0 Kudos
11 Replies
Loc_N_Intel
Employee
1,104 Views

Hello,

Let me investigate this issue. I will get back to you as soon as I have any update. Thank you.

0 Kudos
Frances_R_Intel
Employee
1,104 Views

When the code doesn't run, what does it do? Do you get an error message?

0 Kudos
aazue
New Contributor I
1,104 Views

Hi
Normally on an Unix system you have file
(/etc/security/limits.conf) where this parameters are defined.
Regards

0 Kudos
Fiona_R_
Beginner
1,104 Views

Frances Roth (Intel) wrote:

When the code doesn't run, what does it do? Do you get an error message?

No error, the code just hangs. I've tested the same binary on two other MIC cards and it runs without any issue. 

0 Kudos
Fiona_R_
Beginner
1,104 Views

bustaf wrote:

Hi
Normally on an Unix system you have file
(/etc/security/limits.conf) where this parameters are defined.
Regards

That's exactly what my Sysadmin looked for, however on the MIC the file /etc/security/limits.conf doesn't exist so you must have to change the ulimit values using a different file/ method. I have access to 3 different sets of MIC cards and all 3 do not have this file. 

0 Kudos
aazue
New Contributor I
1,104 Views

Hi

Without system card in my hands not easy ...
have you a  file (/etc/sysconfig/ulimit) ?
Regards

See  the script on this link, maybe ,he will help you

http://virtecde.h56598.serverkompetenz.net/femod/Sicherung/etc/initscript

With my old head that not able to remember  all ,now ..
not realy  sure... but I think in RPC
ulimit would be not being applied when logged in SSH.

0 Kudos
Loc_N_Intel
Employee
1,104 Views

Hi Fiona,

Our MPSS experts used the instructions below to set ulimit on card boot:

1) sudo cp /opt/intel/mic/filesystem/base/etc/rc.d/rc.sysinit /opt/intel/mic/filesystem/common/etc/rc.d/rc.sysinit

2) Edit the file /opt/intel/mic/filesystem/common/etc/rc.d/rc.sysinit as root (use sudo).

3) Add the line "[ -x /etc/limits.sh ] && . /etc/limits.sh" before the "echo -n "Start runlevel 3 services..."

4) Save and exit.

5) Create and edit a file in "/opt/intel/mic/filesystem/common/etc/" called "limits.conf".

6) Add the line "ulimit -n 4096" (or whatever ulimit value is needed to run a workload).

7) Save and exit the new file.

8) Edit as root "/opt/intel/mic/filesystem/common.filelist" (use sudo); this file may be empty.

9) Add the 2 lines below to the end of this file:

     file /etc/rc.d/rc.sysinit etc/rc.d/rc.sysinit 0755 0 0

     file /etc/limits.conf etc/limits.conf 0744 0 0

10) Save and exit.

11) Restart the mpss service.

Hope this helps. Thanks.

0 Kudos
Fiona_R_
Beginner
1,104 Views

Hi loc-nguyen, 

I can confirm that your method works, many thanks for taking the time to reply. 

Point 9) has a typo though, limits.conf should be limits.sh for both entries. 

Sadly, changing the amount of locked memory hasn't helped with my hanging code, it still stops at the same point, no errors etc but at least we've elimnated the amount of locked memory now.

Thank you very much to everyone who replied.

Fiona 

0 Kudos
TimP
Honored Contributor III
1,104 Views

I'm not verifying the effect of applying this to ulimit -s.  When I open a new busybox (ssh mic0) I still get

~ $ ulimit -s
8192

If you were to change the file name in common.filelist, would you not need to change it also in common/etc/ ?

0 Kudos
Fiona_R_
Beginner
1,104 Views

Apologies, we didn't try changing the stacksize as usually a regular user has permission to increase that anyway. We only changed the amount of locked memory. 

Someone else might be to answer this though? 

0 Kudos
Kevin_D_Intel
Employee
1,104 Views

As a quick test, I confirmed the stack unlimited setting using a shorter method below. I expect using the common filesystem discussed earlier would work too.

@Tim: Is it possible your non-success was caused by confusion of using both limits.conf and limits.sh where I believe that should be “limits.sh” in all places in the earlier provided instructions?

Operating under a "sudo su" shell, I did the following:

1. Create a new file: /opt/intel/mic/filesystem/base/etc/limits.sh and add this one line to the file:

ulimit -s unlimited

2. Edit the existing file, /opt/intel/mic/filesystem/base/etc/rc.d/rc.sysinit,  and then add this one line:

[ -x /etc/limits.sh ] && . /etc/limits.sh

Just above the line that reads:   echo_info "Start runlevel 3 services"

3. Edit the existing file, /opt/intel/mic/filesystem/base.filelist, and add this one line to the end of the file:

file /etc/limits.sh etc/limits.sh 0744 0 0

4. Restart the MPSS service using:

service mpss stop
service mpss start

5. ssh to the card(s) and verify via: ulimit -a

0 Kudos
Reply