From 609b1a009e40dfd2d4591f109f72a88ea75235ef Mon Sep 17 00:00:00 2001 From: h-ohta Date: Mon, 15 May 2023 17:32:45 +0900 Subject: [PATCH] fix(system_monitor): fix build error in Humble --- system/system_monitor/CMakeLists.txt | 2 +- system/system_monitor/launch/system_monitor.launch.py | 2 +- .../system_monitor/src/gpu_monitor/nvml_gpu_monitor.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/system/system_monitor/CMakeLists.txt b/system/system_monitor/CMakeLists.txt index 1ff6f95b28ccc..e7b08ad33f75b 100644 --- a/system/system_monitor/CMakeLists.txt +++ b/system/system_monitor/CMakeLists.txt @@ -8,7 +8,7 @@ if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_EXTENSIONS OFF) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic -Werror) + add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wno-stringop-truncation) endif() find_package(ament_cmake_auto REQUIRED) diff --git a/system/system_monitor/launch/system_monitor.launch.py b/system/system_monitor/launch/system_monitor.launch.py index 463fdb6bab0a8..ad4aa53beca30 100644 --- a/system/system_monitor/launch/system_monitor.launch.py +++ b/system/system_monitor/launch/system_monitor.launch.py @@ -119,7 +119,7 @@ def launch_setup(context, *args, **kwargs): def generate_launch_description(): system_monitor_path = os.path.join( - get_package_share_directory("tier4_system_launch"), "config", "system_monitor" + get_package_share_directory("system_monitor"), "config", "system_monitor" ) return launch.LaunchDescription( [ diff --git a/system/system_monitor/src/gpu_monitor/nvml_gpu_monitor.cpp b/system/system_monitor/src/gpu_monitor/nvml_gpu_monitor.cpp index 19026717bc77b..4cf035dffd556 100644 --- a/system/system_monitor/src/gpu_monitor/nvml_gpu_monitor.cpp +++ b/system/system_monitor/src/gpu_monitor/nvml_gpu_monitor.cpp @@ -183,10 +183,10 @@ void GPUMonitor::addProcessUsage( uint32_t info_count = MAX_ARRAY_SIZE; std::unique_ptr infos; infos = std::make_unique(MAX_ARRAY_SIZE); - ret = nvmlDeviceGetComputeRunningProcesses_v2(device, &info_count, infos.get()); + ret = nvmlDeviceGetComputeRunningProcesses(device, &info_count, infos.get()); if (ret != NVML_SUCCESS) { RCLCPP_WARN( - this->get_logger(), "Failed to nvmlDeviceGetComputeRunningProcesses_v2 NVML: %s", + this->get_logger(), "Failed to nvmlDeviceGetComputeRunningProcesses NVML: %s", nvmlErrorString(ret)); return; } @@ -197,10 +197,10 @@ void GPUMonitor::addProcessUsage( // Get Graphics Process ID info_count = MAX_ARRAY_SIZE; infos = std::make_unique(MAX_ARRAY_SIZE); - ret = nvmlDeviceGetGraphicsRunningProcesses_v2(device, &info_count, infos.get()); + ret = nvmlDeviceGetGraphicsRunningProcesses(device, &info_count, infos.get()); if (ret != NVML_SUCCESS) { RCLCPP_WARN( - this->get_logger(), "Failed to nvmlDeviceGetGraphicsRunningProcesses_v2 NVML: %s", + this->get_logger(), "Failed to nvmlDeviceGetGraphicsRunningProcesses NVML: %s", nvmlErrorString(ret)); return; }