Hi, albanD:
I actually have built PyTorch with Cuda 10.0, however, it’s still quite complicated.
My commands are:
TORCH_CUDA_ARCH_LIST="5.2" NO_TEST=1 USE_MKLDNN=1 FULL_CAFFE2=1 python setup.py build
TORCH_CUDA_ARCH_LIST="5.2" NO_TEST=1 USE_MKLDNN=1 FULL_CAFFE2=1 python setup.py install

However, after the installation, I failed to test caffe2 with GPU support…

from caffe2.python import core
WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode.
CRITICAL:root:Cannot load caffe2.python. Error: ~/.local/lib/python3.6/site-packages/caffe2/python/caffe2_pybind11_state.cpython-36m-x86_64-linux-gnu.so: undefined symbol: mkldnn_primitive_destroy

Where can I set MKL directories in setup.py?
I mean, if I want to build pytorch with the command python setup.py build, how can I specify the directories for MKLDNN_ROOT, etc.?
Some more pre-configuration is:

$ TORCH_CUDA_ARCH_LIST=“5.2” USE_MKLDNN=1 FULL_CAFFE2=1 python setup.py build           
Building wheel torch-1.0.0a0+a78c6c4
running build
running build_deps
setup.py::build_deps::run()

SYNC_COMMAND=cp
++ command -v rsync
‘[’ -x /usr/bin/rsync ‘]’
SYNC_COMMAND=‘rsync -lptgoD’
USE_CUDA=1
USE_ROCM=0
USE_NNPACK=0
USE_MKLDNN=1
USE_GLOO_IBVERBS=0
CAFFE2_STATIC_LINK_CUDA=0
RERUN_CMAKE=1
[[ 8 -gt 0 ]]
case “$1” in
USE_CUDA=1
shift
[[ 7 -gt 0 ]]
case “$1” in
USE_NNPACK=1
shift
[[ 6 -gt 0 ]]
case “$1” in
break
CMAKE_INSTALL=‘make install’
BUILD_SHARED_LIBS=ON
USER_CFLAGS=
USER_LDFLAGS=
[[ -n ‘’ ]]
[[ -n ‘’ ]]
[[ -n ‘’ ]]
++ uname
‘[’ Linux == Darwin ‘]’
+++ dirname …/tools/build_pytorch_libs.sh
++ cd …/tools/…
+++ pwd