Package Details: python-torchaudio 2.11.0-1

Git Clone URL: https://aur.archlinux.org/python-torchaudio.git (read-only, click to copy)
Package Base: python-torchaudio
Description: Data manipulation and transformation for audio signal processing, powered by PyTorch
Upstream URL: https://github.com/pytorch/audio
Licenses: BSD-2-Clause
Conflicts: python-torchaudio-git
Submitter: HenryJia
Maintainer: NBonaparte (lubosz)
Last Packager: lubosz
Votes: 10
Popularity: 0.103987
First Submitted: 2020-08-27 18:23 (UTC)
Last Updated: 2026-07-11 16:03 (UTC)

Latest Comments

« First ‹ Previous 1 2 3 4 5 Next › Last »

yan12125 commented on 2022-07-04 03:21 (UTC)

Nice! Updated.

rien333 commented on 2022-07-03 15:22 (UTC)

export CUDACXX=/opt/cuda/bin/nvcc also works!

yan12125 commented on 2022-07-03 12:02 (UTC)

Nice! Could you also try this? It is kind of unusual to use CMAKE_CUDA_COMPILER as an environment variable instead of a CMake parameter.

export CUDACXX=/opt/cuda/bin/nvcc

are you able to build this package yourself outside of a clean chroot?

To be honest, I've never tried that. I always use chroots for non-trivial packages to avoid mysterious issues, and this package is far from a trivial one :)

rien333 commented on 2022-07-03 10:38 (UTC)

Jeez, I finally got this to build. This recent thread helped a bit.

  export CXX=/usr/bin/g++-11
  export CUDAHOSTCXX=$CXX
+  export CMAKE_CUDA_COMPILER=/opt/cuda/bin/nvcc

The last line of the diff is the only thing I had to add! Would you consider it adding to the PKGBUIKLD, at least until someone figures out what interveres with building outside of a clean chroot?

And btw, are you able to build this package yourself outside of a clean chroot?

rien333 commented on 2022-06-10 09:03 (UTC) (edited on 2022-06-10 09:03 (UTC) by rien333)

Thank you for your continued help! Unfortunately, it's just not as simple as not having /opt/cuda/bin/nvcc — community/cuda obviously installs this binary, and running /opt/cuda/bin/nvcc --version produces the same output as in your Cmake log.

In the end, I "fixed" this by building this package in a clean chroot. Not ideal, but maybe a proper solultion/answer will come around one day.

yan12125 commented on 2022-06-07 14:59 (UTC)

Not sure what's going on for you. Here are relevant logs for me:

$ grep -A 10 'Checking whether the CUDA compiler' /var/lib/archbuild/extra-x86_64/yan12125/build/python-torchaudio/src/audio/build/temp.linux-x86_64-3.10/CMakeFiles/CMakeOutput.log
Checking whether the CUDA compiler is NVIDIA using "" matched "nvcc: NVIDIA \(R\) Cuda compiler driver":
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Tue_May__3_18:49:52_PDT_2022
Cuda compilation tools, release 11.7, V11.7.64
Build cuda_11.7.r11.7/compiler.31294372_0
Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" succeeded.
Compiler: /opt/cuda/bin/nvcc
Build flags:
Id flags: --keep;--keep-dir;tmp;-ccbin=/usr/bin/g++-11;-gencode=arch=compute_52,code=sm_52;-gencode=arch=compute_60,code=sm_60;-gencode=arch=compute_62,code=sm_62;-gencode=arch=compute_70,code=sm_70;-gencode=arch=compute_72,code=sm_72;-gencode=arch=compute_75,code=sm_75;-gencode=arch=compute_80,code=sm_80;-gencode=arch=compute_86,code=sm_86;-gencode=arch=compute_86,code=sm_86 -v

$ grep -r CMAKE_CUDA_ARCH /var/lib/archbuild/extra-x86_64/yan12125/build/python-torchaudio/src/audio/build/temp.linux-x86_64-3.10
/var/lib/archbuild/extra-x86_64/yan12125/build/python-torchaudio/src/audio/build/temp.linux-x86_64-3.10/CMakeCache.txt:CMAKE_CUDA_ARCHITECTURES:UNINITIALIZED=52-real;60-real;62-real;70-real;72-real;75-real;80-real;86-real;86
/var/lib/archbuild/extra-x86_64/yan12125/build/python-torchaudio/src/audio/build/temp.linux-x86_64-3.10/CMakeFiles/3.23.2/CMakeCUDACompiler.cmake:set(CMAKE_CUDA_ARCHITECTURES_ALL "35;37;50;52;53;60;61;62;70;72;75;80;86;87")
/var/lib/archbuild/extra-x86_64/yan12125/build/python-torchaudio/src/audio/build/temp.linux-x86_64-3.10/CMakeFiles/3.23.2/CMakeCUDACompiler.cmake:set(CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR "35;50;60;70;80")

