Jetpack 4.6: How to increase maximum stacksize limited to 1024


I work with a Jetson TX2 to do autonomous robotic (f1tenth). I recently upgraded JetPack to 4.6 and I can’t compile some ROS packages (cartographer ros and hector slam) since that because of a segmentation fault error. After some research I found that topic : Error when trying to compile on nvidia xavier AGX. Hence I tried to upgrade gcc and g++ to 8.4 and I tried to increase the stack size with ulimit but without success.
Then, I discovered this topic : Jetpack 4.6: Maximum stacksize limited to 1024 causing stackoverflow in gcc. I am pretty sure that it’s my problem. Hence, is it possible to change the stack size with this Nvidia limit ? I have already tried ulimit -s unlimited, ulimit -s xxxx and sudo bash -c "ulimit -s xxxx" but either I have an error or it does nothing.

Thanks !

Did you try modify the /etc/security/limits.conf and reboot the system to try?


For now we manually modify the /etc/security/limits.conf to change the stacksize from 1024 to 8192 for all the listed users in that file. But I guess you could also remove the lines at the end of the file so that default values will be taken?

This answer has some good explanations on how to use ulimit and /etc/security/limits.conf


It worked perfectly, thanks !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.