Pytorch on jetson tx1

Hi Experts

Have anybody succcesfully installed Pytorch on Jetson Tx1?

Looking for a script.

I have already tried the following (with errors):

I tried the script by Dusty_nv:

https://gist.github.com/dusty-nv/ef2b372301c00c0a9d3203e42fd83426

But when I ran: python setup.py build_deps

I got the following error:

[ 37%] Building CXX object caffe2/CMakeFiles/caffe2.dir/operators/rsqrt_op.cc.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
caffe2/CMakeFiles/caffe2.dir/build.make:4998: recipe for target ‘caffe2/CMakeFiles/caffe2.dir/utils/math_cpu.cc.o’ failed
make[2]: *** [caffe2/CMakeFiles/caffe2.dir/utils/math_cpu.cc.o] Error 4
make[2]: *** Waiting for unfinished jobs…
CMakeFiles/Makefile2:2800: recipe for target ‘caffe2/CMakeFiles/caffe2.dir/all’ failed
make[1]: *** [caffe2/CMakeFiles/caffe2.dir/all] Error 2
Makefile:138: recipe for target ‘all’ failed
make: *** [all] Error 2
Failed to run ‘bash …/tools/build_pytorch_libs.sh --use-cuda --use-nnpack nccl caffe2 libshm gloo c10d THD’

Any hints?

Thanks

sojohans

Hi sojohans,

Are you able to monitor the memory usage while compiling PyTorch? (you can do this using the ‘top’ or ‘~/tegrastats’ command)

I would guess that the TX1 is running out of memory when compiling PyTorch. You can see this discussion

https://gist.github.com/dusty-nv/ef2b372301c00c0a9d3203e42fd83426#gistcomment-2061659

If this is the case you can create a swap file. Let me know if you need help here.

Thanks,
John

Hej John

Thanks for the hints.

I will try to see if I can run ~/tegrasetats during the compilation.

If you have guide for making a swapfile I would be very happy…

sojohans

ps. I am using a microsd as bootfs

Sure,

To create 4GB of swap you could do the following

sudo fallocate -l 4G /mnt/swapfile
sudo chmod 600 /mnt/swapfile
sudo mkswap /mnt/swapfile
sudo swapon /mnt/swapfile

After this, you should see 4GB of swap memory when visualizing memory usage with the ‘top’ command.

Once you’re done building, you may want to free up this disk space used for the swap memory. To release and delete the swapfile you could then do.

sudo swapoff /mnt/swapfile
sudo rm /mnt/swapfile

You can also check this guide

https://support.rackspace.com/how-to/create-a-linux-swap-file/

Let me know if you have any other questions.

John

Hi John

That helped.

I was now able install pytorch.

Thank you very much.

Sojohans