I got Compiler: /opt/cuda/bin/nvcc but you have Compiler: CMAKE_CUDA_COMPILER-NOTFOUND. Maybe that program is somehow missing or broken for you?

rien333 commented on 2022-06-07 09:10 (UTC)

Still having the same sort of problems, a month later:

-- Caffe2: Protobuf version 3.20.1
-- Found CUDA: /opt/cuda (found version "11.7")
-- The CUDA compiler identification is unknown
CMake Error at /usr/share/cmake/Modules/CMakeDetermineCUDACompiler.cmake:633 (message):
  Failed to detect a default CUDA architecture.

  Compiler output:

Call Stack (most recent call first):
  /usr/lib64/cmake/Caffe2/public/cuda.cmake:41 (enable_language)
  /usr/lib64/cmake/Caffe2/Caffe2Config.cmake:88 (include)
  /usr/lib64/cmake/Torch/TorchConfig.cmake:68 (find_package)
  CMakeLists.txt:87 (find_package)

-- Configuring incomplete, errors occurred!
See also "/tmp/makepkg/python-torchaudio/src/audio/build/temp.linux-x86_64-3.10/CMakeFiles/CMakeOutput.log".
See also "/tmp/makepkg/python-torchaudio/src/audio/build/temp.linux-x86_64-3.10/CMakeFiles/CMakeError.log".

CMakeError.log contains the following:

Checking whether the CUDA compiler is NVIDIA using "" did not match "nvcc: NVIDIA \(R\) Cuda compiler driver":
Checking whether the CUDA compiler is Clang using "" did not match "(clang version)":
Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.
Compiler: CMAKE_CUDA_COMPILER-NOTFOUND 
Build flags: 
Id flags:  -v

The output was:
No such file or directory


Compiling the CUDA compiler identification source file "CMakeCUDACompilerId.cu" failed.
Compiler: CMAKE_CUDA_COMPILER-NOTFOUND 
Build flags: 
Id flags:  -v

The output was:
No such file or directory

Note that cmake fails at CMakeDetermineCUDACompiler.cmake:633:

  if(NOT CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" OR _CUDA_CMP0104 STREQUAL "NEW")
    set(CMAKE_CUDA_ARCHITECTURES "${architectures_detected}" CACHE STRING "CUDA architectures")

    if(NOT CMAKE_CUDA_ARCHITECTURES)
      message(FATAL_ERROR "Failed to detect a default CUDA architecture.\n\nCompiler output:\n${CMAKE_CUDA_COMPILER_PRODUCED_OUTPUT}")
    endif()

What is the value of CMAKE_CUDA_ARCHITECTURES in your case? What should it be? (It's empty for me.)

Maybe worth another try with /usr/local/cuda

Forget about /usr/local/coda, that was just a temporary bug in how CUDA was packaged on Arch (see also my previous comment).

yan12125 commented on 2022-05-25 05:16 (UTC)

I switched to GCC 11 and it works with /opt/cuda. Maybe worth another try with /usr/local/cuda :)

rien333 commented on 2022-05-16 12:08 (UTC) (edited on 2022-05-16 12:09 (UTC) by rien333)

Hmm that's strange. community/cuda installs to /opt/cuda, but your logs mentioned /usr/local/cuda. Maybe some other packages or scripts installs them for you.

It's true that cuda installs to /opt, as confirmed by yay -Ql cuda. However, when I sudo rm -rf /usr/local/cuda, then yay -R cuda, and finally reinstall using yay -S cuda, /usr/local/cuda appears again! It's not a symlink to /opt/cuda, but the contents of the two folders appear to be identical (certainly, nvcc -V is the same in both folders). Hence, I think we've stumbled on a bug (a totally extraneous duplicate is installed). I'll report it in a bit.

Perhaps the hack(s) you describe don't quite apply to /usr/local/cuda, which would explain why my build keeps failing.

Good catch noticing /usr/local/cuda in my logs!

yan12125 commented on 2022-05-16 11:28 (UTC)

never messed around with installing nvidia stuff another way.

Hmm that's strange. community/cuda installs to /opt/cuda, but your logs mentioned /usr/local/cuda. Maybe some other packages or scripts installs them for you.

That this may be he root of the problem seems to accord with various reports on the web. https://gitlab.kitware.com/cmake/cmake/-/issues/23322

Thanks for the link! I have a guess now: nvcc inside /usr/local/cuda rejects gcc 12 and causes a mysterious CMake error. On the other hand, community/cuda comes with a hack [1] to accept whatever gcc versions, so CMake does not complain.

Are you sure cmake picks up on the env variable you've changed?

Before I added USE_CUDA=0, I got an error invalid type argument of unary ‘*’ when compiling compute_alphas.cu, and now it's gone for me. Somehow CMake still checks for CUDA even with USE_CUDA=0. Maybe that flag only disables invoking nvcc for compiling *.cu files.

[1] https://github.com/archlinux/svntogit-community/blob/packages/cuda/trunk/PKGBUILD#L124