Skip to content
Snippets Groups Projects
Commit 5b5bc77b authored by František Řezníček's avatar František Řezníček
Browse files

fix: gpumon GPU_DEVICES_UNRECOGNIZED detection crash

parent f039320f
No related branches found
No related tags found
No related merge requests found
Pipeline #161351 passed
...@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [1.2.4] - 2022-06-07
### Added
- gpumon: GPU_DEVICES_UNRECOGNIZED detection reworked without grep, with gawk, avoiding crash
## [1.2.3] - 2022-06-07 ## [1.2.3] - 2022-06-07
### Added ### Added
- gpumon: publish at least a metric help (metric-generator-exec requirement) - gpumon: publish at least a metric help (metric-generator-exec requirement)
......
...@@ -47,8 +47,8 @@ function find_gpu_passthough_vm_manifest () { ...@@ -47,8 +47,8 @@ function find_gpu_passthough_vm_manifest () {
# gather all GPU cards (assure device model name is detected) # gather all GPU cards (assure device model name is detected)
STAGE_NAME="GPU cards successfully detected" STAGE_NAME="GPU cards successfully detected"
GPU_DEVICES="$(get_gpu_devices)" GPU_DEVICES="$(get_gpu_devices)"
GPU_DEVICES_UNRECOGNIZED="$(echo "${GPU_DEVICES}" | gawk 'BEGIN{FPAT = "(\"[^\"]+\")"}{print $3}' | \ GPU_DEVICES_UNRECOGNIZED="$(echo "${GPU_DEVICES}" | \
sort -u | tr -d '"' | grep -Ev '.+[ \t]\[.+\]')" gawk 'BEGIN{FPAT = "(\"[^\"]+\")"}{if (!($3 ~ /.+[ \t]\[.+\]/)) {print $3}}')"
if [ -n "${GPU_DEVICES_UNRECOGNIZED}" ]; then if [ -n "${GPU_DEVICES_UNRECOGNIZED}" ]; then
# reload GPU devices and resolve proper device names with internet PCI id database # reload GPU devices and resolve proper device names with internet PCI id database
GPU_DEVICES="$(get_gpu_devices -q)" GPU_DEVICES="$(get_gpu_devices -q)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment