Skip to content
Merged
3 changes: 3 additions & 0 deletions build_tools/build_python_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ def core_artifact_filter(an: ArtifactName) -> bool:
"hipify",
"host-blas",
"host-suite-sparse",
"rocdecode",
"rocjpeg",
"rocprofiler-sdk",
"sysdeps",
"sysdeps-amd-mesa",
] and an.component in [
"lib",
"run",
Expand Down
242 changes: 237 additions & 5 deletions build_tools/packaging/linux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,231 @@
"DisablePackaging": "True"
},

{
"Package": "amdrocm-media-sysdeps",
"Version": "",
"Architecture": "amd64",
"BuildArch": "x86_64",
"DEBDepends": [
"libc6",
"amdrocm-sysdeps"
],
"RPMRequires": [
"amdrocm-sysdeps"
],
"Maintainer": "ROCm Dev Support <rocm-dev.support@amd.com>",
"Description_Short": "AMD ROCm media system dependencies",
"Description_Long": "AMD Mesa VA-API libraries for ROCm media decode support",
"Section": "devel",
"Priority": "optional",
"Group": "unknown",
"License": "MIT",
"Vendor": "Advanced Micro Devices, Inc",
"Homepage": "https://github.com/ROCm/rocm-systems",
"Artifactory": [
{
"Artifact": "sysdeps-amd-mesa",
"Artifact_Subdir": [
{
"Name": "sysdeps-amd-mesa",
"Components": [
"lib"
]
}
]
}
],
"Gfxarch": "False"
},
{
"Package": "amdrocm-media-sysdeps-devel",
"Version": "",
"Architecture": "amd64",
"BuildArch": "x86_64",
"DEBDepends": [
"libc6",
"amdrocm-media-sysdeps"
],
"RPMRequires": [
"amdrocm-media-sysdeps"
],
"Maintainer": "ROCm Dev Support <rocm-dev.support@amd.com>",
"Description_Short": "AMD ROCm media system dependencies development files",
"Description_Long": "AMD Mesa VA-API development files for ROCm media decode support",
"Section": "devel",
"Priority": "optional",
"Group": "unknown",
"License": "MIT",
"Vendor": "Advanced Micro Devices, Inc",
"Homepage": "https://github.com/ROCm/rocm-systems",
"Artifactory": [
{
"Artifact": "sysdeps-amd-mesa",
"Artifact_Subdir": [
{
"Name": "sysdeps-amd-mesa",
"Components": [
"dev"
]
}
]
}
],
"Gfxarch": "False"
},
{
"Package": "amdrocm-decode",
"Version": "",
"Architecture": "amd64",
"BuildArch": "x86_64",
"DEBDepends": [
"libc6",
"amdrocm-runtime",
"amdrocm-sysdeps",
"amdrocm-media-sysdeps"
],
"RPMRequires": [
"amdrocm-runtime",
"amdrocm-sysdeps",
"amdrocm-media-sysdeps"
],
"Maintainer": "ROCm Dev Support <rocm-dev.support@amd.com>",
"Description_Short": "AMD ROCm video decode library",
"Description_Long": "rocdecode provides high-performance video decoding on AMD GPUs using VA-API",
"Section": "devel",
"Priority": "optional",
"Group": "unknown",
"License": "MIT",
"Vendor": "Advanced Micro Devices, Inc",
"Homepage": "https://github.com/ROCm/rocm-systems",
"Artifactory": [
{
"Artifact": "rocdecode",
"Artifact_Subdir": [
{
"Name": "rocdecode",
"Components": [
"lib"
]
}
]
}
],
"Gfxarch": "False"
},
{
"Package": "amdrocm-decode-devel",
"Version": "",
"Architecture": "amd64",
"BuildArch": "x86_64",
"DEBDepends": [
"libc6",
"amdrocm-decode"
],
"RPMRequires": [
"amdrocm-decode"
],
"Maintainer": "ROCm Dev Support <rocm-dev.support@amd.com>",
"Description_Short": "AMD ROCm video decode library development files",
"Description_Long": "rocdecode development header files",
"Section": "devel",
"Priority": "optional",
"Group": "unknown",
"License": "MIT",
"Vendor": "Advanced Micro Devices, Inc",
"Homepage": "https://github.com/ROCm/rocm-systems",
"Artifactory": [
{
"Artifact": "rocdecode",
"Artifact_Subdir": [
{
"Name": "rocdecode",
"Components": [
"dev"
]
}
]
}
],
"Gfxarch": "False"
},
{
"Package": "amdrocm-jpeg",
"Version": "",
"Architecture": "amd64",
"BuildArch": "x86_64",
"DEBDepends": [
"libc6",
"amdrocm-runtime",
"amdrocm-sysdeps",
"amdrocm-media-sysdeps"
],
"RPMRequires": [
"amdrocm-runtime",
"amdrocm-sysdeps",
"amdrocm-media-sysdeps"
],
"Maintainer": "ROCm Dev Support <rocm-dev.support@amd.com>",
"Description_Short": "AMD ROCm JPEG decode library",
"Description_Long": "rocjpeg provides high-performance JPEG decoding on AMD GPUs using VA-API",
"Section": "devel",
"Priority": "optional",
"Group": "unknown",
"License": "MIT",
"Vendor": "Advanced Micro Devices, Inc",
"Homepage": "https://github.com/ROCm/rocm-systems",
"Artifactory": [
{
"Artifact": "rocjpeg",
"Artifact_Subdir": [
{
"Name": "rocjpeg",
"Components": [
"lib"
]
}
]
}
],
"Gfxarch": "False"
},
{
"Package": "amdrocm-jpeg-devel",
"Version": "",
"Architecture": "amd64",
"BuildArch": "x86_64",
"DEBDepends": [
"libc6",
"amdrocm-jpeg"
],
"RPMRequires": [
"amdrocm-jpeg"
],
"Maintainer": "ROCm Dev Support <rocm-dev.support@amd.com>",
"Description_Short": "AMD ROCm JPEG decode library development files",
"Description_Long": "rocjpeg development header files",
"Section": "devel",
"Priority": "optional",
"Group": "unknown",
"License": "MIT",
"Vendor": "Advanced Micro Devices, Inc",
"Homepage": "https://github.com/ROCm/rocm-systems",
"Artifactory": [
{
"Artifact": "rocjpeg",
"Artifact_Subdir": [
{
"Name": "rocjpeg",
"Components": [
"dev"
]
}
]
}
],
"Gfxarch": "False"
},

{
"Comments": "Meta Package defintions start from here. There will not be any artifactory for meta packages.",
"Package": "amdrocm-core",
Expand All @@ -1708,7 +1933,9 @@
"amdrocm-rccl",
"amdrocm-math-common",
"amdrocm-amdsmi",
"amdrocm-hipify"
"amdrocm-hipify",
"amdrocm-decode",
"amdrocm-jpeg"
],
"RPMRequires": [
"amdrocm-base",
Expand All @@ -1724,7 +1951,9 @@
"amdrocm-rccl",
"amdrocm-math-common",
"amdrocm-amdsmi",
"amdrocm-hipify"
"amdrocm-hipify",
"amdrocm-decode",
"amdrocm-jpeg"
],
"Maintainer": "ROCm Dev Support <rocm-dev.support@amd.com>",
"Description_Short": "AMD ROCm core metapackage",
Expand Down Expand Up @@ -1780,8 +2009,9 @@
"amdrocm-opencl-devel",
"amdrocm-hipblas-common-devel",
"amdrocm-rccl-devel",
"amdrocm-dnn-devel"

"amdrocm-dnn-devel",
"amdrocm-decode-devel",
"amdrocm-jpeg-devel"
],
"RPMRequires": [
"amdrocm-core",
Expand All @@ -1796,7 +2026,9 @@
"amdrocm-opencl-devel",
"amdrocm-hipblas-common-devel",
"amdrocm-rccl-devel",
"amdrocm-dnn-devel"
"amdrocm-dnn-devel",
"amdrocm-decode-devel",
"amdrocm-jpeg-devel"
],
"Maintainer": "ROCm Dev Support <rocm-dev.support@amd.com>",
"Description_Short": "AMD ROCm core development metapackage",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,26 @@ def __repr__(self):
return self.dist_package_template


def _core_library_present(so_pattern: str, dll_pattern: str, posix_relpath: str = "lib") -> bool:
"""Checks whether a core library file exists in the installed core package."""
core_package = ALL_PACKAGES["core"]
core_spec = importlib.util.find_spec(core_package.get_py_package_name())
if core_spec is None or core_spec.origin is None:
return False

core_root = Path(core_spec.origin).parent
if os.name == "nt":
if not dll_pattern:
return False
search_root = core_root / "bin"
pattern = dll_pattern
else:
search_root = core_root / posix_relpath
pattern = so_pattern

return any(search_root.glob(pattern))


def discover_current_target_family() -> str | None:
"""Attempts to query the current target family via the 'offload-arch' tool."""

Expand Down Expand Up @@ -229,6 +249,12 @@ def determine_target_family() -> str:
"lib/host-math/lib",
)
LibraryEntry("amd_comgr", "core", "libamd_comgr.so*", "amd_comgr*.dll")
# Media libraries are optional (gated by THEROCK_ENABLE_MEDIA_LIBS and mesa sysdeps).
# Only register them if they are present in the installed core package.
if _core_library_present("librocdecode.so*", ""):
LibraryEntry("rocdecode", "core", "librocdecode.so*", "")
if _core_library_present("librocjpeg.so*", ""):
LibraryEntry("rocjpeg", "core", "librocjpeg.so*", "")
LibraryEntry("hipblas", "libraries", "libhipblas.so*", "*hipblas*.dll")
LibraryEntry("hipblaslt", "libraries", "libhipblaslt.so*", "*hipblaslt*.dll")
LibraryEntry("hipfft", "libraries", "libhipfft.so*", "hipfft*.dll")
Expand Down
Loading