Skip to content

Windows: torchcodec conflicts with PyTorch 2.5+ (flex_attention missing vs DLL load failure) #93

@thomjess303

Description

@thomjess303

Hi,

I'm trying to run sam-audio on Windows 11 with CUDA 12.1.

There appears to be a dependency conflict between torchcodec and newer versions of PyTorch.

Environment:

  • Windows 11
  • Python 3.11
  • CUDA 12.1
  • FFmpeg 8.0.1 (installed and on PATH)

Issue 1:
torchcodec 0.10.0 fails to load with PyTorch 2.5.1:
OSError: [WinError 127] The specified procedure could not be found
libtorchcodec_core8.dll failed to load

Issue 2:
Downgrading to PyTorch 2.4.1 resolves torchcodec,
but then sam-audio fails with:
ModuleNotFoundError: No module named 'torch.nn.attention.flex_attention'

That module exists only in PyTorch 2.5+.

So currently:

  • torchcodec works with PyTorch 2.4
  • sam-audio requires PyTorch 2.5+
  • Both cannot coexist on Windows

Workaround:
Installing PyTorch 2.5.1 and reinstalling sam-audio with:
pip install -e . --no-deps

This bypasses torchcodec and allows import to proceed.

Is torchcodec required on Windows, or can it be removed from required dependencies?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions