Skip to content

Building fuser project

Ryan Spring edited this page Apr 28, 2025 · 17 revisions

How to Build Fuser project from source.

  1. Install PyTorch with CUDA support (either build from source or install via pip wheel);
  2. Clone Fuser code to your local machine git clone --recursive https://github.com/NVIDIA/Fuser.git;
  3. Install required pip modules: pip install -r requirements.txt;
  4. Build NvFuser with pip install -v --no-build-isolation python;

Details

Pip wheel build and usage

Here are the steps to create pip wheel that can be distributed and used on top of a pip installed pytorch wheel package:

# Repeat steps 1-3 from building Fuser from source.
# Specify NVRTC for pip wheel
export NVFUSER_BUILD_INSTALL_REQUIRES="nvidia-cuda-nvrtc-cu12,nvidia-nvtx-cu12"; \
# Skip building tests
export NVFUSER_BUILD_NO_TEST=1; \
# Skip building benchmarks
export NVFUSER_BUILD_NO_BENCHMARK=1; \
# Build pip wheel
python -m build --wheel --outdir dist --no-isolation ./python; \

Details:

  • Build against upstream pip package - if you need to work with upstream distributed pytorch https://pytorch.org/, you need to make sure that you nvfuser is built against a pytorch library with the same CXX ABI flag, otherwise, you are going to see undefined symbols. The safest bet is just build against upstream pip package directly!
  • Specify additional pip packages - Currently, upstream pytorch pip package can run on system with no cuda installation. NvFuser links against libnvrtc. You need to specify the proper nvrtc as required package. This can be done via specify NVFUSER_BUILD_INSTALL_REQUIRES=... environment variable.

Clone this wiki locally