Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MrRainsdRop opened this issue May 26, 2022 · 4 comments
Open

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

MrRainsdRop opened this issue May 26, 2022 · 4 comments

Comments

@MrRainsdRop
Copy link

MrRainsdRop commented May 26, 2022

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)

@MrRainsdRop MrRainsdRop changed the title Segmentation error occurred 我、hen I try to run the Segmentation error occurred when I try to run the May 26, 2022
@MrRainsdRop MrRainsdRop changed the title Segmentation error occurred when I try to run the Segmentation error occurred when I try to run the test.sh May 26, 2022
@nagadomi
Copy link
Owner

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
Copy link
Author

Yes, here are the running results:

/home/rainsdrop/study# th -e "print('torch loaded succesfully')"
torch loaded succesfully
Segmentation fault

@nagadomi
Copy link
Owner

nagadomi commented May 27, 2022

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?)
nagadomi/waifu2x#253 (comment)
I don't know any more than this about that.

@MrRainsdRop
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants