Skip to main content

VapourSynth-MLRT-MIGX

This package contains the MIGraphX backend implementation of the vs-mlrt plugin.

Installation

pip install vapoursynth-mlrt-migx

Building from source

Only Linux x86-64 is currently supported.

Requirements

  • C++ Compiler: C++20 compatible (e.g. GCC, AMD Clang)
  • Build Tools: uv, CMake, Ninja
  • Dependencies:
    • migraphx (MIGraphX SDK — installed via ROCm packages)
    • hip (ROCm HIP runtime)
    • ROCm components: base, runtime-devel, llvm, blas-devel, hipblas-common-devel, dnn-devel
  • Environment Variables:
    • ROCM_PATH: Path to ROCm installation (defaults to /opt/rocm if not set)

Compilation

  1. Initialize the submodule:

    git submodule update --init --recursive vsmlrt/migx/vs-mlrt
    
  2. Install ROCm, HIP, and MIGraphX via your system package manager:

    # Example (RHEL/Fedora)
    dnf install rocm-devel migraphx-devel
    
  3. Set ROCM_PATH if ROCm is not installed in the default /opt/rocm:

    export ROCM_PATH="/opt/rocm"
    
  4. Build the wheel:

    uv build --wheel --package vapoursynth-mlrt-migx
    

Detailed parameter information from the parent project follows.


VapourSynth MIGraphX

The vs-migraphx plugin provides optimized HIP runtime for some popular AI filters on AMD GPUs.

Usage

Prototype: core.migx.Model(clip[] clips, string program_path[, int[] overlap, int[] tilesize, int device_id=0, int num_streams=1, string flexible_output_prop=""])

Arguments:

  • clip[] clips: the input clips, only 16/32-bit floating point RGB or GRAY clips are supported. For model specific input requirements, please consult our wiki.

  • string program_path: the path to the prebuilt program (see below)

  • int[] overlap: some networks (e.g. CNN) support arbitrary input shape where other networks might only support fixed input shape and the input clip must be processed in tiles. The overlap argument specifies the overlapping (horizontal and vertical, or both, in pixels) between adjacent tiles to minimize boundary issues. Please refer to network specific docs on the recommended overlapping size.

  • int[] tilesize: Even for CNN where arbitrary input sizes could be supported, sometimes the network does not work well for the entire range of input dimensions, and you have to limit the size of each tile. This parameter specify the tile size (horizontal and vertical, or both, including the overlapping). Please refer to network specific docs on the recommended tile size.

  • int device_id: Specifies the GPU device id to use, default 0. Requires AMD GPUs with gfx1030 target or RDNA3 architecture onwards (list).

  • int num_streams: number of concurrent HIP streams to use. Default 1. Increase if GPU not saturated.

  • string flexible_output_prop: used to support onnx models with arbitrary number of output planes.

    from typing import TypedDict
    
    class Output(TypedDict):
        clip: vs.VideoNode
        num_planes: int
    
    prop = "planes" # arbitrary non-empty string
    output = core.migx.Model(src, program_path, flexible_output_prop=prop) # type: Output
    
    clip = output["clip"]
    num_planes = output["num_planes"]
    
    output_planes = [
        clip.std.PropToClip(prop=f"{prop}{i}")
        for i in range(num_planes)
    ] # type: list[vs.VideoNode]
    

When overlap and tilesize are not specified, the filter will internally try to resize the network to fit the input clips. This might not always work (for example, the network might require the width to be divisible by 8), and the filter will error out in this case.

The general rule is to either:

  1. left out overlap, tilesize at all and just process the input frame in one tile, or
  2. set all three so that the frame is processed in tilesize[0] x tilesize[1] tiles, and adjacent tiles will have an overlap of overlap[0] x overlap[1] pixels on each direction. The overlapped region will be throw out so that only internal output pixels are used.

Instructions

Build program

migraphx-driver compile --onnx drunet_gray.onnx --gpu --input-dim @input 1 2 1080 1920 --output dpir_gray_1080p.mxr

The program can be applied to 1920x1080 input.

Also check migraphx-driver useful arguments

Run model

In vpy script:

# DPIR
src = core.std.BlankClip(src, width=1920, height=1080, format=vs.GRAYS)
sigma = 10.0
flt = core.migx.Model([src, core.std.BlankClip(src, color=sigma/255.0)], engine_path="dpir_gray_1080p.mxr", tilesize=[1920, 1080])

trtexec useful arguments

  • --fp16: Enable fp16 precision, in addition to fp32 (default = disabled)

  • --output <file>: Save the serialized program

  • --migraphx <file>: Load a serialized program

  • --optimize: Performs common graph optimizations

  • --exhaustive-tune: Enables exhaustive search to find the fastest kernel

  • --disable-fast-math: Disable fast math optimization

Also check the full list of options and environment variables.

Metadata

Release files for vapoursynth-mlrt-migx 17.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vapoursynth-mlrt-migx 17.0
File Size Uploaded
vapoursynth_mlrt_migx-17.0.tar.gz 103.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vapoursynth-mlrt-migx 17.0
File Interpreter ABI Platform
vapoursynth_mlrt_migx-17.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details

Total release size: 229.5 kB

Release files / vapoursynth_mlrt_migx-17.0.tar.gz

Download URL vapoursynth_mlrt_migx-17.0.tar.gz
Size 103.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ad4e1c973f02a07eeed6a8e7746c4066a964472132f502b05a6921a208e74579
BLAKE2b-256 checksum
How to use checksums
d6f57809b28e51ead2624869ae82284338d8bade5d14a72e9590a815a16b3589
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / vapoursynth_mlrt_migx-17.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL vapoursynth_mlrt_migx-17.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 126.2 kB
Tags Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
c17d725fcd9eeddb627f29744a2627e13c95f0bf20b3a82e76d557510556c39d
BLAKE2b-256 checksum
How to use checksums
9ac94319ec03ef62aa1d3ab9d14bc42bbf8ea1be57dec7f1708b3cd38d688a27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

17.0 This release

2 release files

16.0

2 release files

15.16

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page