-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Torchaudio installed through PIP not detecting ffmpeg from conda-forge channel #3872
Comments
Same for non-conda, under Windows environment. I'm trying to launch this tutorial: https://github.com/pytorch/audio/blob/main/examples/tutorials/audio_data_augmentation_tutorial.py
Tried 7-6-5 versions, PATH variable is correct. |
I also see this. E.g., running from torio.utils.ffmpeg_utils import get_audio_encoders
get_audio_encoders()
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[13], line 1
----> 1 get_audio_encoders()
File ~/miniconda3/envs/tadl/lib/python3.10/site-packages/torio/utils/ffmpeg_utils.py:135, in get_audio_encoders()
119 def get_audio_encoders() -> Dict[str, str]:
120 """Get the available audio encoders.
121
122 Returns:
(...)
133 ... alac: ALAC (Apple Lossless Audio Codec)
134 """
--> 135 return ffmpeg_ext.get_audio_encoders()
File ~/miniconda3/envs/tadl/lib/python3.10/site-packages/torio/_extension/utils.py:25, in _LazyImporter.__getattr__(self, item)
24 def __getattr__(self, item):
---> 25 self._import_once()
26 return getattr(self.module, item)
File ~/miniconda3/envs/tadl/lib/python3.10/site-packages/torio/_extension/utils.py:39, in _LazyImporter._import_once(self)
37 def _import_once(self):
38 if self.module is None:
---> 39 self.module = self.import_func()
40 # Note:
41 # By attaching the module attributes to self,
42 # module attributes are directly accessible.
43 # This allows to avoid calling __getattr__ for every attribute access.
44 self.__dict__.update(self.module.__dict__)
File ~/miniconda3/envs/tadl/lib/python3.10/site-packages/torio/_extension/utils.py:143, in _init_ffmpeg()
141 def _init_ffmpeg():
142 ffmpeg_vers = _get_ffmpeg_versions()
--> 143 ext = _find_ffmpeg_extension(ffmpeg_vers)
144 ext.init()
145 if ext.get_log_level() > 8:
File ~/miniconda3/envs/tadl/lib/python3.10/site-packages/torio/_extension/utils.py:122, in _find_ffmpeg_extension(ffmpeg_vers)
120 _LG.debug("Failed to load FFmpeg%s extension.", ffmpeg_ver, exc_info=True)
121 continue
--> 122 raise ImportError(
123 f"Failed to intialize FFmpeg extension. Tried versions: {ffmpeg_vers}. "
124 "Enable DEBUG logging to see more details about the error."
125 )
ImportError: Failed to intialize FFmpeg extension. Tried versions: ['6', '5', '4', '']. Enable DEBUG logging to see more details about the error. I get the same errors are others reported. But delving further, to find the source of this, if I do: from torio._extension.utils import _load_lib
version = 6
lib = f"libtorio_ffmpeg{version}"
_load_lib(lib)
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
Cell In[21], line 1
----> 1 _load_lib(lib)
File ~/miniconda3/envs/tadl/lib/python3.10/site-packages/torio/_extension/utils.py:94, in _load_lib(lib)
92 if not path.exists():
93 return False
---> 94 torch.ops.load_library(path)
95 return True
File ~/miniconda3/envs/tadl/lib/python3.10/site-packages/torch/_ops.py:1357, in _Ops.load_library(self, path)
1352 path = _utils_internal.resolve_library_path(path)
1353 with dl_open_guard():
1354 # Import the shared library into the process, thus running its
1355 # static (global) initialization code in order to register custom
1356 # operators with the JIT.
-> 1357 ctypes.CDLL(path)
1358 self.loaded_libraries.add(path)
File ~/miniconda3/envs/tadl/lib/python3.10/ctypes/__init__.py:374, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
371 self._FuncPtr = _FuncPtr
373 if handle is None:
--> 374 self._handle = _dlopen(self._name, mode)
375 else:
376 self._handle = handle
OSError: /home/matthew/miniconda3/envs/tadl/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /lib/x86_64-linux-gnu/libavfilter.so.9) It seems to be a C++ library version/linkage issue, with the library in my conda environment. I partially solved this error by using the answer from here, i.e., installing:
although I this leads to a different GCC library error:
I solved this one by linking my system $ ln -sf /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 ${CONDA_PREFIX}/lib Now running: from torio.utils.ffmpeg_utils import get_audio_encoders
get_audio_encoders() works! I don't know how to do the same under Windows/for non-conda environment setups. |
🐛 Describe the bug
torchaudio
not detectingffmpeg
installed from theconda-forge
channel.Environment:
To reproduce, set up the following environment:
Code to reproduce:
Versions
PyTorch version: 2.2.1+cpu
Is debug build: False
CUDA used to build PyTorch: Could not collect
ROCM used to build PyTorch: N/A
OS: Ubuntu 20.04.2 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.31
Python version: 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:36:39) [GCC 10.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-130-generic-x86_64-with-glibc2.31
Is CUDA available: False
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration:
GPU 0: NVIDIA RTX A6000
GPU 1: NVIDIA RTX A6000
GPU 2: NVIDIA RTX A6000
GPU 3: NVIDIA RTX A6000
GPU 4: NVIDIA RTX A6000
GPU 5: NVIDIA RTX A6000
GPU 6: NVIDIA RTX A6000
GPU 7: NVIDIA RTX A6000
Nvidia driver version: 535.183.01
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: 43 bits physical, 48 bits virtual
CPU(s): 256
On-line CPU(s) list: 0-255
Thread(s) per core: 2
Core(s) per socket: 64
Socket(s): 2
NUMA node(s): 2
Vendor ID: AuthenticAMD
CPU family: 23
Model: 49
Model name: AMD EPYC 7662 64-Core Processor
Stepping: 0
Frequency boost: enabled
CPU MHz: 3295.616
CPU max MHz: 2154.2959
CPU min MHz: 1500.0000
BogoMIPS: 4000.00
Virtualization: AMD-V
L1d cache: 4 MiB
L1i cache: 4 MiB
L2 cache: 64 MiB
L3 cache: 512 MiB
NUMA node0 CPU(s): 0-63,128-191
NUMA node1 CPU(s): 64-127,192-255
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Mitigation; untrained return thunk; SMT enabled with STIBP protection
Vulnerability Spec rstack overflow: Mitigation; safe RET
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; Retpolines; IBPB conditional; STIBP always-on; RSB filling; PBRSB-eIBRS Not affected; BHI 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 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 x2apic 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 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 amd_ppin arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip rdpid overflow_recov succor smca sme sev sev_es
Versions of relevant libraries:
[pip3] torch==2.2.1+cpu
[pip3] torchaudio==2.2.1+cpu
[conda] libopenvino-pytorch-frontend 2024.4.0 h5888daf_2 conda-forge
[conda] torch 2.2.1+cpu pypi_0 pypi
[conda] torchaudio 2.2.1+cpu pypi_0 pypi
The text was updated successfully, but these errors were encountered: