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
58ec6923
Commit
58ec6923
authored
Nov 02, 2020
by
Snawoot
Committed by
GitHub
Nov 02, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #340 from vojtad/feat/driver-version-switch
linux: add -d switch to specify nvidia driver version manually
parents
e56416e4
95dd542a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
29 deletions
+50
-29
README.md
README.md
+4
-2
patch-fbc.sh
patch-fbc.sh
+23
-13
patch.sh
patch.sh
+23
-14
No files found.
README.md
View file @
58ec6923
...
...
@@ -128,10 +128,10 @@ git clone https://ipfs.io/ipns/Qmed4r8yrBP162WK1ybd1DJWhLUi4t6mGuBoB9fLtjxR7u nv
# bash ./patch.sh -h
SYNOPSIS
patch.sh [-s] [-r|-h|-c VERSION|-l]
patch
-fbc
.sh [-s] [-r|-h|-c VERSION|-l]
DESCRIPTION
The patch for Nvidia drivers to
remove NVENC session limit
The patch for Nvidia drivers to
allow FBC on consumer devices
-s Silent mode (No output)
-r Rollback to original (Restore lib from backup)
...
...
@@ -139,6 +139,8 @@ DESCRIPTION
-c VERSION Check if version VERSION supported by this patch.
Returns true exit code (0) if version is supported.
-l List supported driver versions
-d VERSION Use VERSION driver version when looking for libraries
instead of using nvidia-smi to detect it.
```
...
...
patch-fbc.sh
View file @
58ec6923
...
...
@@ -6,6 +6,7 @@ set -euo pipefail ; # <- this semicolon and comment make options apply
backup_path
=
"/opt/nvidia/libnvidia-fbc-backup"
silent_flag
=
''
manual_driver_version
=
''
print_usage
()
{
printf
'
SYNOPSIS
...
...
@@ -20,6 +21,8 @@ DESCRIPTION
-c VERSION Check if version VERSION supported by this patch.
Returns true exit code (0) if version is supported.
-l List supported driver versions
-d VERSION Use VERSION driver version when looking for libraries
instead of using nvidia-smi to detect it.
'
}
...
...
@@ -27,13 +30,14 @@ DESCRIPTION
# shellcheck disable=SC2209
opmode
=
"patch"
while
getopts
'rshc:l'
flag
;
do
while
getopts
'rshc:l
d:
'
flag
;
do
case
"
${
flag
}
"
in
r
)
opmode
=
"
${
opmode
}
rollback"
;;
s
)
silent_flag
=
'true'
;;
h
)
opmode
=
"
${
opmode
}
help"
;;
c
)
opmode
=
"
${
opmode
}
checkversion"
;
checked_version
=
"
$OPTARG
"
;;
l
)
opmode
=
"
${
opmode
}
listversions"
;;
d
)
manual_driver_version
=
"
$OPTARG
"
;;
*
)
echo
"Incorrect option specified in command line"
;
exit
2
;;
esac
done
...
...
@@ -157,19 +161,25 @@ patch_common () {
exit
1
fi
cmd
=
"
$NVIDIA_SMI
--query-gpu=driver_version --format=csv,noheader,nounits"
driver_versions_list
=
$(
$cmd
)
ret_code
=
$?
driver_version
=
$(
echo
"
$driver_versions_list
"
|
head
-n
1
)
if
[[
$ret_code
-ne
0
]]
;
then
echo
"Can not detect nvidia driver version."
echo
"CMD:
\"
$cmd
\"
"
echo
"Result:
\"
$driver_versions_list
\"
"
echo
"nvidia-smi retcode:
$ret_code
"
exit
1
fi
if
[[
"
$manual_driver_version
"
]]
;
then
driver_version
=
"
$manual_driver_version
"
echo
"Using manually entered nvidia driver version:
$driver_version
"
else
cmd
=
"
$NVIDIA_SMI
--query-gpu=driver_version --format=csv,noheader,nounits"
driver_versions_list
=
$(
$cmd
)
ret_code
=
$?
driver_version
=
$(
echo
"
$driver_versions_list
"
|
head
-n
1
)
if
[[
$ret_code
-ne
0
]]
;
then
echo
"Can not detect nvidia driver version."
echo
"CMD:
\"
$cmd
\"
"
echo
"Result:
\"
$driver_versions_list
\"
"
echo
"nvidia-smi retcode:
$ret_code
"
exit
1
fi
echo
"Detected nvidia driver version:
$driver_version
"
echo
"Detected nvidia driver version:
$driver_version
"
fi
if
!
check_version_supported
"
$driver_version
"
;
then
echo
"Patch for this (
$driver_version
) nvidia driver not found."
...
...
patch.sh
View file @
58ec6923
...
...
@@ -6,6 +6,7 @@ set -euo pipefail ; # <- this semicolon and comment make options apply
backup_path
=
"/opt/nvidia/libnvidia-encode-backup"
silent_flag
=
''
manual_driver_version
=
''
print_usage
()
{
printf
'
SYNOPSIS
...
...
@@ -20,20 +21,22 @@ DESCRIPTION
-c VERSION Check if version VERSION supported by this patch.
Returns true exit code (0) if version is supported.
-l List supported driver versions
-d VERSION Use VERSION driver version when looking for libraries
instead of using nvidia-smi to detect it.
'
}
# shellcheck disable=SC2209
opmode
=
"patch"
while
getopts
'rshc:l'
flag
;
do
while
getopts
'rshc:l
d:
'
flag
;
do
case
"
${
flag
}
"
in
r
)
opmode
=
"
${
opmode
}
rollback"
;;
s
)
silent_flag
=
'true'
;;
h
)
opmode
=
"
${
opmode
}
help"
;;
c
)
opmode
=
"
${
opmode
}
checkversion"
;
checked_version
=
"
$OPTARG
"
;;
l
)
opmode
=
"
${
opmode
}
listversions"
;;
d
)
manual_driver_version
=
"
$OPTARG
"
;;
*
)
echo
"Incorrect option specified in command line"
;
exit
2
;;
esac
done
...
...
@@ -231,19 +234,25 @@ patch_common () {
exit
1
fi
cmd
=
"
$NVIDIA_SMI
--query-gpu=driver_version --format=csv,noheader,nounits"
driver_versions_list
=
$(
$cmd
)
ret_code
=
$?
driver_version
=
$(
echo
"
$driver_versions_list
"
|
head
-n
1
)
if
[[
$ret_code
-ne
0
]]
;
then
echo
"Can not detect nvidia driver version."
echo
"CMD:
\"
$cmd
\"
"
echo
"Result:
\"
$driver_versions_list
\"
"
echo
"nvidia-smi retcode:
$ret_code
"
exit
1
fi
if
[[
"
$manual_driver_version
"
]]
;
then
driver_version
=
"
$manual_driver_version
"
echo
"Detected nvidia driver version:
$driver_version
"
echo
"Using manually entered nvidia driver version:
$driver_version
"
else
cmd
=
"
$NVIDIA_SMI
--query-gpu=driver_version --format=csv,noheader,nounits"
driver_versions_list
=
$(
$cmd
)
ret_code
=
$?
driver_version
=
$(
echo
"
$driver_versions_list
"
|
head
-n
1
)
if
[[
$ret_code
-ne
0
]]
;
then
echo
"Can not detect nvidia driver version."
echo
"CMD:
\"
$cmd
\"
"
echo
"Result:
\"
$driver_versions_list
\"
"
echo
"nvidia-smi retcode:
$ret_code
"
exit
1
fi
echo
"Detected nvidia driver version:
$driver_version
"
fi
if
!
check_version_supported
"
$driver_version
"
;
then
echo
"Patch for this (
$driver_version
) nvidia driver not found."
...
...
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