more intel fixes
This commit is contained in:
parent
70e98ff9a9
commit
68b7d6f3ec
@ -297,6 +297,25 @@ configure_node_info() {
|
|||||||
info "Intel GPU(s) detected:"
|
info "Intel GPU(s) detected:"
|
||||||
echo "$intelCards" | while IFS= read -r line; do echo " $line"; done
|
echo "$intelCards" | while IFS= read -r line; do echo " $line"; done
|
||||||
ENABLE_INTEL_GPU_INFO=1
|
ENABLE_INTEL_GPU_INFO=1
|
||||||
|
|
||||||
|
# Write JSON devices file for debug/cache use by the Perl collector
|
||||||
|
local json="["
|
||||||
|
local first=1
|
||||||
|
while IFS= read -r line; do
|
||||||
|
# Parse: "card0 Intel Alderlake_n (Gen12) pci:vendor=8086,device=46D0,card=0"
|
||||||
|
if [[ "$line" =~ ^(card[0-9]+)[[:space:]]+(.+[^[:space:]])[[:space:]]+(pci:[^[:space:]]+) ]]; then
|
||||||
|
local card="${BASH_REMATCH[1]}"
|
||||||
|
local name="${BASH_REMATCH[2]}"
|
||||||
|
local path="${BASH_REMATCH[3]}"
|
||||||
|
name="${name%"${name##*[![:space:]]}"}" # rtrim
|
||||||
|
[[ "$first" -eq 0 ]] && json+=","
|
||||||
|
json+="{\"card\":\"$card\",\"name\":\"$name\",\"path\":\"$path\",\"drm_path\":\"/dev/dri/$card\"}"
|
||||||
|
first=0
|
||||||
|
fi
|
||||||
|
done <<< "$intelCards"
|
||||||
|
json+="]"
|
||||||
|
echo "$json" > "$DEBUG_INTEL_FILE"
|
||||||
|
info "Intel GPU device list saved to $DEBUG_INTEL_FILE"
|
||||||
else
|
else
|
||||||
warn "No Intel GPUs detected by intel_gpu_top."
|
warn "No Intel GPUs detected by intel_gpu_top."
|
||||||
fi
|
fi
|
||||||
@ -536,7 +555,7 @@ main() {
|
|||||||
ENABLE_SYSTEM_INFO=0; SYSTEM_INFO_TYPE=1
|
ENABLE_SYSTEM_INFO=0; SYSTEM_INFO_TYPE=1
|
||||||
PVE_TRIGGER_ENABLED=0
|
PVE_TRIGGER_ENABLED=0
|
||||||
DEBUG_LM_SENSORS=0; DEBUG_LM_SENSORS_FILE="/tmp/sensors-output.json"
|
DEBUG_LM_SENSORS=0; DEBUG_LM_SENSORS_FILE="/tmp/sensors-output.json"
|
||||||
DEBUG_INTEL=0; DEBUG_INTEL_FILE="/tmp/intel-gpu-devices.txt"
|
DEBUG_INTEL=0; DEBUG_INTEL_FILE="/tmp/intel-gpu-devices.json"
|
||||||
DEBUG_INTEL_OUTPUT_FILE="/tmp/intel-gpu-top-output.txt"
|
DEBUG_INTEL_OUTPUT_FILE="/tmp/intel-gpu-top-output.txt"
|
||||||
DEBUG_NVIDIA=0; DEBUG_NVIDIA_OUTPUT_FILE="/tmp/nvidia-smi-output.csv"
|
DEBUG_NVIDIA=0; DEBUG_NVIDIA_OUTPUT_FILE="/tmp/nvidia-smi-output.csv"
|
||||||
DEBUG_NVIDIA_DEVICES_FILE="/tmp/nvidia-smi-devices.csv"
|
DEBUG_NVIDIA_DEVICES_FILE="/tmp/nvidia-smi-devices.csv"
|
||||||
|
|||||||
@ -5,7 +5,7 @@ use warnings;
|
|||||||
use Exporter 'import';
|
use Exporter 'import';
|
||||||
|
|
||||||
use PVE::PVEMod::Config qw(%config $process_type $pve_mod_working_dir);
|
use PVE::PVEMod::Config qw(%config $process_type $pve_mod_working_dir);
|
||||||
use PVE::PVEMod::Utils qw(debug check_executable setup_collector_signals safe_write_json);
|
use PVE::PVEMod::Utils qw(debug check_executable setup_collector_signals safe_read_json safe_write_json);
|
||||||
use PVE::PVEMod::Store qw(update_intel_gpu_rrd);
|
use PVE::PVEMod::Store qw(update_intel_gpu_rrd);
|
||||||
|
|
||||||
our @EXPORT_OK = qw(
|
our @EXPORT_OK = qw(
|
||||||
|
|||||||
@ -53,7 +53,7 @@ sub _get_system_info {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unless (defined $output && length($output) > 0) {
|
unless (defined $output && length($output) > 0) {
|
||||||
debug(__LINE__, "No cached DMI data at $cache_file — re-run pve-mod-configure as root to refresh");
|
debug(__LINE__, "No cached DMI data at $cache_file - re-run pve-mod-configure as root to refresh");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -151,6 +151,10 @@ sub _load_graphics_data {
|
|||||||
|
|
||||||
sub get_graphic_info {
|
sub get_graphic_info {
|
||||||
debug(__LINE__, "get_graphic_info called");
|
debug(__LINE__, "get_graphic_info called");
|
||||||
|
if (!($config{gpu}{intel_enabled} || !$config{gpu}{nvidia_enabled} || !$config{gpu}{amd_enabled})) {
|
||||||
|
debug(__LINE__, "GPU information collection is disabled");
|
||||||
|
return { };
|
||||||
|
}
|
||||||
|
|
||||||
# Start PVE Mod
|
# Start PVE Mod
|
||||||
pve_mod_starter();
|
pve_mod_starter();
|
||||||
@ -165,6 +169,10 @@ sub get_graphic_info {
|
|||||||
|
|
||||||
sub get_sensors_info {
|
sub get_sensors_info {
|
||||||
debug(__LINE__, "get_sensors_info called");
|
debug(__LINE__, "get_sensors_info called");
|
||||||
|
if (!$config{lm_sensors}{enabled}) {
|
||||||
|
debug(__LINE__, "LM Sensors collection is disabled");
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
# Start PVE Mod
|
# Start PVE Mod
|
||||||
pve_mod_starter();
|
pve_mod_starter();
|
||||||
@ -179,6 +187,10 @@ sub get_sensors_info {
|
|||||||
|
|
||||||
sub get_ups_info {
|
sub get_ups_info {
|
||||||
debug(__LINE__, "get_ups_info called");
|
debug(__LINE__, "get_ups_info called");
|
||||||
|
if (!$config{ups}{enabled}) {
|
||||||
|
debug(__LINE__, "UPS collection is disabled");
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
# Start PVE Mod
|
# Start PVE Mod
|
||||||
pve_mod_starter();
|
pve_mod_starter();
|
||||||
|
|||||||
@ -34,7 +34,7 @@ lm_sensors_mode=0
|
|||||||
lm_sensors_output_file=/tmp/sensors-output.json
|
lm_sensors_output_file=/tmp/sensors-output.json
|
||||||
intel_mode=0
|
intel_mode=0
|
||||||
intel_devices_file=/tmp/intel-gpu-devices.json
|
intel_devices_file=/tmp/intel-gpu-devices.json
|
||||||
intel_output_file=/tmp/intel-gpu-output.json
|
intel_output_file=/tmp/intel-gpu-output.txt
|
||||||
nvidia_mode=0
|
nvidia_mode=0
|
||||||
nvidia_devices_file=/tmp/nvidia-smi-devices.csv
|
nvidia_devices_file=/tmp/nvidia-smi-devices.csv
|
||||||
nvidia_output_file=/tmp/nvidia-smi-output.csv
|
nvidia_output_file=/tmp/nvidia-smi-output.csv
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user