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
a82e6112
Commit
a82e6112
authored
Sep 27, 2019
by
Vladislav Yarmak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linux: patch.sh: new opmode - list supported versions
parent
1029bfb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
patch.sh
patch.sh
+21
-8
No files found.
patch.sh
View file @
a82e6112
...
@@ -9,7 +9,7 @@ silent_flag=''
...
@@ -9,7 +9,7 @@ silent_flag=''
print_usage
()
{
printf
'
print_usage
()
{
printf
'
SYNOPSIS
SYNOPSIS
patch.sh [-s] [-r|-h|-c VERSION]
patch.sh [-s] [-r|-h|-c VERSION
|-l
]
DESCRIPTION
DESCRIPTION
The patch for Nvidia drivers to remove NVENC session limit
The patch for Nvidia drivers to remove NVENC session limit
...
@@ -19,6 +19,7 @@ DESCRIPTION
...
@@ -19,6 +19,7 @@ DESCRIPTION
-h Print this help message
-h Print this help message
-c VERSION Check if version VERSION supported by this patch.
-c VERSION Check if version VERSION supported by this patch.
Returns true exit code (0) if version is supported.
Returns true exit code (0) if version is supported.
-l List supported driver versions
'
'
}
}
...
@@ -26,12 +27,13 @@ DESCRIPTION
...
@@ -26,12 +27,13 @@ DESCRIPTION
# shellcheck disable=SC2209
# shellcheck disable=SC2209
opmode
=
"patch"
opmode
=
"patch"
while
getopts
'rshc:'
flag
;
do
while
getopts
'rshc:
l
'
flag
;
do
case
"
${
flag
}
"
in
case
"
${
flag
}
"
in
r
)
opmode
=
"
${
opmode
}
rollback"
;;
r
)
opmode
=
"
${
opmode
}
rollback"
;;
s
)
silent_flag
=
'true'
;;
s
)
silent_flag
=
'true'
;;
h
)
opmode
=
"
${
opmode
}
help"
;;
h
)
opmode
=
"
${
opmode
}
help"
;;
c
)
opmode
=
"
${
opmode
}
checkversion"
;
checked_version
=
"
$OPTARG
"
;;
c
)
opmode
=
"
${
opmode
}
checkversion"
;
checked_version
=
"
$OPTARG
"
;;
l
)
opmode
=
"
${
opmode
}
listversions"
;;
*
)
echo
"Incorrect option specified in command line"
;
exit
2
;;
*
)
echo
"Incorrect option specified in command line"
;
exit
2
;;
esac
esac
done
done
...
@@ -115,6 +117,13 @@ check_version_supported () {
...
@@ -115,6 +117,13 @@ check_version_supported () {
[[
"
${
patch_list
[
$ver
]+isset
}
"
&&
"
${
object_list
[
$ver
]+isset
}
"
]]
[[
"
${
patch_list
[
$ver
]+isset
}
"
&&
"
${
object_list
[
$ver
]+isset
}
"
]]
}
}
get_supported_versions
()
{
for
drv
in
"
${
!patch_list[@]
}
"
;
do
[[
"
${
object_list
[
$drv
]+isset
}
"
]]
&&
echo
"
$drv
"
done
|
sort
-t
.
-n
return
0
}
patch_common
()
{
patch_common
()
{
NVIDIA_SMI
=
"
$(
command
-v
nvidia-smi
||
true
)
"
NVIDIA_SMI
=
"
$(
command
-v
nvidia-smi
||
true
)
"
if
[[
!
"
$NVIDIA_SMI
"
]]
;
then
if
[[
!
"
$NVIDIA_SMI
"
]]
;
then
...
@@ -130,11 +139,9 @@ patch_common () {
...
@@ -130,11 +139,9 @@ patch_common () {
echo
"Detected nvidia driver version:
$driver_version
"
echo
"Detected nvidia driver version:
$driver_version
"
if
!
check_version_supported
"
$driver_version
"
;
then
if
!
check_version_supported
"
$driver_version
"
;
then
echo
"Patch for this (
$driver_version
) nvidia driver not found."
1>&2
echo
"Patch for this (
$driver_version
) nvidia driver not found."
echo
"Available patches for: "
1>&2
echo
"Patch is available for versions: "
for
drv
in
"
${
!patch_list[@]
}
"
;
do
get_supported_versions
echo
"
$drv
"
1>&2
done
exit
1
exit
1
fi
fi
...
@@ -198,10 +205,16 @@ query_version_support () {
...
@@ -198,10 +205,16 @@ query_version_support () {
fi
fi
}
}
list_supported_versions
()
{
get_supported_versions
}
case
"
${
opmode
}
"
in
case
"
${
opmode
}
"
in
patch
)
patch
;;
patch
)
patch
;;
patchrollback
)
rollback
;;
patchrollback
)
rollback
;;
patchhelp
)
print_usage
;
exit
2
;;
patchhelp
)
print_usage
;
exit
2
;;
patchcheckversion
)
query_version_support
;;
patchcheckversion
)
query_version_support
;;
*
)
echo
"Incorrect combination of flags"
;
exit
2
;;
patchlistversions
)
list_supported_versions
;;
*
)
echo
"Incorrect combination of flags. Use option -h to get help."
exit
2
;;
esac
esac
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