Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • N nvidia-patch
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 26
    • Issues 26
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Keylase
  • nvidia-patch
  • Issues
  • #30
Closed
Open
Issue created Jan 12, 2019 by Administrator@rootContributor

Bash script says version is not supported, even though it is

Created by: ggerganov

I observe the following issue:

$ ./patch.sh
Detected nvidia driver version: 396.54
Patch for this (396.54) nvidia driver not found.
Available patches for:
390.87
396.26
396.24
410.48
415.25
415.18
375.39
410.57
410.73
396.54
410.78
410.79
396.37

Notice that the 396.54 is supported. However the script aborts with error.

$ lsb_release --all
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 12.04.3 LTS
Release:	12.04
Codename:	precise

$ bash --version
GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)

I'm not a bash expert, but I was able to fix this with the following patch:

$ git diff
diff --git a/patch.sh b/patch.sh
index 907225b..2a7550a 100755
--- a/patch.sh
+++ b/patch.sh
@@ -79,7 +79,7 @@ fi

 echo "Detected nvidia driver version: $driver_version"

-if [[ ! -v "patch_list[$driver_version]" || ! -v "object_list[$driver_version]" ]]; then
+if [[ ! "${patch_list[$driver_version]+isset}" || ! "${object_list[$driver_version]+isset}" ]]; then
     echo "Patch for this ($driver_version) nvidia driver not found." 1>&2
     echo "Available patches for: " 1>&2
     for drv in "${!patch_list[@]}"; do

Now it works flawlessly.

Assignee
Assign to
Time tracking