How to set ulimit -l on MIC cards?

How to set ulimit -l on MIC cards?


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. 


12 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


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

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

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


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. 


bustaf wrote:

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

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. 


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

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

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.

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/ ] && . /etc/" 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.

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 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.


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

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

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? 

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 where I believe that should be “” 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/ 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/ ] && . /etc/

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/ etc/ 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

Leave a Comment

Please sign in to add a comment. Not a member? Join today