Skip to content

Commit

Permalink
Merge pull request #88 from fabric-testbed/87-gpu-as-multi-function-p…
Browse files Browse the repository at this point in the history
…ci-devices

support gpus as multi function pci devices
  • Loading branch information
kthare10 authored Feb 27, 2024
2 parents 8e94af3 + 4b2b8df commit 0ce0f99
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fimutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
This is a package of Information Model utilitied for FABRIC
for scanning different types of sites
"""
__VERSION__ = "1.6.3"
__VERSION__ = "1.6.4"
__version__ = __VERSION__
18 changes: 14 additions & 4 deletions fimutil/ralph/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class GPU:
"""
Model: str
Description: str
BDF: str
NUMA: str
BDF: list
NUMA: list

@staticmethod
def find_gpus(node_raw_json) -> List[Any]:
Expand All @@ -33,8 +33,18 @@ def find_gpus(node_raw_json) -> List[Any]:
logging.debug(f'Detected GPU {gpu_model}')
model = gpu_model
description = custom_fields[field]
bdf = custom_fields[field + '_pci_id']
# May contain multiple PCI devices depending on GPU type
# GPUs at CIEN rack have both an audio and video PCI device associated
# [root@cien-w1 ~]# lspci | grep 25:00.
# 25:00.0 VGA compatible controller: NVIDIA Corporation AD102GL [RTX 6000 Ada Generation] (rev a1)
# 25:00.1 Audio device: NVIDIA Corporation AD102 High Definition Audio Controller (rev a1)
# bdf field woul show as 25:00.0 25:00.1
# Extract PCI devices information
bdf_values = custom_fields.get(f'{field}_pci_id', '').split()
bdf = [bdf.strip() for bdf in bdf_values]
# -1 means unknown
numa = custom_fields.get(field + '_numa_node', '-1')
# Extract NUMA information
numa_val = custom_fields.get(f'{field}_numa_node', '-1')
numa = [numa_val] * len(bdf) if bdf else [numa_val]
ret.append(GPU(model, description, bdf, numa))
return ret
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ build-backend = "flit_core.buildapi"

[project]
name = "fim-utils"
authors = [{name = "Ilya Baldin", email = "ibaldin@renci.org"}, {name = "Xi Yang", email="xiyang@es.net"}, {name="Hussamuddin Nasir", email="nasir@netlab.uky.edu"}]
authors = [{name = "Ilya Baldin", email = "ibaldin@renci.org"},
{name = "Xi Yang", email="xiyang@es.net"},
{name="Hussamuddin Nasir", email="nasir@netlab.uky.edu"}]
readme = "README.md"
license = {file = "LICENSE"}
classifiers = ["License :: OSI Approved :: MIT License",
Expand All @@ -13,7 +15,7 @@ classifiers = ["License :: OSI Approved :: MIT License",
dynamic = ["version", "description"]
requires-python = '>=3.9'
dependencies = [
"fabric_fim >= 1.6.0",
"fabric_fim >= 1.6.2",
"pyjq == 2.6.0",
"jsonpath_ng == 1.5.3",
]
Expand Down

0 comments on commit 0ce0f99

Please sign in to comment.