I just download the newly released PyTorch and want to try it.
However, when I run
x = torch.rand(5, 3)
I get “Illegal instruction (core dumped)”, and python prompt exit.
Can anyone help me on this issue? Thanks in advance.
The CPU of my system is AMD Athlon II X4. I added Nvidia GTX 1060 GPU
to the system recently. It can run GPU enabled Tensorflow no problem.
I just tried to install pytorch from source, using the recommended Anaconda environment.
However, I also got segmentation fault error in the middle of compiling. The following piece
of info is where the error comes from:
…
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/chun/Prog/PyTorch/pytorch -I/home/chun/Prog/PyTorch/pytorch/torch/csrc -I/home/chun/Prog/PyTorch/pytorch/torch/lib/tmp_install/include -I/home/chun/Prog/PyTorch/pytorch/torch/lib/tmp_install/include/TH -I/home/chun/Prog/PyTorch/pytorch/torch/lib/tmp_install/include/THPP -I/usr/local/anaconda2/lib/python2.7/site-packages/numpy/core/include -I/usr/local/cuda/include -I/usr/local/cuda/include -I/usr/local/anaconda2/include/python2.7 -c torch/csrc/cudnn/CppWrapper.cpp -o build/temp.linux-x86_64-2.7/torch/csrc/cudnn/CppWrapper.o -D_THP_CORE -std=c++11 -Wno-write-strings -DWITH_NUMPY -DWITH_CUDA -DCUDA_LIB_PATH=/usr/local/cuda/lib64 -DWITH_CUDNN
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from /home/chun/Prog/PyTorch/pytorch/torch/csrc/generic/Tensor.cpp:702:0,
from torch/csrc/generic/Tensor.cpp:1,
from /home/chun/Prog/PyTorch/pytorch/torch/lib/tmp_install/include/THC/THCGenerateAllTypes.h:19,
from torch/csrc/cuda/Tensor.cpp:15:
/home/chun/Prog/PyTorch/pytorch/torch/csrc/generic/TensorMethods.cpp: In function ‘PyObject* THCPShortTensor_addmm(PyObject*, PyObject*, PyObject*)’:
/home/chun/Prog/PyTorch/pytorch/torch/csrc/generic/TensorMethods.cpp:16607:1: internal compiler error: Segmentation fault
}
^
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
error: command ‘gcc’ failed with exit status 1
Gee, I finally successfully compiled and installed pytorch from source!
And I can run “x = torch.rand(5, 3)” no problem now. So that I can start learning PyTorch!
I didn’t use anaconda environment this time.
Instead of it, I used environment on my ubuntu 16.10 system.
The main point is about to which gcc compiler to use!
My system has two versions of gcc, which are gcc-5 (gcc version 5.4.1)
and gcc-6 (gcc version 6.2.0). The default gcc was point to gcc-6, which
doesn’t work with cuda 8.0 (in my system). So I use update-alternatives
changed gcc to gcc-5, g++ to g+±5, and x86_64-linux-gnu-gcc to gcc-5
too! Then on git cloned https://github.com/pytorch/pytorch.git in my machine,
run “python setup.py install” (“python3 setup.py install” for python 3.5),
which successfully compiled and installed pytorch finally! The gcc version
in the recommended anaconda environment is 4.4.7, which is a bit old.
I also just tried the latest binary package pytorch 0.1.7 post2, which still
get “Illegal instruction (core dumped)” error when run “x = torch.rand(5, 3)”.
I think this case can be closed if the above solution is verified by the pytorch team.
Great to hear that it works for you now! We’re aware that building from source will solve the problem, yet it would be good to have binary packages that work on any CPU architecture. We’ll keep the issue open util it’s fixed.
Hi everyone
I am also getting the same problems when i installed pytorch with anaconda using
conda install pytorch torchvision cuda80 -c soumith
I did the same process as I did it in My laptop. It works completely fine in my laptop but gives the above error
x = torch.rand(5, 3)
I get “Illegal instruction (core dumped)”, and python prompt exit.
I dont know why. Please help
The specifications of my PC are:
Ubuntu 16.04
Processor : Intel® Core™2 Duo CPU E6550 @ 2.33GHz × 2
Graphics : Intel® Q35
OS type : 64-bit @smth@Chun_Li@apaszke