P1:"virtual memory exhausted: Cannot allocate memory"

 AWS t2.micro doesn't work for Kaldi install. "virtual memory exhausted: Cannot allocate memory"


I already had running instance from few months back. It didn't have any data or jobs running on it. Just started the instance. My bill for the last month was $16. I had account for a long time but didn't use my account for the last few month.




How to connect to instance? Find the ip address.



If you press connect button, you will get to the terminal. Looks like the AWS terminal is on the East Cost Time Zone.



Second method:

I always use my MacBook terminal to connect. The authentication key/pair was set up a long time ago so skipping this step.



At this point I want to install Kaldi.

git clone https://github.com/kaldi-asr/kaldi.git kaldi --origin upstream
cd kaldi
git pull
cd tools/

Follow INSTALL instructions in tools folder

[ec2-user@ip-172-31-21-212 tools]$ ./extras/check_dependencies.sh
[ec2-user@ip-172-31-21-212 tools]$ sudo yum install gcc-c++ automake autoconf patch sox gcc-gfortran libtool subversion
[ec2-user@ip-172-31-21-212 tools]$ ./extras/check_dependencies.sh
./extras/check_dependencies.sh: zlib is not installed.
./extras/check_dependencies.sh: Intel MKL does not seem to be installed.
... Run extras/install_mkl.sh to install it. Some distros (e.g., Ubuntu 20.04) provide
... a version of MKL via the package manager, but verify that it is up-to-date.
... You can also use other matrix algebra libraries. For information, see:
...   http://kaldi-asr.org/doc/matrixwrap.html
./extras/check_dependencies.sh: Some prerequisites are missing; install them using the command:
 sudo yum install zlib-devel
[ec2-user@ip-172-31-21-212 tools]$ sudo yum install zlib-devel
[ec2-user@ip-172-31-21-212 tools]$ ./extras/check_dependencies.sh
./extras/check_dependencies.sh: Intel MKL does not seem to be installed.
... Run extras/install_mkl.sh to install it. Some distros (e.g., Ubuntu 20.04) provide
... a version of MKL via the package manager, but verify that it is up-to-date.
... You can also use other matrix algebra libraries. For information, see:
...   http://kaldi-asr.org/doc/matrixwrap.html
[ec2-user@ip-172-31-21-212 tools]$
[ec2-user@ip-172-31-21-212 tools]$ ./extras/install_mkl.sh
Complete!
./extras/install_mkl.sh: Configuring ld runtime bindings
+ echo '/opt/intel/lib/intel64
/opt/intel/mkl/lib/intel64'
+ ldconfig
./extras/install_mkl.sh: MKL package intel-mkl-64bit-2020.0-088 was successfully installed
[ec2-user@ip-172-31-21-212 tools]$
vim-min
[ec2-user@ip-172-31-21-212 tools]$ ./extras/check_dependencies.sh
./extras/check_dependencies.sh: all OK.
[ec2-user@ip-172-31-21-212 tools]$

tried

[ec2-user@ip-172-31-21-212 tools]$ make

and

[ec2-user@ip-172-31-21-212 tools]$ make -j 1

error: virtual memory exhausted: Cannot allocate memory

mv -f $depbase.Tpo $depbase.Plo
libtool: compile: g++ -DHAVE_CONFIG_H -I./../include -fno-exceptions -funsigned-char -g -O2 -std=c++11 -MT fst-types.lo -MD -MP -MF .dep
s/fst-types.Tpo -c fst-types.cc -fPIC -DPIC -o .libs/fst-types.o
virtual memory exhausted: Cannot allocate memory
make[3]: *** [fst-types.lo] Error 1
make[3]: Leaving directory `/home/ec2-user/kaldi/tools/openfst-1.7.2/src/lib'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/ec2-user/kaldi/tools/openfst-1.7.2/src'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/ec2-user/kaldi/tools/openfst-1.7.2'
make: *** [openfst_compiled] Error 2
[ec2-user@ip-172-31-21-212 tools]$

Looks like t2.micro doesn't work, as it doesn't have enough virtual memory. Need to redo the process on bigger EC2instance. virtual memory exhausted: Cannot allocate memory

Comments