sugarme / gotch

Go binding for Pytorch C++ API (libtorch)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install issue on Amazon Cloud

Claus1 opened this issue · comments

[ec2-user@ip-172-31-1-42 ~]$ export CUDA_VER=cpu && bash setup-libtorch.sh
https://download.pytorch.org/libtorch/cucpu/libtorch-cxx11-abi-shared-with-deps-1.7.0%2Bcucpu.zip
wget: unrecognized option '--show-progress'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
unzip: cannot find or open /tmp/libtorch-cxx11-abi-shared-with-deps-1.7.0%2Bcucpu.zip, /tmp/libtorch-cxx11-abi-shared-with-deps-1.7.0%2Bcucpu.zip.zip or /tmp/libtorch-cxx11-abi-shared-with-deps-1.7.0%2Bcucpu.zip.ZIP.
rm: cannot remove ‘/tmp/libtorch-cxx11-abi-shared-with-deps-1.7.0%2Bcucpu.zip’: No such file or directory

I wanted to install the libs because terrible issues forced me to do it.

  1. I can not use dynamic torch libraries on amazon with compiled gotch (go build command). It seems no way to copy .so torch libraries to some place and force the program to use them.
  2. I tried to make static version and get rid of libraries but it again was impossible . ld does not allow to make, although I gave it all possible options and more.
examples/engine$ go build -ldflags "-linkmode external -extldflags -static" *.go
# command-line-arguments
/usr/local/go/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
/usr/bin/ld: cannot find -ltorch
/usr/bin/ld: cannot find -lc10
/usr/bin/ld: cannot find -ltorch_cpu
collect2: error: ld returned 1 exit status

The paths was configured as recommended and only using the program on Amazon and for static building brings problems.

@Claus1 ,

AWS is quite immense and I guess you was using ec2 deployment. I think the issue here is Dev/Op in general rather than gotch issue. You can either ssh to your instance and directly install/setup whatever you want to do or you can deploy with docker container or similar stack. FYI, we successfully deployed gotch with libtorch CPU/GPU support in various clouds, CPU AMD/ARM64. Also, gotch can run successfully on google colab for both CPU/GPU in Golang interactive mode similar to Python. Here is a gotch startup notebook on Colab that you may try and see how to apply the setup to your own issue.

There's a incomplete repo gotch-docker if you want to start building your own for deployment purpose. Feel free to contribute.

If you want further dicussion, please post in discussion section of github and other people can help/learn. I will close #44 for now.