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
a351f3fd
Commit
a351f3fd
authored
Oct 31, 2020
by
Vladislav Yarmak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndl: allow sequence output for each channel
parent
f6e3c20c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
26 deletions
+41
-26
tools/nv-driver-locator/nv-driver-locator.py
tools/nv-driver-locator/nv-driver-locator.py
+41
-26
No files found.
tools/nv-driver-locator/nv-driver-locator.py
View file @
a351f3fd
...
...
@@ -150,7 +150,7 @@ class CommandNotifier(BaseNotifier):
class
BaseChannel
(
ABC
):
@
abstractmethod
def
get_latest_driver
(
self
):
def
get_latest_driver
s
(
self
):
pass
...
...
@@ -175,10 +175,10 @@ class GFEClientChannel(BaseChannel):
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
self
.
_get_latest_driver
s
=
gfe_get_driver
.
get_latest_geforce_driver
def
get_latest_driver
(
self
):
res
=
self
.
_get_latest_driver
(
notebook
=
self
.
_notebook
,
def
get_latest_driver
s
(
self
):
res
=
self
.
_get_latest_driver
s
(
notebook
=
self
.
_notebook
,
x86_64
=
self
.
_x86_64
,
os_version
=
self
.
_os_version
,
os_build
=
self
.
_os_build
,
...
...
@@ -187,6 +187,8 @@ class GFEClientChannel(BaseChannel):
dch
=
self
.
_dch
,
crd
=
self
.
_crd
,
timeout
=
self
.
_timeout
)
if
res
is
None
:
return
res
.
update
({
'ChannelAttributes'
:
{
'Name'
:
self
.
name
,
...
...
@@ -201,7 +203,7 @@ class GFEClientChannel(BaseChannel):
'Mobile'
:
self
.
_notebook
,
}
})
return
res
yield
res
class
NvidiaDownloadsChannel
(
BaseChannel
):
...
...
@@ -224,7 +226,7 @@ class NvidiaDownloadsChannel(BaseChannel):
self
.
_cuda_ver
=
gnd
.
CUDAToolkitVersion
[
cuda_ver
]
self
.
_timeout
=
timeout
def
get_latest_driver
(
self
):
def
get_latest_driver
s
(
self
):
latest
=
self
.
_gnd
.
get_drivers
(
os
=
self
.
_os
,
product
=
self
.
_product
,
certlevel
=
self
.
_certlevel
,
...
...
@@ -233,7 +235,7 @@ class NvidiaDownloadsChannel(BaseChannel):
cuda_ver
=
self
.
_cuda_ver
,
timeout
=
self
.
_timeout
)
if
not
latest
:
return
None
return
res
=
{
'DriverAttributes'
:
{
'Version'
:
latest
[
'version'
],
...
...
@@ -253,7 +255,7 @@ class NvidiaDownloadsChannel(BaseChannel):
}
if
'download_url'
in
latest
:
res
[
'DriverAttributes'
][
'DownloadURL'
]
=
latest
[
'download_url'
]
return
res
yield
res
class
CudaToolkitDownloadsChannel
(
BaseChannel
):
...
...
@@ -264,11 +266,11 @@ class CudaToolkitDownloadsChannel(BaseChannel):
self
.
_gcd
=
gcd
self
.
_timeout
=
timeout
def
get_latest_driver
(
self
):
def
get_latest_driver
s
(
self
):
latest
=
self
.
_gcd
.
get_latest_cuda_tk
(
timeout
=
self
.
_timeout
)
if
not
latest
:
return
None
return
{
return
yield
{
'DriverAttributes'
:
{
'Version'
:
'???'
,
'Name'
:
latest
,
...
...
@@ -289,11 +291,11 @@ class VulkanBetaDownloadsChannel(BaseChannel):
self
.
_os
=
os
self
.
_timeout
=
timeout
def
get_latest_driver
(
self
):
def
get_latest_driver
s
(
self
):
drivers
=
vulkan_downloads
(
timeout
=
self
.
_timeout
)
for
drv
in
drivers
:
if
drv
[
"os"
]
==
self
.
_os
:
return
{
yield
{
'DriverAttributes'
:
{
'Version'
:
drv
[
'version'
],
'Name'
:
drv
[
'name'
],
...
...
@@ -301,7 +303,7 @@ class VulkanBetaDownloadsChannel(BaseChannel):
}
}
else
:
return
None
return
def
parse_args
():
...
...
@@ -389,26 +391,39 @@ class DriverLocator:
def
run
(
self
):
for
ch
in
self
.
_channels
:
counter
=
0
try
:
dr
v
=
ch
.
get_latest_driver
()
dr
ivers
=
ch
.
get_latest_drivers
()
except
Exception
as
e
:
self
.
_perror
(
"get_latest_driver() invocation failed for "
self
.
_perror
(
"get_latest_driver
s
() invocation failed for "
"channel
%
s. Exception:
%
s. Continuing..."
%
(
repr
(
ch
.
name
),
str
(
e
)))
continue
if
drv
is
None
:
self
.
_perror
(
"Driver not found for channel
%
s"
%
(
repr
(
ch
.
name
),))
continue
try
:
key
=
self
.
_hasher
.
hash_object
(
drv
)
# Fetch
for
drv
in
drivers
:
counter
+=
1
# Hash
try
:
key
=
self
.
_hasher
.
hash_object
(
drv
)
except
Exception
as
e
:
self
.
_perror
(
"Key evaluation failed for channel
%
s. "
"Exception:
%
s"
%
(
repr
(
name
),
str
(
e
)))
continue
# Notify
if
not
self
.
_db
.
check_key
(
key
):
if
self
.
_notify_all
(
drv
):
self
.
_db
.
set_key
(
key
,
drv
)
except
Exception
as
e
:
self
.
_perror
(
"
Key evaluation failed for channel
%
s. "
"Exception:
%
s"
%
(
repr
(
name
),
str
(
e
)))
self
.
_perror
(
"
channel
%
s enumeration terminated with exception:
%
s"
%
(
repr
(
name
),
str
(
e
)))
continue
if
not
self
.
_db
.
check_key
(
key
):
if
self
.
_notify_all
(
drv
):
self
.
_db
.
set_key
(
key
,
drv
)
if
not
counter
:
self
.
_perror
(
"Drivers not found for channel
%
s"
%
(
repr
(
ch
.
name
),))
return
self
.
_ret_code
...
...
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