When running in a CUDA environment, the following error occurred.
(py37) tsuyoshi@Jupiter:~/work/ruby/torch.rb$ bundle exec ruby examples/mnist/main.rb
Device type: cuda
/home/tsuyoshi/.rvm/rubies/ruby-2.7.2/bin/ruby: symbol lookup error: /home/tsuyoshi/work/ruby/torch.rb/lib/torch/ext.so: undefined symbol: _ZN5torch5utils14cuda_lazy_initEv`
Looking for the symbol, it seems to be in libtorch_python.so, but when I link it, it depends on Python.
As a test, I removed the call to the function that would call this symbol and it worked.
Hey @golirev, thanks for reporting and great investigative work! It looks like that function is Python-specific/not needed. I've confirmed it fixes it and will push out a new release shortly.
When running in a CUDA environment, the following error occurred.
Looking for the symbol, it seems to be in libtorch_python.so, but when I link it, it depends on Python. As a test, I removed the call to the function that would call this symbol and it worked.
Ubuntu-18.04 CUDA 10.1 libtorch-cxx11-abi-shared-with-deps-1.7.0+cu101.zip Ruby 2.7.2 torch.rb-0.5.1