Cannot build PyTorch 2.3.1 with CUDA 12.9 on WSL2 (Ubuntu 22.04) — Missing nvToolsExt despite cuda-nvtx-12-9 installed

Hi all,

I’m trying to build PyTorch v2.3.1 from source on a WSL2 Ubuntu 22.04 environment with the following setup:
Any way to build pytorch 2.3.1 with cuda 12.9?
Cause it seems latest pytorch incompatible with some modules(TI QAT wrapper module) I need to use in my project, I need pytorch 2.3.1.


:white_check_mark: System Configuration:

  • OS: WSL2 (Ubuntu 22.04)
  • GPU: NVIDIA RTX 5080
  • CUDA Driver Version: 12.9
  • CUDA Toolkit Version: 12.9 (installed via APT)
  • cuDNN: libcudnn9 installed via APT
  • MAGMA: magma-cuda121 installed via conda
  • Python: Conda environment, Python 3.10
  • GCC: 11.4

Environment variables:

export CUDA_HOME=/usr/local/cuda-12.9
export _GLIBCXX_USE_CXX11_ABI=1
export USE_CUDA=1
export USE_CUDNN=1
export USE_MKLDNN=1
export USE_MAGMA=1
export USE_NCCL=0
export MAX_JOBS=$(nproc)
export _GLIBCXX_USE_CXX11_ABI=1
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}

:warning: Problem:

While building PyTorch 2.3.1 using python setup.py develop, the process fails with the following error:

CMake Error at cmake/public/cuda.cmake:70 (message):
  Failed to find nvToolsExt

No, I would not recommend trying to build old PyTorch releases with newer CUDA toolkits as needed changes might not have landed as can be seen in your error message.

Ok, it is very clear.