Files
packages/anda/system/nvidia/nvidia-driver/parse-supported-gpus.py
T
Cappy Ishihara c72c975c16 [BREAKING FOR RPMFUSION USERS] NVIDIA Drivers (#2862)
* add nvidia-kmod

* add settings, xsettings, mock label

* oops

* add nvidia setting assets

* add libva-nvidia-driver

* add: nvidia-kmod-common w/ properietary defaults

* download the x86 version of the driver package when running common

* add nvidia-driver package

* I don't think we actually need i386

* add a readme, fix build error and clean up script

* add back the accursed tarball script, we can port the thing later

* add nvidia-modprobe

* update metadata, add nvidia-persistenced

* add update scripts to nvidia drivers

* add update scripts for every cuda package

* make the component fetch a separate function for memoization

* cusparse

* cusparselt is not from cuda toolkit

* add nvidia subrepo label for multirepo

* set version for nvidia tarball

* nvidia-driver: download tarballs on build time

* clean up inline prep script

* NVProf is dropped in Jetpack 5, so there's no ARM version of it.
2025-01-12 17:45:18 +08:00

44 lines
1.2 KiB
Python
Executable File

#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021-2024 Simone Caronni <negativo17@gmail.com>
# Licensed under the GNU General Public License Version or later
import json
import sys
import xml.etree.ElementTree as ElementTree
def main():
if len(sys.argv) != 3:
print("usage: %s supported-gpus.json com.nvidia.driver.metainfo.xml" % sys.argv[0])
return 1
json_input = open(sys.argv[1])
gpus_raw = json.load(json_input)
legacy = 'legacybranch'
devids = []
for product in gpus_raw["chips"]:
if legacy not in product.keys():
devid = int(product["devid"], 16)
if not devid in devids:
devids.append(devid)
appstream_xml = ElementTree.parse(sys.argv[2])
root = appstream_xml.getroot()
provides = ElementTree.Element('provides')
root.append(provides)
for devid in devids:
modalias = ElementTree.SubElement(provides, "modalias")
modalias.text = "pci:v000010DEd%08Xsv*sd*bc*sc*i*" % (devid)
ElementTree.indent(root, space=" ", level=0)
# appstream-util validate requires the xml header
appstream_xml.write(sys.argv[2], encoding="utf-8", xml_declaration=True)
if __name__ == "__main__":
main()