Building PyTorch From source. My platform is:

OS: CentOS
CPU: IBM Power8
GPU: NVIDIA P100
CUDA: 9.0
Python: Miniconda 3.6

The error shows up at 86% of NVCC building. The error message starts as:
[ 86%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/native/cuda/caffe2_gpu_generated_SpectralOps.cu.o
/ccs/home/sajaldash/pytorch/aten/src/ATen/cuda/CUDAHalf.cu(27): error: identifier "__half_raw" is undefined

/ccs/home/sajaldash/pytorch/aten/src/ATen/cuda/CUDAHalf.cu(34): error: identifier "__half_raw" is undefined

/ccs/home/sajaldash/pytorch/aten/src/ATen/cuda/CUDAHalf.cu(40): error: identifier "__half_raw" is undefined

/ccs/home/sajaldash/pytorch/aten/src/ATen/cuda/CUDAHalf.cu(46): error: identifier "__half_raw" is undefined

/ccs/home/sajaldash/pytorch/aten/src/ATen/cuda/CUDAHalf.cu(52): error: identifier "__half_raw" is undefined

5 errors detected in the compilation of "/tmp/tmpxft_00008a8e_00000000-6_CUDAHalf.cpp1.ii".
CMake Error at caffe2_gpu_generated_CUDAHalf.cu.o.Release.cmake:279 (message):
  Error generating file
  /ccs/home/sajaldash/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/ATen/cuda/./caffe2_gpu_generated_CUDAHalf.cu.o


The bottom part of the error message is:
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/caffe2_gpu_generated_THCTensorMathScan.cu.o] Error 1
8 errors detected in the compilation of "/tmp/tmpxft_000092b2_00000000-6_THCTensorIndex.cpp1.ii".
CMake Error at caffe2_gpu_generated_THCTensorIndex.cu.o.Release.cmake:279 (message):
  Error generating file
  /ccs/home/sajaldash/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/./caffe2_gpu_generated_THCTensorIndex.cu.o


make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/caffe2_gpu_generated_THCTensorIndex.cu.o] Error 1
6 errors detected in the compilation of "/tmp/tmpxft_00009329_00000000-6_THCTensorMode.cpp1.ii".
CMake Error at caffe2_gpu_generated_THCTensorMode.cu.o.Release.cmake:279 (message):
  Error generating file
  /ccs/home/sajaldash/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/./caffe2_gpu_generated_THCTensorMode.cu.o


make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/__/aten/src/THC/caffe2_gpu_generated_THCTensorMode.cu.o] Error 1
make[1]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/all] Error 2
make: *** [all] Error 2
Failed to run 'bash tools/build_pytorch_libs.sh --use-cuda --use-nnpack nccl caffe2 nanopb libshm gloo THD c10d'


Any idea?