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
7ac81f3a
Commit
7ac81f3a
authored
May 20, 2019
by
Snawoot
Committed by
GitHub
May 20, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #113 from Snawoot/ndl_cuda_tk
ndl: track cuda toolkit releases
parents
ea72a629
2ad94631
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
2 deletions
+108
-2
tools/nv-driver-locator/README.md
tools/nv-driver-locator/README.md
+10
-2
tools/nv-driver-locator/get_cuda_downloads.py
tools/nv-driver-locator/get_cuda_downloads.py
+71
-0
tools/nv-driver-locator/nv-driver-locator.json.sample
tools/nv-driver-locator/nv-driver-locator.json.sample
+5
-0
tools/nv-driver-locator/nv-driver-locator.py
tools/nv-driver-locator/nv-driver-locator.py
+22
-0
No files found.
tools/nv-driver-locator/README.md
View file @
7ac81f3a
...
@@ -257,8 +257,6 @@ Params:
...
@@ -257,8 +257,6 @@ Params:
Parses Nvidia downloads site.
Parses Nvidia downloads site.
Params:
Type:
`nvidia_downloads`
Type:
`nvidia_downloads`
Params:
Params:
...
@@ -271,6 +269,16 @@ Params:
...
@@ -271,6 +269,16 @@ Params:
*
`cuda_ver`
- verson of CUDA Toolkit bundled with driver. Currently useless for covered product families. Default:
`Nothing`
.
*
`cuda_ver`
- verson of CUDA Toolkit bundled with driver. Currently useless for covered product families. Default:
`Nothing`
.
*
`timeout`
- allowed delay in seconds for each network operation. Default:
`10.0`
*
`timeout`
- allowed delay in seconds for each network operation. Default:
`10.0`
#### CudaToolkitDownloadsChannel
Parses CUDA Toolkit downloads archive and extracts kit name instead of driver name.
Type:
`cuda_downloads`
Params:
*
`timeout`
- allowed delay in seconds for each network operation. Default:
`10.0`
### Notifiers
### Notifiers
#### CommandNotifier
#### CommandNotifier
...
...
tools/nv-driver-locator/get_cuda_downloads.py
0 → 100755
View file @
7ac81f3a
#!/usr/bin/env python3
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'
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 drivers from "
"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
issue_request
(
timeout
=
10
):
ENDPOINT
=
'https://developer.nvidia.com/cuda-toolkit-archive'
http_req
=
urllib
.
request
.
Request
(
ENDPOINT
,
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_latest_cuda_tk
(
*
,
timeout
=
10
):
doc
=
issue_request
(
timeout
)
soup
=
BeautifulSoup
(
doc
,
'html.parser'
)
res
=
soup
.
find
(
'strong'
,
string
=
re
.
compile
(
r'^\s*latest\s+release\s*$'
,
re
.
I
))
.
\
parent
.
find
(
'a'
,
string
=
re
.
compile
(
r'^\s*cuda\s+toolkit\s+.*$'
,
re
.
I
))
.
\
string
return
res
def
main
():
import
pprint
args
=
parse_args
()
print
(
get_latest_cuda_tk
(
timeout
=
args
.
timeout
))
if
__name__
==
'__main__'
:
main
()
tools/nv-driver-locator/nv-driver-locator.json.sample
View file @
7ac81f3a
...
@@ -175,6 +175,11 @@
...
@@ -175,6 +175,11 @@
"product": "Quadro",
"product": "Quadro",
"certlevel": "Certified"
"certlevel": "Certified"
}
}
},
{
"type": "cuda_downloads",
"name": "cuda toolkit tracker",
"params": {}
}
}
],
],
"notifiers": [
"notifiers": [
...
...
tools/nv-driver-locator/nv-driver-locator.py
View file @
7ac81f3a
...
@@ -197,6 +197,27 @@ class NvidiaDownloadsChannel(BaseChannel):
...
@@ -197,6 +197,27 @@ class NvidiaDownloadsChannel(BaseChannel):
}
}
class
CudaToolkitDownloadsChannel
(
BaseChannel
):
def
__init__
(
self
,
name
,
*
,
timeout
=
10
):
self
.
name
=
name
gcd
=
importlib
.
import_module
(
'get_cuda_downloads'
)
self
.
_gcd
=
gcd
self
.
_timeout
=
timeout
def
get_latest_driver
(
self
):
latest
=
self
.
_gcd
.
get_latest_cuda_tk
(
timeout
=
self
.
_timeout
)
if
not
latest
:
return
None
return
{
'DriverAttributes'
:
{
'Version'
:
'???'
,
'Name'
:
latest
,
'NameLocalized'
:
latest
,
}
}
def
parse_args
():
def
parse_args
():
parser
=
argparse
.
ArgumentParser
(
parser
=
argparse
.
ArgumentParser
(
description
=
"Watches for GeForce experience driver updates for "
description
=
"Watches for GeForce experience driver updates for "
...
@@ -223,6 +244,7 @@ class DriverLocator:
...
@@ -223,6 +244,7 @@ class DriverLocator:
channel_types
=
{
channel_types
=
{
'gfe_client'
:
GFEClientChannel
,
'gfe_client'
:
GFEClientChannel
,
'nvidia_downloads'
:
NvidiaDownloadsChannel
,
'nvidia_downloads'
:
NvidiaDownloadsChannel
,
'cuda_downloads'
:
CudaToolkitDownloadsChannel
,
}
}
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