Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
nvidia-patch
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
nvidia-patch
Commits
3726179b
Commit
3726179b
authored
Jan 18, 2020
by
Snawoot
Committed by
GitHub
Jan 18, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #226 from Snawoot/ndl_chan_vulkan_beta
ndl: track Vulkan Beta Drivers
parents
ec7bec5c
31b850f2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
153 additions
and
0 deletions
+153
-0
tools/nv-driver-locator/README.md
tools/nv-driver-locator/README.md
+26
-0
tools/nv-driver-locator/get_vulkan_downloads.py
tools/nv-driver-locator/get_vulkan_downloads.py
+84
-0
tools/nv-driver-locator/nv-driver-locator.json.sample
tools/nv-driver-locator/nv-driver-locator.json.sample
+14
-0
tools/nv-driver-locator/nv-driver-locator.py
tools/nv-driver-locator/nv-driver-locator.py
+29
-0
No files found.
tools/nv-driver-locator/README.md
View file @
3726179b
...
@@ -23,6 +23,7 @@ All scripts may be used both as standalone application and importable module. Fo
...
@@ -23,6 +23,7 @@ All scripts may be used both as standalone application and importable module. Fo
*
mailer.py - module with email routines and minimalistic email client for test purposes.
*
mailer.py - module with email routines and minimalistic email client for test purposes.
*
gfe
\_
get
\_
driver.py - GeForce Experience client library (and test util).
*
gfe
\_
get
\_
driver.py - GeForce Experience client library (and test util).
*
get
\_
nvidia
\_
downloads.py - Nvidia downloads site parser (and test util).
*
get
\_
nvidia
\_
downloads.py - Nvidia downloads site parser (and test util).
*
get
\_
vulkan
\_
downloads.py - Nvidia Developer downloads site parser (and test util). Used for Vulkan Beta Drivers.
### Operation
### Operation
...
@@ -214,6 +215,20 @@ All scripts may be used both as standalone application and importable module. Fo
...
@@ -214,6 +215,20 @@ All scripts may be used both as standalone application and importable module. Fo
"type"
:
"cuda_downloads"
,
"type"
:
"cuda_downloads"
,
"name"
:
"cuda toolkit tracker"
,
"name"
:
"cuda toolkit tracker"
,
"params"
:
{}
"params"
:
{}
},
{
"type"
:
"vulkan_beta"
,
"name"
:
"vulkan beta windows"
,
"params"
:
{
"os"
:
"Windows"
}
},
{
"type"
:
"vulkan_beta"
,
"name"
:
"vulkan beta linux"
,
"params"
:
{
"os"
:
"Linux"
}
}
}
],
],
"notifiers"
:
[
"notifiers"
:
[
...
@@ -306,6 +321,17 @@ Params:
...
@@ -306,6 +321,17 @@ Params:
*
`timeout`
- allowed delay in seconds for each network operation. Default:
`10.0`
*
`timeout`
- allowed delay in seconds for each network operation. Default:
`10.0`
#### VulkanBetaDownloadsChannel
Parses Nvidia Developer downloads site for latest Vulkan Beta Drivers.
Type:
`vulkan_beta`
Params:
*
`os`
- OS family. Allowed values:
`Linux`
,
`Windows`
. Default:
`Linux`
.
*
`timeout`
- allowed delay in seconds for each network operation. Default:
`10.0`
### Notifiers
### Notifiers
#### CommandNotifier
#### CommandNotifier
...
...
tools/nv-driver-locator/get_vulkan_downloads.py
0 → 100755
View file @
3726179b
#!/usr/bin/env python3
import
sys
import
urllib.request
import
urllib.error
import
urllib.parse
import
codecs
import
enum
import
re
from
bs4
import
BeautifulSoup
USER_AGENT
=
'Mozilla/5.0 (X11; Linux x86_64; rv:65.0) '
\
'Gecko/20100101 Firefox/65.0'
URL
=
'https://developer.nvidia.com/vulkan-driver'
def
parse_args
():
import
argparse
def
check_positive_float
(
val
):
val
=
float
(
val
)
if
val
<=
0
:
raise
ValueError
(
"Value
%
s is not valid positive float"
%
(
repr
(
val
),))
return
val
parser
=
argparse
.
ArgumentParser
(
description
=
"Retrieves info about latest NVIDIA Vulkan beta drivers "
"from developer downloads site"
,
formatter_class
=
argparse
.
ArgumentDefaultsHelpFormatter
)
parser
.
add_argument
(
"-T"
,
"--timeout"
,
type
=
check_positive_float
,
default
=
10.
,
help
=
"timeout for network operations"
)
args
=
parser
.
parse_args
()
return
args
def
fetch_url
(
url
,
timeout
=
10
):
http_req
=
urllib
.
request
.
Request
(
url
,
data
=
None
,
headers
=
{
'User-Agent'
:
USER_AGENT
}
)
with
urllib
.
request
.
urlopen
(
http_req
,
None
,
timeout
)
as
resp
:
coding
=
resp
.
headers
.
get_content_charset
()
coding
=
coding
if
coding
is
not
None
else
'utf-8-sig'
decoder
=
codecs
.
getreader
(
coding
)(
resp
)
res
=
decoder
.
read
()
return
res
def
get_drivers
(
*
,
timeout
=
10
):
body
=
fetch_url
(
URL
)
soup
=
BeautifulSoup
(
body
,
'html.parser'
)
result
=
[]
for
sibling
in
soup
.
find
(
'h4'
,
string
=
re
.
compile
(
r'Vulkan .* Developer Beta Driver Downloads'
,
re
.
I
)
)
.
next_siblings
:
if
sibling
.
name
==
'h4'
:
break
if
sibling
.
name
==
'p'
and
sibling
.
b
is
not
None
:
m
=
re
.
match
(
r'(Windows|Linux)\s+((\d+\.){1,2}\d+)'
,
sibling
.
b
.
string
)
if
m
is
not
None
:
ver
=
m
.
group
(
2
)
os
=
m
.
group
(
1
)
obj
=
{
"name"
:
"Vulkan Beta Driver for
%
s"
%
(
os
,),
"os"
:
os
,
"version"
:
ver
,
}
result
.
append
(
obj
)
return
result
def
main
():
import
pprint
args
=
parse_args
()
pprint
.
pprint
(
get_drivers
(
timeout
=
args
.
timeout
))
if
__name__
==
'__main__'
:
main
()
tools/nv-driver-locator/nv-driver-locator.json.sample
View file @
3726179b
...
@@ -238,6 +238,20 @@
...
@@ -238,6 +238,20 @@
"type": "cuda_downloads",
"type": "cuda_downloads",
"name": "cuda toolkit tracker",
"name": "cuda toolkit tracker",
"params": {}
"params": {}
},
{
"type": "vulkan_beta",
"name": "vulkan beta windows",
"params": {
"os": "Windows"
}
},
{
"type": "vulkan_beta",
"name": "vulkan beta linux",
"params": {
"os": "Linux"
}
}
}
],
],
"notifiers": [
"notifiers": [
...
...
tools/nv-driver-locator/nv-driver-locator.py
View file @
3726179b
...
@@ -7,6 +7,7 @@ import hashlib
...
@@ -7,6 +7,7 @@ import hashlib
import
importlib
import
importlib
import
logging
import
logging
from
abc
import
ABC
,
abstractmethod
from
abc
import
ABC
,
abstractmethod
import
functools
HASH_DELIM
=
b
'
\x00
'
HASH_DELIM
=
b
'
\x00
'
...
@@ -275,6 +276,33 @@ class CudaToolkitDownloadsChannel(BaseChannel):
...
@@ -275,6 +276,33 @@ class CudaToolkitDownloadsChannel(BaseChannel):
}
}
}
}
@
functools
.
lru_cache
(
maxsize
=
0
)
def
vulkan_downloads
(
*
,
timeout
=
10
):
gvd
=
importlib
.
import_module
(
'get_vulkan_downloads'
)
return
gvd
.
get_drivers
(
timeout
=
timeout
)
class
VulkanBetaDownloadsChannel
(
BaseChannel
):
def
__init__
(
self
,
name
,
*
,
os
=
"Linux"
,
timeout
=
10
):
self
.
name
=
name
self
.
_os
=
os
self
.
_timeout
=
timeout
def
get_latest_driver
(
self
):
drivers
=
vulkan_downloads
(
timeout
=
self
.
_timeout
)
for
drv
in
drivers
:
if
drv
[
"os"
]
==
self
.
_os
:
return
{
'DriverAttributes'
:
{
'Version'
:
drv
[
'version'
],
'Name'
:
drv
[
'name'
],
'NameLocalized'
:
drv
[
'name'
],
}
}
else
:
return
None
def
parse_args
():
def
parse_args
():
parser
=
argparse
.
ArgumentParser
(
parser
=
argparse
.
ArgumentParser
(
...
@@ -303,6 +331,7 @@ class DriverLocator:
...
@@ -303,6 +331,7 @@ class DriverLocator:
'gfe_client'
:
GFEClientChannel
,
'gfe_client'
:
GFEClientChannel
,
'nvidia_downloads'
:
NvidiaDownloadsChannel
,
'nvidia_downloads'
:
NvidiaDownloadsChannel
,
'cuda_downloads'
:
CudaToolkitDownloadsChannel
,
'cuda_downloads'
:
CudaToolkitDownloadsChannel
,
'vulkan_beta'
:
VulkanBetaDownloadsChannel
,
}
}
channels
=
[]
channels
=
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment