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 https://github.com/pytorch/pytorch.git 20 in my machine,
run “python setup.py 3 install” (“python3 setup.py 3 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.