1
0
nvidia-open-driver-G06-signed/json-to-pci-id-list.py
Stefan Dirsch 2c597297d3 Accepting request 1185229 from home:eeich:branches:X11:Drivers:Video:Redesign
- Add a second flavor for building the kernel module versions
  used by CUDA. The kmp targetting CUDA contains '-cuda' in
  its name to track its versions separately from the graphics
  kmp.
- Provide the meta package nv-prefer-signed-open-driver to
  make sure the latest available SUSE-build open driver is
  installed - independent of the latest available open driver
  version in he CUDA repository.
  Rationale:
  The package cuda-runtime provides the link between CUDA and
  the kernel driver version through a
  Requires: cuda-drivers >= %version
  This implies that a CUDA version will run withany kernel driver
  version equal or higher than a base version.
  nvidia-compute-G06 provides the glue layer between CUDA and
  a specific version of he kernel driver both by providing
  a set of base libraries and by requiring a specific kernel
  version. 'cuda-drivers' (provided by nvidia-compute-utils-G06)
  requires an unversioned nvidia-compute-G06. With this, the
  resolver will install the latest available and applicable
  nvidia-compute-G06.
  nv-prefer-signed-open-driver then represents the latest available
  open driver version and restricts the nvidia-compute-G06 version
  to it.

  * addresses boo#1223454

OBS-URL: https://build.opensuse.org/request/show/1185229
OBS-URL: https://build.opensuse.org/package/show/X11:Drivers:Video:Redesign/nvidia-open-driver-G06-signed?expand=0&rev=101
2024-07-04 11:29:38 +00:00

54 lines
2.0 KiB
Python

#!/usr/bin/env python3
# Copyright (c) 2022 Tamara Schmitz <tamara.schmitz@suse.com>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import argparse
import json
# arg parsing
parser = argparse.ArgumentParser(description="Parse an NVIDIA supported devices\
JSON and convert it to a pci id list.")
parser.add_argument("INPUT_JSON",
help="The JSON file to be parsed",
type=argparse.FileType('r')
)
parser.add_argument("OUTPUT_PCI_ID_LIST",
help="The output file to save to",
type=argparse.FileType('w')
)
parser.add_argument("--skiplegacy", help="Skip GPUs that are in a legacy branch",
action="store_true")
parser.add_argument("--kernelopen", help="Only select GPUs that are supported by\
the Open GPU kernel modules",
action="store_true")
args = parser.parse_args()
# json parsing
json = json.load(args.INPUT_JSON)
pci_id_list = {}
for chip in json["chips"]:
if args.skiplegacy and "legacybranch" in chip:
continue
if args.kernelopen and \
("features" not in chip or "kernelopen" not in chip["features"]):
continue
if "devid" in chip and "name" in chip:
pci_id_list[chip["devid"]] = chip["name"]
# write to file
for devid, name in sorted(pci_id_list.items(), key=lambda i: i[0]):
# there are no duplicates since a dictionary's key is unique
args.OUTPUT_PCI_ID_LIST.write("%s %s\n" % (devid, name))