Repository: pytorch
Issue: getting error error: namespace "cub" has no member "Debug" when try to build v1.8.2 with CUDA 11.6
Labels: module: cuda,triaged

### 🐛 Describe the bug

I am trying to build pytorch v1.8.2 with CUDA 11.6 but i am getting error: namespace "cub" has no member "Debug". i see there is post https://github.com/pytorch/pytorch/pull/66219 for similar issue but I am not able to fix the error with the information. just wondering if it's possible to build pytorch v1.8.2 with CUDA 11.6? 

i ran below command with branch v1.8.2 checkout

USE_LMDB=1 USE_OPENCV=1 MAX_JOBS=2 python setup.py bdist_wheel

and got below error:-

/usr/local/cuda/include/cub/device/dispatch/dispatch_select_if.cuh(417): error: namespace "cub" has no member "Debug"
          detected during:
            instantiation of "cudaError_t at::native::cub::DeviceSelect::Flagged(void *, size_t &, InputIteratorT, FlagIterator, OutputIteratorT, NumSelectedIteratorT, int, cudaStream_t, __nv_bool) [with InputIteratorT=at::native::cub::CountingInputIterator<int64_t, ptrdiff_t>, FlagIterator=at::native::cub::TransformInputIterator<__nv_bool, at::native::<unnamed>::NonZeroOp<uint8_t>, uint8_t *, ptrdiff_t>, OutputIteratorT=int64_t *, NumSelectedIteratorT=int *]"
/home/mx/projs/pytorch/aten/src/ATen/native/cuda/Nonzero.cu(75): here
            instantiation of "void at::native::nonzero_cuda_out_impl<scalar_t>(const at::Tensor &, at::Tensor &) [with scalar_t=uint8_t]"
/home/mx/projs/pytorch/aten/src/ATen/native/cuda/Nonzero.cu(107): here

49 errors detected in the compilation of "/home/mx/projs/pytorch/aten/src/ATen/native/cuda/Nonzero.cu".
CMake Error at torch_cuda_generated_Nonzero.cu.o.Release.cmake:281 (message):
  Error generating file
  /home/mx/projs/pytorch/build/caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/ATen/native/cuda/./torch_cuda_generated_Nonzero.cu.o
[5044/6004] Building NVCC (Device) obj...cuda_generated_PointwiseOpsKernel.cu.o
ninja: build stopped: subcommand failed.
Traceback (most recent call last):

### Versions

PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.5 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.22.1
Libc version: glibc-2.31

Python version: 3.8.10 (default, Jun  4 2021, 15:09:15)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.15.0-52-generic-x86_64-with-glibc2.17
Is CUDA available: N/A
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3070
Nvidia driver version: 510.85.02
cuDNN version: Probably one of the following:
/usr/local/cuda-11.6/targets/x86_64-linux/lib/libcudnn.so.8.4.1
/usr/local/cuda-11.6/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.4.1
/usr/local/cuda-11.6/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.4.1
/usr/local/cuda-11.6/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.4.1
/usr/local/cuda-11.6/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.4.1
/usr/local/cuda-11.6/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.4.1
/usr/local/cuda-11.6/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.4.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A

Versions of relevant libraries:
[pip3] numpy==1.23.3
[conda] blas                      1.0                         mkl  
[conda] magma-cuda116             2.6.1                         1    pytorch
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-include               2022.1.0           h06a4308_224  
[conda] mkl-service               2.4.0            py38h7f8727e_0  
[conda] mkl_fft                   1.3.1            py38hd3c417c_0  
[conda] mkl_random                1.2.2            py38h51133e4_0  
[conda] numpy                     1.23.3           py38h14f4228_0  
[conda] numpy-base                1.23.3           py38h31eccc5_0  


cc @ngimel