Skip to content

[Build Error] nvcc fatal error due to empty strings in setup.py flags (ffpa-attn) #90

@xachern

Description

@xachern

Describe the bug

When building the ffpa-attn submodule in the NVIDIA PyTorch Docker container (nvcr.io/nvidia/pytorch:24.10-py3), the build fails with nvcc fatal : A single input file is required....

To Reproduce

  1. Use Docker image: nvcr.io/nvidia/pytorch:24.10-py3
  2. Clone the repo and submodules.
  3. Run: python3 setup.py bdist_wheel && cd dist && python3 -m pip install *.whl

Error Log

nvcc fatal   : A single input file is required for a non-link phase when an outputfile is specified

The Cause

The issue is caused by empty strings '' being passed to nvcc_args in setup.py. The Ninja build system treats these empty strings as input filenames, causing nvcc to crash.

Proposed Fix

In setup.py, filter out empty strings in extra_compile_args:

# start at line 53 in setup.py

# add nvcc compile flags
"nvcc": [
    flag for flag in (
        ENV.get_build_cuda_cflags(build_pkg=True)
        + generator_flag
        + cc_flag
    )
    if flag.strip()  # <--- Filter out empty strings
],

This fix resolves the build error for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions