Insufficient resources when calling cusparseSpGEMM

Max_Unhold: <p>Hello, I am getting the error</p>
<pre><code class="lang-auto">CUDA error: insufficient resources when calling 
`cusparseSpGEMM_compute( handle, opA, opB, &amp;alpha, 
matA, matB, &amp;beta, matC, computeType, 
CUSPARSE_SPGEMM_DEFAULT, spgemmDesc, &amp;bufferSize2, dBuffer2)
</code></pre>
<p>when using different sizes of sparse matrix multiplication on the GPU (not the actual number of values but for the dimension that are taken when creating a new matrix.)</p>
<ul>
<li>How do I debug this error in general?</li>
<li>What are the maximal dimensions that is allowed for this operation on CUDA?</li>
<li>Why do I get this error only when using a GPU, not the CPU?</li>
</ul>

ptrblck: <p>Could you post a minimal, executable code snippet to reproduce the issue as well as the output of <code>python -m torch.utils.collect_env</code>, please?</p>

Ali_Rahmati: <p>i’m getting same error,<br>
it’s the output of <code>python -m torch.utils.collect_env</code></p>
<pre data-code-wrap="Collecting"><code class="lang-plaintext">PyTorch version: 2.0.0+cu117
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: Debian GNU/Linux 11 (bullseye) (x86_64)
GCC version: (Debian 10.2.1-6) 10.2.1 20210110
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.31

Python version: 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.10.0-21-amd64-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: Quadro RTX 8000
GPU 1: Quadro RTX 8000

Nvidia driver version: 515.76
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   40 bits physical, 48 bits virtual
CPU(s):                          25
On-line CPU(s) list:             0-24
Thread(s) per core:              1
Core(s) per socket:              25
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           85
Model name:                      Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz
Stepping:                        7
CPU MHz:                         2099.968
BogoMIPS:                        4199.93
L1d cache:                       800 KiB
L1i cache:                       800 KiB
L2 cache:                        100 MiB
L3 cache:                        16 MiB
NUMA node0 CPU(s):               0-24
Vulnerability Itlb multihit:     KVM: Mitigation: VMX unsupported
Vulnerability L1tf:              Mitigation; PTE Inversion
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT Host state unknown
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Mmio stale data:   Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Retbleed:          Mitigation; IBRS
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat umip pku ospke avx512_vnni md_clear

Versions of relevant libraries:
[pip3] numpy==1.24.2
[pip3] torch==2.0.0
[pip3] torch-cluster==1.6.1+pt20cu117
[pip3] torch-geometric==2.3.0
[pip3] torch-scatter==2.1.1+pt20cu117
[pip3] torch-sparse==0.6.17+pt20cu117
[pip3] torch-spline-conv==1.2.2+pt20cu117
[pip3] torchvision==0.15.1
[conda] numpy                     1.24.2                   pypi_0    pypi
[conda] torch                     2.0.0                    pypi_0    pypi
[conda] torch-cluster             1.6.1+pt20cu117          pypi_0    pypi
[conda] torch-geometric           2.3.0                    pypi_0    pypi
[conda] torch-scatter             2.1.1+pt20cu117          pypi_0    pypi
[conda] torch-sparse              0.6.17+pt20cu117          pypi_0    pypi
[conda] torch-spline-conv         1.2.2+pt20cu117          pypi_0    pypi
[conda] torchvision               0.15.1                   pypi_0    pypi
</code></pre>

rony: <p>Anything on this? I am getting this error while using PANconv in pytorch_geometric. Please help <a class="mention" href="/u/ptrblck">@ptrblck</a></p>

smth: <p><a class="mention" href="/u/rony">@rony</a> if you could post a code snippet that reproduces the issue, as well as specify your environment info using <code>python -m torch.utils.collect_env</code>, that’ll be a good start for someone to understand the issue</p>