mirror of
https://github.com/keylase/nvidia-patch.git
synced 2026-11-28 08:51:29 +00:00
linux: skip nvidia-smi lookup when driver version is given with -d (#1150)
patch_common() looked up nvidia-smi and exited with "nvidia-smi utility not found" before checking the manually entered driver version, so -d could not be used on systems without nvidia-smi (e.g. Batocera). Move the lookup into the branch that detects the version, so -d never touches nvidia-smi. Apply the same change to patch.sh and patch-fbc.sh. Behaviour without -d is unchanged, including the error message when nvidia-smi is missing. Based on #876 by DTJW92, whose patch.sh change could not be merged as-is. Co-authored-by: DTJW92 <96082560+DTJW92@users.noreply.github.com>
This commit is contained in:
12
patch-fbc.sh
12
patch-fbc.sh
@@ -306,17 +306,17 @@ get_supported_versions () {
|
||||
}
|
||||
|
||||
patch_common () {
|
||||
NVIDIA_SMI="$(command -v nvidia-smi || true)"
|
||||
if [[ ! "$NVIDIA_SMI" ]] ; then
|
||||
echo 'nvidia-smi utility not found. Probably driver is not installed.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$manual_driver_version" ]]; then
|
||||
driver_version="$manual_driver_version"
|
||||
|
||||
echo "Using manually entered nvidia driver version: $driver_version"
|
||||
else
|
||||
NVIDIA_SMI="$(command -v nvidia-smi || true)"
|
||||
if [[ ! "$NVIDIA_SMI" ]] ; then
|
||||
echo 'nvidia-smi utility not found. Probably driver is not installed.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cmd="$NVIDIA_SMI --query-gpu=driver_version --format=csv,noheader,nounits"
|
||||
driver_versions_list=$($cmd) || (
|
||||
ret_code=$?
|
||||
|
||||
12
patch.sh
12
patch.sh
@@ -345,17 +345,17 @@ get_supported_versions () {
|
||||
}
|
||||
|
||||
patch_common () {
|
||||
NVIDIA_SMI="$(command -v nvidia-smi || true)"
|
||||
if [[ ! "$NVIDIA_SMI" ]] ; then
|
||||
echo 'nvidia-smi utility not found. Probably driver is not installed.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$manual_driver_version" ]]; then
|
||||
driver_version="$manual_driver_version"
|
||||
|
||||
echo "Using manually entered nvidia driver version: $driver_version"
|
||||
else
|
||||
NVIDIA_SMI="$(command -v nvidia-smi || true)"
|
||||
if [[ ! "$NVIDIA_SMI" ]] ; then
|
||||
echo 'nvidia-smi utility not found. Probably driver is not installed.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cmd="$NVIDIA_SMI --query-gpu=driver_version --format=csv,noheader,nounits"
|
||||
driver_versions_list=$($cmd) || (
|
||||
ret_code=$?
|
||||
|
||||
Reference in New Issue
Block a user