Repository: pytorch
Issue: Latest PyTorch is not buildable against CUDA-11.2
Labels: module: sparse,module: build,module: cuda,triaged

### 🐛 Describe the bug

When I am trying to compile pytorch with the instructions on the main page I am getting this error.I am using gcc-10 and g++-10
`[58/477] Building CUDA object caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/ATen/native/sparse/cuda/SparseSemiStructuredLinear.cu.o
FAILED: caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/ATen/native/sparse/cuda/SparseSemiStructuredLinear.cu.o 
/usr/local/cuda-11.2/bin/nvcc -forward-unknown-to-host-compiler -DAT_PER_OPERATOR_HEADERS -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DIDEEP_USE_MKL -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DTORCH_CUDA_BUILD_MAIN_LIB -DUSE_C10D_GLOO -DUSE_C10D_MPI -DUSE_C10D_NCCL -DUSE_CUDA -DUSE_DISTRIBUTED -DUSE_EXPERIMENTAL_CUDNN_V8_API -DUSE_EXTERNAL_MZCRC -DUSE_NCCL -DUSE_RPC -DUSE_TENSORPIPE -D_FILE_OFFSET_BITS=64 -Dtorch_cuda_EXPORTS -I/home/<user>/open_source/pytorch/build/aten/src -I/home/<user>/open_source/pytorch/aten/src -I/home/<user>/open_source/pytorch/build -I/home/<user>/open_source/pytorch -I/home/<user>/open_source/pytorch/cmake/../third_party/benchmark/include -I/home/<user>/open_source/pytorch/third_party/onnx -I/home/<user>/open_source/pytorch/build/third_party/onnx -I/home/<user>/open_source/pytorch/third_party/foxi -I/home/<user>/open_source/pytorch/build/third_party/foxi -I/home/<user>/open_source/pytorch/aten/src/THC -I/home/<user>/open_source/pytorch/aten/src/ATen/cuda -I/home/<user>/open_source/pytorch/aten/src/ATen/../../../third_party/cutlass/include -I/home/<user>/open_source/pytorch/build/caffe2/aten/src -I/home/<user>/open_source/pytorch/aten/src/ATen/.. -I/home/<user>/open_source/pytorch/build/nccl/include -I/home/<user>/open_source/pytorch/c10/cuda/../.. -I/home/<user>/open_source/pytorch/c10/.. -I/home/<user>/open_source/pytorch/third_party/tensorpipe -I/home/<user>/open_source/pytorch/build/third_party/tensorpipe -I/home/<user>/open_source/pytorch/third_party/tensorpipe/third_party/libnop/include -I/home/<user>/open_source/pytorch/torch/csrc/api -I/home/<user>/open_source/pytorch/torch/csrc/api/include -isystem /home/<user>/open_source/pytorch/build/third_party/gloo -isystem /home/<user>/open_source/pytorch/cmake/../third_party/gloo -isystem /home/<user>/open_source/pytorch/cmake/../third_party/tensorpipe/third_party/libuv/include -isystem /home/<user>/open_source/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /home/<user>/open_source/pytorch/cmake/../third_party/googletest/googletest/include -isystem /home/<user>/open_source/pytorch/third_party/protobuf/src -isystem /home/<user>/anaconda3/envs/pytorch/include -isystem /home/<user>/open_source/pytorch/third_party/gemmlowp -isystem /home/<user>/open_source/pytorch/third_party/neon2sse -isystem /home/<user>/open_source/pytorch/third_party/XNNPACK/include -isystem /home/<user>/open_source/pytorch/third_party/ittapi/include -isystem /home/<user>/open_source/pytorch/cmake/../third_party/eigen -isystem /usr/local/cuda-11.2/include -isystem /home/<user>/open_source/pytorch/third_party/ideep/mkl-dnn/include/oneapi/dnnl -isystem /home/<user>/open_source/pytorch/third_party/ideep/include -isystem /home/<user>/open_source/pytorch/cmake/../third_party/cudnn_frontend/include -D_GLIBCXX_USE_CXX11_ABI=1 -Xfatbin -compress-all -DONNX_NAMESPACE=onnx_torch -gencode arch=compute_86,code=sm_86 -gencode arch=compute_86,code=compute_86 -Xcudafe --diag_suppress=cc_clobber_ignored,--diag_suppress=field_without_dll_interface,--diag_suppress=base_class_has_different_dll_interface,--diag_suppress=dll_interface_conflict_none_assumed,--diag_suppress=dll_interface_conflict_dllexport_assumed,--diag_suppress=bad_friend_decl --expt-relaxed-constexpr --expt-extended-lambda  -Wno-deprecated-gpu-targets --expt-extended-lambda -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -O3 -DNDEBUG -std=c++17 -Xcompiler=-fPIC -DMKL_HAS_SBGEMM -DTORCH_USE_LIBUV -DCAFFE2_USE_GLOO -Xcompiler=-Wall,-Wextra,-Wdeprecated,-Wno-unused-parameter,-Wno-unused-function,-Wno-missing-field-initializers,-Wno-unknown-pragmas,-Wno-type-limits,-Wno-array-bounds,-Wno-unknown-pragmas,-Wno-strict-overflow,-Wno-strict-aliasing,-Wno-maybe-uninitialized -Wno-deprecated-copy -MD -MT caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/ATen/native/sparse/cuda/SparseSemiStructuredLinear.cu.o -MF caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/ATen/native/sparse/cuda/SparseSemiStructuredLinear.cu.o.d -x cu -c /home/<user>/open_source/pytorch/aten/src/ATen/native/sparse/cuda/SparseSemiStructuredLinear.cu -o caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/ATen/native/sparse/cuda/SparseSemiStructuredLinear.cu.o
/home/<user>/open_source/pytorch/aten/src/ATen/../../../third_party/cutlass/include/cutlass/subbyte_reference.h:650:19: error: expected ‘;’ at end of member declaration
  650 |   StorageVecPointer ptr_;
      |                   ^~~~
      |                       ;
/home/<user>/open_source/pytorch/aten/src/ATen/../../../third_party/cutlass/include/cutlass/subbyte_reference.h:650:23: error: expected unqualified-id before ‘)’ token
  650 |   StorageVecPointer ptr_;
      |                       ^
/home/<user>/open_source/pytorch/aten/src/ATen/../../../third_party/cutlass/include/cutlass/subbyte_reference.h:1025:19: error: expected ‘;’ at end of member declaration
 1025 |   StorageVecPointer ptr_;
      |                   ^~~~
      |                       ;
/home/<user>/open_source/pytorch/aten/src/ATen/../../../third_party/cutlass/include/cutlass/subbyte_reference.h:1025:23: error: expected unqualified-id before ‘)’ token
 1025 |   StorageVecPointer ptr_;
      |                       ^
ninja: build stopped: subcommand failed.`

### Versions

Collecting environment information...
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 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 10.5.0-1ubuntu1~22.04) 10.5.0
Clang version: Could not collect
CMake version: version 3.22.1
Libc version: glibc-2.35

Python version: 3.10.9 (main, Mar  1 2023, 18:23:06) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.4.0-060400-generic-x86_64-with-glibc2.35
Is CUDA available: N/A
CUDA runtime version: 11.2.67
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: 
GPU 0: NVIDIA GeForce RTX 4090
GPU 1: NVIDIA GeForce RTX 4090

Nvidia driver version: 535.146.02
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.1.1
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.1.0
/usr/local/cuda-11.2/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.1.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Address sizes:                   48 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          32
On-line CPU(s) list:             0-31
Vendor ID:                       AuthenticAMD
Model name:                      AMD Ryzen 9 5950X 16-Core Processor
CPU family:                      25
Model:                           33
Thread(s) per core:              2
Core(s) per socket:              16
Socket(s):                       1
Stepping:                        0
Frequency boost:                 enabled
CPU max MHz:                     5083,3979
CPU min MHz:                     2200,0000
BogoMIPS:                        6786.96
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
Virtualization:                  AMD-V
L1d cache:                       512 KiB (16 instances)
L1i cache:                       512 KiB (16 instances)
L2 cache:                        8 MiB (16 instances)
L3 cache:                        64 MiB (2 instances)
NUMA node(s):                    1
NUMA node0 CPU(s):               0-31
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Mmio stale data:   Not affected
Vulnerability Retbleed:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP always-on, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected

Versions of relevant libraries:
[pip3] flake8==6.0.0
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.23.5
[pip3] numpydoc==1.5.0
[pip3] torch==1.12.1
[pip3] tritonclient==2.38.0.69485441
[conda] blas                      1.0                         mkl  
[conda] cudatoolkit               11.8.0               h6a678d5_0  
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-service               2.4.0           py310h7f8727e_0  
[conda] mkl_fft                   1.3.1           py310hd6ae3a3_0  
[conda] mkl_random                1.2.2           py310h00e6091_0  
[conda] numpy                     1.23.5          py310hd5efca6_0  
[conda] numpy-base                1.23.5          py310h8e6c178_0  
[conda] numpydoc                  1.5.0           py310h06a4308_0  
[conda] pytorch                   1.12.1          cpu_py310hb1f1ab4_1  
[conda] tritonclient              2.38.0.69485441          pypi_0    pypi


cc @alexsamardzic @nikitaved @pearu @cpuhrsch @amjames @bhosmer @jcaip @malfet @seemethere @ptrblck @jbschlosser @erichan1 @drisspg @mikaylagawarecki @mruberry @rgommers @pmeier @asmeurer @leofang @AnirudhDagar @asi1024 @emcastillo @kmaehashi