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
- Use Docker image:
nvcr.io/nvidia/pytorch:24.10-py3
- Clone the repo and submodules.
- 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.