Help core dumped problem!

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.

1 Like

Thank you. It seems to be specific to AMD Athlon CPU. I will take a look.

I’ve opened an issue here:

Thanks for the response. BTW, I forgot mention to OS of my computer, which is Linux Ubuntu 16.10.

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 for instructions.
error: command ‘gcc’ failed with exit status 1

what is the result of the command:

which gcc

root@venus:/home/chun/Prog/PyTorch/pytorch# which gcc

This gcc comes from anaconda2, not the gcc comes from ubuntu 16.10.

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!

1 Like

Summary of the solution on my last post.

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 in my machine,
run “python install” (“python3 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.

1 Like

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.

1 Like

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

please help
Below is what i get in ipython

@Vijay_Dubey your system is too old. Build pytorch from source manually for your system:

I built from source and problem is gone

lou1@lou1:/proc$ uname -a
Linux lou1 4.4.0-104-generic #127-Ubuntu SMP Mon Dec 11 12:16:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
lou1@lou1:/proc$ cat cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Pentium® Dual-Core CPU E5300 @ 2.60GHz
stepping : 10
microcode : 0xa07
cpu MHz : 1603.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm tpr_shadow vnmi flexpriority dtherm
bugs :
bogomips : 5199.80
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

processor : 1