From 0d0f9c8bf26c4d227d9992ea728bb78082ad16f3 Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sun, 9 Jun 2019 20:00:01 +0300 Subject: [PATCH 1/4] ap: add support for WS2016-2019 --- win/tools/autopatch/autopatch.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/win/tools/autopatch/autopatch.py b/win/tools/autopatch/autopatch.py index 77782a3..99074ad 100755 --- a/win/tools/autopatch/autopatch.py +++ b/win/tools/autopatch/autopatch.py @@ -168,9 +168,13 @@ def main(): "300": "", "301": "nsd_", } - installer_basename = os.path.basename(args.installer_file) - os_prefix = ('ws2012_x64' if 'winserv' in installer_basename.lower() - else 'win10_x64') + installer_name = os.path.basename(args.installer_file).lower() + if 'winserv2008' in installer_name: + os_prefix = 'ws2012_x64' + elif 'winserv-2016' in installer_name: + os_prefix = 'ws2016_x64' + else: + os_prefix = 'win10_x64' driver_name = drv_prefix[product_type] + version out_dir = os.path.join( os.path.dirname( From cc676386034b786e7c393f02a2ad870e341724bd Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sun, 9 Jun 2019 21:34:57 +0300 Subject: [PATCH 2/4] ap: more strict filename matching --- win/tools/autopatch/autopatch.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/win/tools/autopatch/autopatch.py b/win/tools/autopatch/autopatch.py index 99074ad..996f3d3 100755 --- a/win/tools/autopatch/autopatch.py +++ b/win/tools/autopatch/autopatch.py @@ -54,6 +54,9 @@ class ExtractException(Exception): class PatternNotFoundException(Exception): pass +class UnknownPlatformException(Exception): + pass + class ExtractedTarget: name = None @@ -173,8 +176,11 @@ def main(): os_prefix = 'ws2012_x64' elif 'winserv-2016' in installer_name: os_prefix = 'ws2016_x64' - else: + elif 'win10' in installer_name: os_prefix = 'win10_x64' + else: + raise UnknownPlatformException("Can't infer platform from filename %s" + % (repr(installer_name),)) driver_name = drv_prefix[product_type] + version out_dir = os.path.join( os.path.dirname( From 129249995e9b9a51356c40573b6673a7a2495d92 Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sun, 9 Jun 2019 21:45:31 +0300 Subject: [PATCH 3/4] ndl: add WS{2016,2019} --- tools/nv-driver-locator/README.md | 25 ++++++++++++++++++- .../nv-driver-locator/get_nvidia_downloads.py | 2 ++ .../nv-driver-locator.json.sample | 9 +++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/tools/nv-driver-locator/README.md b/tools/nv-driver-locator/README.md index ffd0f0f..f71de80 100644 --- a/tools/nv-driver-locator/README.md +++ b/tools/nv-driver-locator/README.md @@ -187,6 +187,29 @@ All scripts may be used both as standalone application and importable module. Fo "product": "QuadroMobile", "certlevel": "All" } + }, + { + "type": "nvidia_downloads", + "name": "downloads win server quadro certified", + "params": { + "os": "WindowsServer2012R2_64", + "product": "Quadro", + "certlevel": "Certified" + } + }, + { + "type": "nvidia_downloads", + "name": "downloads win server 2019 quadro certified", + "params": { + "os": "WindowsServer2019", + "product": "Quadro", + "certlevel": "Certified" + } + }, + { + "type": "cuda_downloads", + "name": "cuda toolkit tracker", + "params": {} } ], "notifiers": [ @@ -261,7 +284,7 @@ Type: `nvidia_downloads` Params: -* `os` - OS family, version and bitness. Allowed values: `Linux_32`, `Linux_64`, `Windows7_32`, `Windows7_64`, `Windows10_32`, `Windows10_64`, `WindowsServer2012R2_32`, `WindowsServer2012R2_64`. Default: `Linux_64`. +* `os` - OS family, version and bitness. Allowed values: `Linux_32`, `Linux_64`, `Windows7_32`, `Windows7_64`, `Windows10_32`, `Windows10_64`, `WindowsServer2012R2_32`, `WindowsServer2012R2_64`, `WindowsServer2016`, `WindowsServer2019`. Default: `Linux_64`. * `product` - product kind. Allowed values: `GeForce`, `GeForceMobile`, `Quadro`, `QuadroMobile`. Default: `GeForce`. * `certlevel` - driver certification level. Allowed values: `All` - any certification level, `Beta` - beta drivers, `Certified` - WHQL certified in Windows case and Nvidia certified in Linux case, `ODE` - Optimal Driver for Enterprise (Quadro driver), `QNF` - Quadro New Feature (Quadro driver). Default: `All`. * `driver_type` - driver type. Allowed values: `Standard`, `DCH`. At this moment DCH driver appears to exists only for some product families and only for Windows 10 x64. Default: `Standard`. diff --git a/tools/nv-driver-locator/get_nvidia_downloads.py b/tools/nv-driver-locator/get_nvidia_downloads.py index b1c29a3..9df495d 100755 --- a/tools/nv-driver-locator/get_nvidia_downloads.py +++ b/tools/nv-driver-locator/get_nvidia_downloads.py @@ -21,6 +21,8 @@ class OS(enum.Enum): Windows10_64 = 57 WindowsServer2012R2_32 = 32 WindowsServer2012R2_64 = 44 + WindowsServer2016 = 74 + WindowsServer2019 = 119 def __str__(self): return self.name diff --git a/tools/nv-driver-locator/nv-driver-locator.json.sample b/tools/nv-driver-locator/nv-driver-locator.json.sample index 8b53eed..39326c3 100644 --- a/tools/nv-driver-locator/nv-driver-locator.json.sample +++ b/tools/nv-driver-locator/nv-driver-locator.json.sample @@ -176,6 +176,15 @@ "certlevel": "Certified" } }, + { + "type": "nvidia_downloads", + "name": "downloads win server 2019 quadro certified", + "params": { + "os": "WindowsServer2019", + "product": "Quadro", + "certlevel": "Certified" + } + }, { "type": "cuda_downloads", "name": "cuda toolkit tracker", From 40474ebe817c89f91480d6b4401b0da809e66897 Mon Sep 17 00:00:00 2001 From: Vladislav Yarmak Date: Sun, 9 Jun 2019 22:32:48 +0300 Subject: [PATCH 4/4] ndl: add request meta into response object --- tools/nv-driver-locator/README.md | 4 ++ .../nv-driver-locator.json.sample | 4 ++ tools/nv-driver-locator/nv-driver-locator.py | 62 +++++++++++++++++-- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/tools/nv-driver-locator/README.md b/tools/nv-driver-locator/README.md index f71de80..688ea53 100644 --- a/tools/nv-driver-locator/README.md +++ b/tools/nv-driver-locator/README.md @@ -50,6 +50,10 @@ All scripts may be used both as standalone application and importable module. Fo [ "DriverAttributes", "Name" + ], + [ + "ChannelAttributes", + "OS" ] ], "channels": [ diff --git a/tools/nv-driver-locator/nv-driver-locator.json.sample b/tools/nv-driver-locator/nv-driver-locator.json.sample index 39326c3..556f02b 100644 --- a/tools/nv-driver-locator/nv-driver-locator.json.sample +++ b/tools/nv-driver-locator/nv-driver-locator.json.sample @@ -13,6 +13,10 @@ [ "DriverAttributes", "Name" + ], + [ + "ChannelAttributes", + "OS" ] ], "channels": [ diff --git a/tools/nv-driver-locator/nv-driver-locator.py b/tools/nv-driver-locator/nv-driver-locator.py index 6c167fc..7c9470f 100755 --- a/tools/nv-driver-locator/nv-driver-locator.py +++ b/tools/nv-driver-locator/nv-driver-locator.py @@ -58,8 +58,11 @@ class Hasher: def _eval_key_component(self, obj, component_path): res = obj - for path_component in component_path: - res = res[path_component] + try: + for path_component in component_path: + res = res[path_component] + except (KeyError, IndexError): + return b'' return str(res).encode('utf-8') def hash_object(self, obj): @@ -147,14 +150,53 @@ class BaseChannel(ABC): class GFEClientChannel(BaseChannel): - def __init__(self, name, **kwargs): + def __init__(self, name, notebook=False, + x86_64=True, + os_version="10.0", + os_build="17763", + language=1033, + beta=False, + dch=False, + crd=False, + timeout=10): self.name = name - self._kwargs = kwargs + self._notebook = notebook + self._x86_64 = x86_64 + self._os_version = os_version + self._os_build = os_build + self._language = language + self._beta = beta + self._dch = dch + self._crd = crd + self._timeout = timeout gfe_get_driver = importlib.import_module('gfe_get_driver') self._get_latest_driver = gfe_get_driver.get_latest_geforce_driver def get_latest_driver(self): - return self._get_latest_driver(**self._kwargs) + res = self._get_latest_driver(notebook=self._notebook, + x86_64=self._x86_64, + os_version=self._os_version, + os_build=self._os_build, + language=self._language, + beta=self._beta, + dch=self._dch, + crd=self._crd, + timeout=self._timeout) + res.update({ + 'ChannelAttributes': { + 'Name': self.name, + 'Type': self.__class__.__name__, + 'OS': 'Windows%d_%d' % (float(self._os_version), + 64 if self._x86_64 else 32), + 'OSBuild': self._os_build, + 'Language': self._language, + 'Beta': self._beta, + 'DCH': self._dch, + 'CRD': self._crd, + 'Mobile': self._notebook, + } + }) + return res class NvidiaDownloadsChannel(BaseChannel): @@ -193,6 +235,16 @@ class NvidiaDownloadsChannel(BaseChannel): 'Version': latest['version'], 'Name': latest['name'], 'NameLocalized': latest['name'], + }, + 'ChannelAttributes': { + 'Name': self.name, + 'Type': self.__class__.__name__, + 'OS': self._os.name, + 'Product': self._product.name, + 'CertLevel': self._certlevel.name, + 'DriverType': self._driver_type.name, + 'Lang': self._lang.name, + 'CudaVer': self._cuda_ver.name, } }