pytorch - 💡(How to fix) Fix InductorError: PermissionError: [Errno 13] Permission denied: 'nvcc' — _cuda_system_info_comment does not catch PermissionError

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

Bug description: _cuda_system_info_comment() in torch/_dynamo/debug_utils.py calls subprocess.check_output(["nvcc", "--version"]) but only catches (FileNotFoundError, subprocess.CalledProcessError). On WSL2, this call can raise PermissionError (errno 13), which propagates uncaught up through save_graph_repro → codegen_and_compile → _compile_fx_inner, where it gets wrapped as InductorError and crashes the entire torch.compile execution.

To reproduce: Use torch.compile on a model (e.g. WanVideoWrapper in ComfyUI) on WSL2 with CUDA 12.8. The nvcc binary exists and is executable, but subprocess.check_output(["nvcc", "--version"]) raises PermissionError in this context.

Expected behavior: PermissionError should be caught like FileNotFoundError, falling back to # nvcc not found.

Minimal fix: In torch/_dynamo/debug_utils.py line 261:

Before

except (FileNotFoundError, subprocess.CalledProcessError):

After

except (FileNotFoundError, PermissionError, OSError, subprocess.CalledProcessError):

Environment:

  • PyTorch 2.8.0+cu128
  • CUDA 12.8
  • Python 3.13.7
  • WSL2 (Linux 6.6.87.2-microsoft-standard-WSL2)
  • GPU: NVIDIA RTX 4080 Laptop (compute capability 8.9)

Versions

PyTorch version: 2.8.0+cu128 Is debug build: False CUDA used to build PyTorch: 12.8 ROCM used to build PyTorch: N/A

OS: Ubuntu 24.04.3 LTS (x86_64) GCC version: (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0 Clang version: Could not collect CMake version: Could not collect Libc version: glibc-2.39

Python version: 3.13.7 (main, Oct 4 2025, 19:46:03) [GCC 13.3.0] (64-bit runtime) Python platform: Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39 Is CUDA available: True CUDA runtime version: 12.8.93 CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA GeForce RTX 4080 Laptop GPU Nvidia driver version: 591.74 cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.9.13.1 (and others) HIP runtime version: N/A MIOpen runtime version: N/A Is XNNPACK available: True

CPU: Intel(R) Core(TM) i9-14900HX, 16 CPUs, WSL2/Hyper-V

Versions of relevant libraries: [pip3] numpy==2.2.6 [pip3] torch==2.8.0 [pip3] torchaudio==2.8.0+cu128 [pip3] torchvision==0.23.0+cu128 [pip3] triton==3.4.0 [pip3] nvidia-cudnn-cu12==9.10.2.21 [pip3] nvidia-cuda-runtime-cu12==12.8.90

cc @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @amjames @jataylo @azahed98

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix InductorError: PermissionError: [Errno 13] Permission denied: 'nvcc' — _cuda_system_info_comment does not catch PermissionError