nagadomi / distro

Unofficial maintenance repository of Torch7. It supports CUDA10.1, Volta, Turing, Docker https://hub.docker.com/r/nagadomi/torch7
BSD 3-Clause "New" or "Revised" License
201 stars 57 forks source link

Segmentation error occurred when I try to run the test.sh #17

Open MrRainsdRop opened 2 years ago

MrRainsdRop commented 2 years ago

After successfully installing Torch according to the instructions, I try to run test.sh to ensure that all libraries are installed correctly, but the following error occurred:

Using Lua at: /home/rainsdrop/study/torch/install/bin/lua paths loaded succesfully torch loaded succesfully ./test.sh: line 16: 27791 Segmentation fault $LUA -ltorch -e "print('torch loaded succesfully')"

Here are some configurations of my Ubuntu 18.04: Cuda compilation tools, release 10.0, V10.0.130 cmake version 3.23.20220525-g5aa6b9d gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

nagadomi commented 2 years ago

torch7's test.sh was broken before I forked this repo and I don't use it. #3 But it did not have the problem of segmentation fault.

Does the following command also cause segmentation fault?

th -e "print('torch loaded succesfully')"
MrRainsdRop commented 2 years ago

Yes, here are the running results:

/home/rainsdrop/study# th -e "print('torch loaded succesfully')"
torch loaded succesfully
Segmentation fault
nagadomi commented 2 years ago

Maybe there is a problem with dependency libraries or linking. The Docker version(clean install) works fine on Ubuntu 18.04, CUDA 10.

Did you run ~/torch/install/bin/torch-activate command after installation? (Or rebooted or re-logged in?) https://github.com/nagadomi/waifu2x/issues/253#issuecomment-497631624 I don't know any more than this about that.

MrRainsdRop commented 1 year ago

After trying many times I finally got it installed. And I found out why this problem occurs. It's weird and I don't know if this is the root cause of this problem.

After executing bash install-deps, In the next step, you need to choose an execution from ./install.sh TORCH_LUA_VERSION=LUA51 ./install.sh TORCH_LUA_VERSION=LUA52 ./install.sh Of course, the premise is to install the corresponding lua version.

I chose one of the latter two during the previous few installations, which made it appear that the installation was successful in the end, but Segmentation error would appear at runtime. And if the above error does not occur, there will also be an error reminder that there is no installation when trying the require cunn and require cutorch commands.

So I made the last attempt after another failure, and executed ./install.sh instead of the last two steps without changing the other steps. Then a miracle happened, it finally installed and passed the test.sh file perfectly.