pax_global_header00006660000000000000000000000064144413011400014502gustar00rootroot0000000000000052 comment=2b6d62aada9752b5229fbd83921c9da01aa427d3 nvtop-3.0.2/000077500000000000000000000000001444130114000126525ustar00rootroot00000000000000nvtop-3.0.2/.clang-format000066400000000000000000000116111444130114000152250ustar00rootroot00000000000000--- Language: Cpp # BasedOnStyle: LLVM AccessModifierOffset: -2 AlignAfterOpenBracket: Align AlignArrayOfStructures: None AlignConsecutiveMacros: None AlignConsecutiveAssignments: None AlignConsecutiveBitFields: None AlignConsecutiveDeclarations: None AlignEscapedNewlines: Right AlignOperands: Align AlignTrailingComments: true AllowAllArgumentsOnNextLine: true AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortEnumsOnASingleLine: true AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: All AllowShortLambdasOnASingleLine: All AllowShortIfStatementsOnASingleLine: Never AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: MultiLine AttributeMacros: - __capability BinPackArguments: true BinPackParameters: true BraceWrapping: AfterCaseLabel: false AfterClass: false AfterControlStatement: Never AfterEnum: false AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false AfterStruct: false AfterUnion: false AfterExternBlock: false BeforeCatch: false BeforeElse: false BeforeLambdaBody: false BeforeWhile: false IndentBraces: false SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true BreakBeforeBinaryOperators: None BreakBeforeConceptDeclarations: true BreakBeforeBraces: Attach BreakBeforeInheritanceComma: false BreakInheritanceList: BeforeColon BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false BreakConstructorInitializers: BeforeColon BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true ColumnLimit: 120 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true DeriveLineEnding: true DerivePointerAlignment: false DisableFormat: false EmptyLineAfterAccessModifier: Never EmptyLineBeforeAccessModifier: LogicalBlock ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH IfMacros: - KJ_IF_MAYBE IncludeBlocks: Preserve IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 SortPriority: 0 CaseSensitive: false - Regex: '^(<|"(gtest|gmock|isl|json)/)' Priority: 3 SortPriority: 0 CaseSensitive: false - Regex: '.*' Priority: 1 SortPriority: 0 CaseSensitive: false IncludeIsMainRegex: '(Test)?$' IncludeIsMainSourceRegex: '' IndentAccessModifiers: false IndentCaseLabels: false IndentCaseBlocks: false IndentGotoLabels: true IndentPPDirectives: None IndentExternBlock: AfterExternBlock IndentRequires: false IndentWidth: 2 IndentWrappedFunctionNames: false InsertTrailingCommas: None JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: true LambdaBodyIndentation: Signature MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None ObjCBinPackProtocolList: Auto ObjCBlockIndentWidth: 2 ObjCBreakBeforeNestedBlockParam: true ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PenaltyIndentedWhitespace: 0 PointerAlignment: Right PPIndentWidth: -1 ReferenceAlignment: Pointer ReflowComments: true ShortNamespaceLines: 1 SortIncludes: CaseSensitive SortJavaStaticImport: Before SortUsingDeclarations: true SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true SpaceBeforeCaseColon: false SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements SpaceAroundPointerQualifiers: Default SpaceBeforeRangeBasedForLoopColon: true SpaceInEmptyBlock: false SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: Never SpacesInConditionalStatement: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInLineCommentPrefix: Minimum: 1 Maximum: -1 SpacesInParentheses: false SpacesInSquareBrackets: false SpaceBeforeSquareBrackets: false BitFieldColonSpacing: Both Standard: Latest StatementAttributeLikeMacros: - Q_EMIT StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION TabWidth: 8 UseCRLF: false UseTab: Never WhitespaceSensitiveMacros: - STRINGIZE - PP_STRINGIZE - BOOST_PP_STRINGIZE - NS_SWIFT_NAME - CF_SWIFT_NAME ... nvtop-3.0.2/.dockerignore000077700000000000000000000000001444130114000173112.gitignoreustar00rootroot00000000000000nvtop-3.0.2/.gitignore000066400000000000000000000000501444130114000146350ustar00rootroot00000000000000*.o *ctags build/ cmake-build*/ .vscode nvtop-3.0.2/AppImage/000077500000000000000000000000001444130114000143355ustar00rootroot00000000000000nvtop-3.0.2/AppImage/make_appimage.sh000077500000000000000000000011661444130114000174600ustar00rootroot00000000000000#!/usr/bin/env bash configure_nvtop() { cmake -S .. -B nvtop_build -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=ON -DCMAKE_INSTALL_PREFIX=/usr } build_nvtop() { cmake --build nvtop_build } install_nvtop_AppDir() { DESTDIR=../AppDir cmake --build nvtop_build --target install } get_linuxdeploy() { wget -nc https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage chmod u+x linuxdeploy-x86_64.AppImage } create_AppImage() { configure_nvtop build_nvtop install_nvtop_AppDir get_linuxdeploy ./linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage } create_AppImagenvtop-3.0.2/AppImage/make_appimage_ubuntu_1804_docker.sh000077500000000000000000000016251444130114000230650ustar00rootroot00000000000000#!/usr/bin/env bash install_deps() { apt-get update apt-get install -y cmake gcc g++ libncurses5-dev libncursesw5-dev libdrm-dev wget file libudev-dev } configure_nvtop() { cmake ../.. -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=ON -DINTEL_SUPPORT=ON -DUSE_LIBUDEV_OVER_LIBSYSTEMD=ON -DCMAKE_INSTALL_PREFIX=/usr } build_nvtop() { cmake --build . } install_nvtop_AppDir() { DESTDIR=../AppDir cmake --build . --target install } get_linuxdeploy() { wget -nc https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage chmod u+x linuxdeploy-x86_64.AppImage ./linuxdeploy-x86_64.AppImage --appimage-extract } create_AppImage() { install_deps mkdir nvtop_build cd nvtop_build configure_nvtop build_nvtop install_nvtop_AppDir cd .. get_linuxdeploy ./squashfs-root/AppRun --appdir AppDir --output appimage --exclude-library="*udev*" } create_AppImage nvtop-3.0.2/CMakeLists.txt000066400000000000000000000105731444130114000154200ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.10) #///////////////////////////////////////////////////////////////////# # PROJECT # #///////////////////////////////////////////////////////////////////# project(nvtop VERSION 3.0.2 LANGUAGES C CXX) set(default_build_type "Release") # Default build type if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to '${default_build_type}' as none was specified.") set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) endif() set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) #///////////////////////////////////////////////////////////////////# # DEPENDENCIES # #///////////////////////////////////////////////////////////////////# list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_CURRENT_SOURCE_DIR}/cmake) set(CURSES_NEED_NCURSES TRUE) # Try to find ncurses with unicode support first set(CURSES_NEED_WIDE TRUE) find_package(Curses QUIET) if (NOT CURSE_FOUND) # Fallback to regular ncurses library, which may also support unicode! set(CURSES_NEED_WIDE FALSE) find_package(Curses REQUIRED) endif() add_library(ncurses INTERFACE IMPORTED) set_property(TARGET ncurses PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CURSES_INCLUDE_DIRS}) set_property(TARGET ncurses PROPERTY INTERFACE_LINK_LIBRARIES ${CURSES_LIBRARIES}) #///////////////////////////////////////////////////////////////////# # COMPILATION OPTIONS # #///////////////////////////////////////////////////////////////////# # Use full RPATH on build tree set(CMAKE_SKIP_BUILD_RPATH FALSE) # Do not build with install RPATH set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) # Set the RPATH when install set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # Only set RPATH if the installation directory is not a system directory LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) if("${isSystemDir}" STREQUAL "-1") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") else() set(CMAKE_INSTALL_RPATH "") endif() option(NVIDIA_SUPPORT "Build support for NVIDIA GPUs through libnvml" ON) option(AMDGPU_SUPPORT "Build support for AMD GPUs through amdgpu driver" ON) option(INTEL_SUPPORT "Build support for Intel GPUs through i915 driver" ON) option(MSM_SUPPORT "Build support for Adreno GPUs through msm driver" ON) add_subdirectory(src) #///////////////////////////////////////////////////////////////////# # INSTALL # #///////////////////////////////////////////////////////////////////# string(TIMESTAMP TODAY_MANPAGE "%B %Y") string(TIMESTAMP TODAY_ISO_8601 "%Y-%m-%d") configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/manpage/nvtop.in" "${CMAKE_CURRENT_BINARY_DIR}/manpage/nvtop" IMMEDIATE @ONLY) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/desktop/nvtop.metainfo.xml.in" "${CMAKE_CURRENT_BINARY_DIR}/desktop/nvtop.metainfo.xml" IMMEDIATE @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/manpage/nvtop" DESTINATION share/man/man1/ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ RENAME nvtop.1) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/desktop/nvtop.svg" DESTINATION share/icons PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/desktop/nvtop.desktop" DESTINATION share/applications PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/desktop/nvtop.metainfo.xml" DESTINATION share/metainfo PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) #///////////////////////////////////////////////////////////////////# # TESTING # #///////////////////////////////////////////////////////////////////# if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") option(BUILD_TESTING "Build tests" OFF) endif() include(CTest) add_subdirectory(tests) nvtop-3.0.2/COPYING000066400000000000000000001045131444130114000137110ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . nvtop-3.0.2/Dockerfile000066400000000000000000000020331444130114000146420ustar00rootroot00000000000000 # BUILD: docker build . -t nvtop # or use other image with: --build-arg IMAGE=nvcr.io/nvidia/cudagl:11.4.2-base-ubuntu20.04 # or nvidia/driver:418.87.01-ubuntu18.04, nvcr.io/nvidia/cudagl:11.4.2-base-ubuntu20.04 # USE: docker run --rm -it --gpus all --pid host nvtop ARG IMAGE=nvidia/opengl:1.2-glvnd-runtime-ubuntu18.04 FROM ${IMAGE} as builder ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -yq build-essential cmake libncurses5-dev libncursesw5-dev \ pkg-config libdrm-dev libgtest-dev libudev-dev COPY . /nvtop WORKDIR /nvtop RUN mkdir -p /nvtop/build && \ cd /nvtop/build && \ cmake .. && \ make -j && \ make install # Stage 2 FROM ${IMAGE} RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && apt-get install -yq libncurses5 libncursesw5 libdrm-amdgpu1 \ && rm -rf /var/lib/apt/lists/* COPY --from=builder /usr/local/bin/nvtop /usr/local/bin/nvtop COPY --from=builder /usr/local/share/man/man1/nvtop.1 /usr/local/share/man/man1/nvtop.1 ENV LANG=C.UTF-8 ENTRYPOINT [ "/usr/local/bin/nvtop" ] nvtop-3.0.2/LICENSE000077700000000000000000000000001444130114000147052COPYINGustar00rootroot00000000000000nvtop-3.0.2/README.markdown000066400000000000000000000236611444130114000153630ustar00rootroot00000000000000NVTOP ===== What is NVTOP? -------------- Nvtop stands for Neat Videocard TOP, a (h)top like task monitor for AMD, Intel and NVIDIA GPUs. It can handle multiple GPUs and print information about them in a htop familiar way. Because a picture is worth a thousand words: ![NVTOP interface](/screenshot/NVTOP_ex1.png) Table of Contents ----------------- - [NVTOP Options and Interactive Commands](#nvtop-options-and-interactive-commands) - [Interactive Setup Window](#interactive-setup-window) - [Saving Preferences](#saving-preferences) - [NVTOP Manual and Command line Options](#nvtop-manual-and-command-line-options) - [GPU Support](#gpu-support) - [AMD](#amd) - [Intel](#intel) - [NVIDIA](#nvidia) - [Adreno](#adreno) - [Build](#build) - [Distribution Specific Installation Process](#distribution-specific-installation-process) - [Ubuntu / Debian](#ubuntu--debian) - [Ubuntu Impish (21.10) / Debian buster (stable) and more recent (stable)](#ubuntu-impish-2110-debian-buster-stable-and-more-recent) - [Fedora / Red Hat / CentOS](#fedora--red-hat--centos) - [OpenSUSE](#opensuse) - [Arch Linux](#arch-linux) - [AppImage](#appimage) - [Snap](#snap) - [Docker](#docker) - [NVTOP Build](#nvtop-build) - [Troubleshoot](#troubleshoot) - [License](#license) NVTOP Options and Interactive Commands -------------------------------------- ### Interactive Setup Window NVTOP has a builtin setup utility that provides a way to specialize the interface to your needs. Simply press ``F2`` and select the options that are the best for you. ![NVTOP Setup Window](/screenshot/Nvtop-config.png) ### Saving Preferences You can save the preferences set in the setup window by pressing ``F12``. The preferences will be loaded the next time you run ``nvtop``. ### NVTOP Manual and Command line Options NVTOP comes with a manpage! ```bash man nvtop ``` For quick command line arguments help ```bash nvtop -h nvtop --help ``` GPU Support ----------- ### AMD NVTOP supports AMD GPUs using the `amdgpu` driver through the exposed DRM and sysfs interface. AMD introduced the fdinfo interface in kernel 5.14 ([browse kernel source](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c?h=linux-5.14.y)). Hence, you will need a kernel with a version greater or equal to 5.14 to see the processes using AMD GPUs. Support for recent GPUs are regularly mainlined into the linux kernel, so please use a recent-enough kernel for your GPU. ### Intel NVTOP supports Intel GPUs using the `i915` linux driver. Intel introduced the fdinfo interface in kernel 5.19 ([browse kernel source](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/gpu/drm/i915/i915_drm_client.c?h=linux-5.19.y)). Hence, you will need a kernel with a version greater or equal to 5.19 to see the processes using Intel GPUs. **INTEL SUPPORT STATUS** - Intel is working on exposing more hardware information through an `HWMON` interface. The patches are still a work in progress: [see patch series](https://patchwork.freedesktop.org/series/104278/). - The fdinfo interface does not expose the memory allocated by the process. The field in the process list is therefore empty. ### NVIDIA The *NVML library* does not support some of the queries for GPUs coming before the Kepler microarchitecture. Anything starting at GeForce 600, GeForce 800M and successor should work fine. For more information about supported GPUs please take a look at the [NVML documentation](http://docs.nvidia.com/deploy/nvml-api/nvml-api-reference.html#nvml-api-reference). ### Adreno NVTOP supports Adreno GPUs using the `msm` linux driver. msm introduced the fdinfo interface in kernel 6.0 ([browse kernel source](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/gpu/drm/msm/msm_drv.c?h=linux-6.0.y)). Hence, you will need a kernel with a version greater or equal to 6.0 to see the processes using Adreno GPUs. Build ----- Several libraries are required in order for NVTOP to display GPU information: * The *ncurses* library driving the user interface. * This makes the screen look beautiful. * For NVIDIA: the *NVIDIA Management Library* (*NVML*) which comes with the GPU driver. * This queries the GPU for information. * For AMD: the libdrm library used to query AMD GPUs through the kernel driver. ## Distribution Specific Installation Process ### Ubuntu / Debian If your distribution provides the snap utility, follow the [snap installation process](#snap) to obtain an up-to-date version of nvtop. A standalone application is available as [AppImage](#appimage). #### Ubuntu Impish (21.10), Debian buster (stable) and more recent - ```bash sudo apt install nvtop ``` #### Ubuntu PPA A [PPA supporting Ubuntu 20.04, 22.04 and newer](https://launchpad.net/~flexiondotorg/+archive/ubuntu/nvtop) is provided by [Martin Wimpress](https://github.com/flexiondotorg) that offers an up-to-date version of `nvtop`, enabled for NVIDIA, AMD and Intel. ```bash sudo add-apt-repository ppa:flexiondotorg/nvtop sudo apt install nvtop ``` #### Older - AMD and Intel Dependencies ```bash sudo apt install libdrm-dev libsystemd-dev # Ubuntu 18.04 sudo apt install libudev-dev ``` - NVIDIA Depenency - NVIDIA drivers (see [Ubuntu Wiki](https://help.ubuntu.com/community/BinaryDriverHowto/Nvidia) or [Ubuntu PPA](https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa) or [Debian Wiki](https://wiki.debian.org/NvidiaGraphicsDrivers#NVIDIA_Proprietary_Driver)) - NVTOP Dependencies - CMake, ncurses and git ```bash sudo apt install cmake libncurses5-dev libncursesw5-dev git ``` - NVTOP - Follow the [NVTOP Build](#nvtop-build) ### Fedora / Red Hat / CentOS A standalone application is available as [AppImage](#appimage). #### Fedora 36 and newer - ```bash sudo dnf install nvtop ``` #### Red Hat Enterprise Linux 8 and 9 - ```bash sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm -E %{rhel}).noarch.rpm sudo dnf install nvtop ``` #### CentOS Stream, Rocky Linux, AlmaLinux - ```bash sudo dnf install -y epel-release sudo dnf install nvtop ``` #### Build process for Fedora / Red Hat / CentOS: - AMD and Intel Dependencies ```bash sudo dnf install libdrm-devel systemd-devel ``` - NVIDIA Depenency - NVIDIA drivers, **CUDA required for nvml libraries** (see [RPM Fusion](https://rpmfusion.org/Howto/NVIDIA)) - NVTOP Dependencies - CMake, ncurses, c++ and git ```bash sudo dnf install cmake ncurses-devel git gcc-c++ ``` - NVTOP - Follow the [NVTOP Build](#nvtop-build) ### OpenSUSE A standalone application is available as [AppImage](#appimage). Build process for OpenSUSE: - AMD Dependecy ```bash sudo zypper install libdrm-devel ``` - NVIDIA Depenency - NVIDIA drivers (see [SUSE Support Database](https://en.opensuse.org/SDB:NVIDIA_drivers)) - NVTOP Dependencies - CMake, ncurses and git ```bash sudo zypper install cmake ncurses-devel git ``` - NVTOP - Follow the [NVTOP Build](#nvtop-build) ### Arch Linux - ```bash sudo pacman -S nvtop ``` ### Gentoo - ```bash sudo layman -a guru && sudo emerge -av nvtop ``` ### AppImage An AppImage is a standalone application. Just download the AppImage, make it executable and run it! - Go to the [release page](https://github.com/Syllo/nvtop/releases/latest) and download `nvtop-x86_64.AppImage` - ```bash # Go to the download location ** The path may differ on your system ** cd $HOME/Downloads # Make the AppImage executable chmod u+x nvtop-x86_64.AppImage # Enjoy nvtop ./nvtop-x86_64.AppImage ``` If you are curious how that works, please visit the [AppImage website](https://appimage.org/). ### Snap - ```bash snap install nvtop # Add the capability to kill processes inside nvtop snap connect nvtop:process-control # Add the capability to inspect GPU info (Fan, PCIe, Power, etc) snap connect nvtop:hardware-observe # AMDGPU process list support (read /proc/) snap connect nvtop:system-observe # Temporary workaround to get per-process GPU usage (read /proc//fdinfo) snap connect nvtop:kubernetes-support ``` Notice: The connect commands allow ### Docker - NVIDIA drivers (same as above) - [nvidia-docker](https://github.com/NVIDIA/nvidia-docker) (See [Container Toolkit Installation Guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker)) - ```bash git clone https://github.com/Syllo/nvtop.git && cd nvtop sudo docker build --tag nvtop . sudo docker run -it --rm --runtime=nvidia --gpus=all --pid=host nvtop ``` ## NVTOP Build ```bash git clone https://github.com/Syllo/nvtop.git mkdir -p nvtop/build && cd nvtop/build cmake .. -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=ON -DINTEL_SUPPORT=ON make # Install globally on the system sudo make install # Alternatively, install without privileges at a location of your choosing # make DESTDIR="/your/install/path" install ``` If you use **conda** as environment manager and encounter an error while building nvtop, try `conda deactivate` before invoking `cmake`. The build system supports multiple build type (e.g. -DCMAKE_BUILD_TYPE=RelWithDebInfo): * Release: Binary without debug information * RelWithDebInfo: Binary with debug information * Debug: Compile with warning flags and address/undefined sanitizers enabled (for development purposes) Troubleshoot ------------ - The plot looks bad: - Verify that you installed the wide character version of the NCurses library (libncurses**w**5-dev for Debian / Ubuntu), clean the build directory and restart the build process. - **Putty**: Tell putty not to lie about its capabilities (`$TERM`) by setting the field ``Terminal-type string`` to ``putty`` in the menu ``Connection > Data > Terminal Details``. License ------- Nvtop is licensed under the GPLV3 license or any later version. You will find a copy of the license inside the COPYING file of the repository or at the gnu website <[www.gnu.org/licenses/](http://www.gnu.org/licenses/)>. nvtop-3.0.2/cmake/000077500000000000000000000000001444130114000137325ustar00rootroot00000000000000nvtop-3.0.2/cmake/cmake_uninstall.cmake.in000066400000000000000000000020241444130114000205100ustar00rootroot00000000000000if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) string(REGEX REPLACE "\n" ";" files "${files}") foreach(file ${files}) message(STATUS "Uninstalling $ENV{DESTDIR}${file}") if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") exec_program( "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval) if(NOT "${rm_retval}" STREQUAL 0) message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") endif(NOT "${rm_retval}" STREQUAL 0) else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") message(STATUS "File $ENV{DESTDIR}${file} does not exist.") endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") endforeach(file) nvtop-3.0.2/cmake/compile-flags-helpers.cmake000066400000000000000000000053251444130114000211230ustar00rootroot00000000000000function(add_compiler_option_to_target_type TARGET BUILDTYPE VISIBILITY OPTIONS) include(CheckCCompilerFlag) list(APPEND OPTIONS ${ARGN}) foreach(COMPILE_OPTION IN LISTS OPTIONS) string(REPLACE "=" "-" COMPILE_OPTION_NAME "${COMPILE_OPTION}") check_c_compiler_flag(${COMPILE_OPTION} "compiler_has${COMPILE_OPTION_NAME}") if (${compiler_has${COMPILE_OPTION_NAME}}) target_compile_options(${TARGET} ${VISIBILITY} $<$:${COMPILE_OPTION}>) endif() endforeach() endfunction() function(add_compiler_option_to_all_but_target_type TARGET BUILDTYPE VISIBILITY OPTIONS) include(CheckCCompilerFlag) list(APPEND OPTIONS ${ARGN}) foreach(COMPILE_OPTION IN LISTS OPTIONS) string(REPLACE "=" "-" COMPILE_OPTION_NAME "${COMPILE_OPTION}") check_c_compiler_flag(${COMPILE_OPTION} "compiler_has${COMPILE_OPTION_NAME}") if (${compiler_has${COMPILE_OPTION_NAME}}) target_compile_options(${TARGET} ${VISIBILITY} $<$>:${COMPILE_OPTION}>) endif() endforeach() endfunction() function(add_linker_option_to_target_type TARGET BUILDTYPE VISIBILITY OPTIONS) include(CheckCCompilerFlag) list(APPEND OPTIONS ${ARGN}) foreach(LINK_OPTION IN LISTS OPTIONS) string(REPLACE "," "_" LINK_OPTION_NAME "${LINK_OPTION}") check_c_compiler_flag(${LINK_OPTION} "linker_has${LINK_OPTION_NAME}") if (${linker_has${LINK_OPTION_NAME}}) target_link_libraries(${TARGET} ${VISIBILITY} $<$:${LINK_OPTION}>) endif() endforeach() endfunction() function(add_linker_option_to_all_but_target_type TARGET BUILDTYPE VISIBILITY OPTIONS) include(CheckCCompilerFlag) list(APPEND OPTIONS ${ARGN}) foreach(LINK_OPTION IN LISTS OPTIONS) string(REPLACE "," "_" LINK_OPTION_NAME "${LINK_OPTION}") check_c_compiler_flag(${LINK_OPTION} "linker_has${LINK_OPTION_NAME}") if (${linker_has${LINK_OPTION_NAME}}) target_link_libraries(${TARGET} ${VISIBILITY} $<$>:${LINK_OPTION}>) endif() endforeach() endfunction() function(add_sanitizers_to_target TARGET BUILDTYPE VISIBILITY SANITIZERS) list(APPEND SANITIZERS ${ARGN}) foreach(SAN IN LISTS SANITIZERS) set(CMAKE_REQUIRED_FLAGS "-fsanitize=${SAN}") check_c_compiler_flag("-fsanitize=${SAN}" "sanitizer-${SAN}-available") unset(CMAKE_REQUIRED_FLAGS) if (${sanitizer-${SAN}-available}) list(APPEND AVAILABLE_SANITIZERS ${SAN}) endif() endforeach() foreach(SAN IN LISTS AVAILABLE_SANITIZERS) target_compile_options(${TARGET} ${VISIBILITY} $<$:-fsanitize=${SAN}>) target_link_libraries(${TARGET} ${VISIBILITY} $<$:-fsanitize=${SAN}>) endforeach() endfunction() nvtop-3.0.2/cmake/modules/000077500000000000000000000000001444130114000154025ustar00rootroot00000000000000nvtop-3.0.2/cmake/modules/FindASan.cmake000066400000000000000000000041401444130114000200260ustar00rootroot00000000000000# The MIT License (MIT) # # Copyright (c) # 2013 Matthew Arsenault # 2015-2016 RWTH Aachen University, Federal Republic of Germany # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. option(SANITIZE_ADDRESS "Enable AddressSanitizer for sanitized targets." Off) set(FLAG_CANDIDATES # Clang 3.2+ use this version. The no-omit-frame-pointer option is optional. "-g -fsanitize=address -fno-omit-frame-pointer" "-g -fsanitize=address" # Older deprecated flag for ASan "-g -faddress-sanitizer" ) if (SANITIZE_ADDRESS AND (SANITIZE_THREAD OR SANITIZE_MEMORY)) message(FATAL_ERROR "AddressSanitizer is not compatible with " "ThreadSanitizer or MemorySanitizer.") endif () include(sanitize-helpers) if (SANITIZE_ADDRESS) sanitizer_check_compiler_flags("${FLAG_CANDIDATES}" "AddressSanitizer" "ASan") find_program(ASan_WRAPPER "asan-wrapper" PATHS ${CMAKE_MODULE_PATH}) mark_as_advanced(ASan_WRAPPER) endif () function (add_sanitize_address TARGET) if (NOT SANITIZE_ADDRESS) return() endif () sanitizer_add_flags(${TARGET} "AddressSanitizer" "ASan") endfunction () nvtop-3.0.2/cmake/modules/FindCurses.cmake000066400000000000000000000213701444130114000204540ustar00rootroot00000000000000# Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. #[=======================================================================[.rst: FindCurses ---------- Find the curses or ncurses include file and library. Result Variables ^^^^^^^^^^^^^^^^ This module defines the following variables: ``CURSES_FOUND`` True if Curses is found. ``CURSES_INCLUDE_DIRS`` The include directories needed to use Curses. ``CURSES_LIBRARIES`` The libraries needed to use Curses. ``CURSES_CFLAGS`` Parameters which ought be given to C/C++ compilers when using Curses. ``CURSES_HAVE_CURSES_H`` True if curses.h is available. ``CURSES_HAVE_NCURSES_H`` True if ncurses.h is available. ``CURSES_HAVE_NCURSES_NCURSES_H`` True if ``ncurses/ncurses.h`` is available. ``CURSES_HAVE_NCURSES_CURSES_H`` True if ``ncurses/curses.h`` is available. Set ``CURSES_NEED_NCURSES`` to ``TRUE`` before the ``find_package(Curses)`` call if NCurses functionality is required. Set ``CURSES_NEED_WIDE`` to ``TRUE`` before the ``find_package(Curses)`` call if unicode functionality is required. Backward Compatibility ^^^^^^^^^^^^^^^^^^^^^^ The following variable are provided for backward compatibility: ``CURSES_INCLUDE_DIR`` Path to Curses include. Use ``CURSES_INCLUDE_DIRS`` instead. ``CURSES_LIBRARY`` Path to Curses library. Use ``CURSES_LIBRARIES`` instead. #]=======================================================================] include(CheckLibraryExists) # we don't know anything about cursesw, so only ncurses # may be ncursesw if(NOT CURSES_NEED_WIDE) set(NCURSES_LIBRARY_NAME "ncurses") else() set(NCURSES_LIBRARY_NAME "ncursesw") # Also, if we are searchig fo wide curses - we are actually searching # for ncurses, we don't know about any other unicode version. set(CURSES_NEED_NCURSES TRUE) endif() find_library(CURSES_CURSES_LIBRARY NAMES curses) find_library(CURSES_NCURSES_LIBRARY NAMES "${NCURSES_LIBRARY_NAME}" ) set(CURSES_USE_NCURSES FALSE) if(CURSES_NCURSES_LIBRARY AND ((NOT CURSES_CURSES_LIBRARY) OR CURSES_NEED_NCURSES)) set(CURSES_USE_NCURSES TRUE) endif() # http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html # cygwin ncurses stopped providing curses.h symlinks see above # message. Cygwin is an ncurses package, so force ncurses on # cygwin if the curses.h is missing if(CYGWIN) if (CURSES_NEED_WIDE) if(NOT EXISTS /usr/include/ncursesw/curses.h) set(CURSES_USE_NCURSES TRUE) endif() else() if(NOT EXISTS /usr/include/curses.h) set(CURSES_USE_NCURSES TRUE) endif() endif() endif() # Not sure the logic is correct here. # If NCurses is required, use the function wsyncup() to check if the library # has NCurses functionality (at least this is where it breaks on NetBSD). # If wsyncup is in curses, use this one. # If not, try to find ncurses and check if this has the symbol. # Once the ncurses library is found, search the ncurses.h header first, but # some web pages also say that even with ncurses there is not always a ncurses.h: # http://osdir.com/ml/gnome.apps.mc.devel/2002-06/msg00029.html # So at first try ncurses.h, if not found, try to find curses.h under the same # prefix as the library was found, if still not found, try curses.h with the # default search paths. if(CURSES_CURSES_LIBRARY AND CURSES_NEED_NCURSES) include(CMakePushCheckState) cmake_push_check_state() set(CMAKE_REQUIRED_QUIET ${Curses_FIND_QUIETLY}) CHECK_LIBRARY_EXISTS("${CURSES_CURSES_LIBRARY}" wsyncup "" CURSES_CURSES_HAS_WSYNCUP) if(CURSES_NCURSES_LIBRARY AND NOT CURSES_CURSES_HAS_WSYNCUP) CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}" wsyncup "" CURSES_NCURSES_HAS_WSYNCUP) if( CURSES_NCURSES_HAS_WSYNCUP) set(CURSES_USE_NCURSES TRUE) endif() endif() cmake_pop_check_state() endif() if(CURSES_USE_NCURSES) get_filename_component(_cursesLibDir "${CURSES_NCURSES_LIBRARY}" PATH) get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH) # Use CURSES_NCURSES_INCLUDE_PATH if set, for compatibility. if(CURSES_NCURSES_INCLUDE_PATH) if (CURSES_NEED_WIDE) find_path(CURSES_INCLUDE_PATH NAMES ncursesw/ncurses.h ncursesw/curses.h ncursesw.h cursesw.h PATHS ${CURSES_NCURSES_INCLUDE_PATH} NO_DEFAULT_PATH ) else() find_path(CURSES_INCLUDE_PATH NAMES ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h PATHS ${CURSES_NCURSES_INCLUDE_PATH} NO_DEFAULT_PATH ) endif() endif() if (CURSES_NEED_WIDE) set(CURSES_TINFO_LIBRARY_NAME tinfow) find_path(CURSES_INCLUDE_PATH NAMES ncursesw/ncurses.h ncursesw/curses.h ncursesw.h cursesw.h HINTS "${_cursesParentDir}/include" ) else() set(CURSES_TINFO_LIBRARY_NAME tinfo) find_path(CURSES_INCLUDE_PATH NAMES ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h HINTS "${_cursesParentDir}/include" ) endif() # Previous versions of FindCurses provided these values. if(NOT DEFINED CURSES_LIBRARY) set(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}") endif() CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}" cbreak "" CURSES_NCURSES_HAS_CBREAK) if(NOT CURSES_NCURSES_HAS_CBREAK) find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" HINTS "${_cursesLibDir}") find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" ) endif() else() get_filename_component(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH) get_filename_component(_cursesParentDir "${_cursesLibDir}" PATH) #We can't find anything with CURSES_NEED_WIDE because we know #only about ncursesw unicode curses version if(NOT CURSES_NEED_WIDE) find_path(CURSES_INCLUDE_PATH NAMES curses.h HINTS "${_cursesParentDir}/include" ) endif() # Previous versions of FindCurses provided these values. if(NOT DEFINED CURSES_CURSES_H_PATH) set(CURSES_CURSES_H_PATH "${CURSES_INCLUDE_PATH}") endif() if(NOT DEFINED CURSES_LIBRARY) set(CURSES_LIBRARY "${CURSES_CURSES_LIBRARY}") endif() endif() # Report whether each possible header name exists in the include directory. if(NOT DEFINED CURSES_HAVE_NCURSES_NCURSES_H) if(CURSES_NEED_WIDE) if(EXISTS "${CURSES_INCLUDE_PATH}/ncursesw/ncurses.h") set(CURSES_HAVE_NCURSES_NCURSES_H "${CURSES_INCLUDE_PATH}/ncursesw/ncurses.h") endif() elseif(EXISTS "${CURSES_INCLUDE_PATH}/ncurses/ncurses.h") set(CURSES_HAVE_NCURSES_NCURSES_H "${CURSES_INCLUDE_PATH}/ncurses/ncurses.h") endif() if(NOT DEFINED CURSES_HAVE_NCURSES_NCURSES_H) set(CURSES_HAVE_NCURSES_NCURSES_H "CURSES_HAVE_NCURSES_NCURSES_H-NOTFOUND") endif() endif() if(NOT DEFINED CURSES_HAVE_NCURSES_CURSES_H) if(CURSES_NEED_WIDE) if(EXISTS "${CURSES_INCLUDE_PATH}/ncursesw/curses.h") set(CURSES_HAVE_NCURSES_CURSES_H "${CURSES_INCLUDE_PATH}/ncursesw/curses.h") endif() elseif(EXISTS "${CURSES_INCLUDE_PATH}/ncurses/curses.h") set(CURSES_HAVE_NCURSES_CURSES_H "${CURSES_INCLUDE_PATH}/ncurses/curses.h") endif() if(NOT DEFINED CURSES_HAVE_NCURSES_CURSES_H) set(CURSES_HAVE_NCURSES_CURSES_H "CURSES_HAVE_NCURSES_CURSES_H-NOTFOUND") endif() endif() if(NOT CURSES_NEED_WIDE) #ncursesw can't be found for this paths if(NOT DEFINED CURSES_HAVE_NCURSES_H) if(EXISTS "${CURSES_INCLUDE_PATH}/ncurses.h") set(CURSES_HAVE_NCURSES_H "${CURSES_INCLUDE_PATH}/ncurses.h") else() set(CURSES_HAVE_NCURSES_H "CURSES_HAVE_NCURSES_H-NOTFOUND") endif() endif() if(NOT DEFINED CURSES_HAVE_CURSES_H) if(EXISTS "${CURSES_INCLUDE_PATH}/curses.h") set(CURSES_HAVE_CURSES_H "${CURSES_INCLUDE_PATH}/curses.h") else() set(CURSES_HAVE_CURSES_H "CURSES_HAVE_CURSES_H-NOTFOUND") endif() endif() endif() find_library(CURSES_FORM_LIBRARY form HINTS "${_cursesLibDir}") find_library(CURSES_FORM_LIBRARY form ) # Previous versions of FindCurses provided these values. if(NOT DEFINED FORM_LIBRARY) set(FORM_LIBRARY "${CURSES_FORM_LIBRARY}") endif() # Need to provide the *_LIBRARIES set(CURSES_LIBRARIES ${CURSES_LIBRARY}) if(CURSES_EXTRA_LIBRARY) set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY}) endif() if(CURSES_FORM_LIBRARY) set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY}) endif() # Provide the *_INCLUDE_DIRS and *_CFLAGS results. set(CURSES_INCLUDE_DIRS ${CURSES_INCLUDE_PATH}) set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH}) # compatibility find_package(PkgConfig QUIET) if(PKG_CONFIG_FOUND) pkg_check_modules(NCURSES QUIET ${NCURSES_LIBRARY_NAME}) set(CURSES_CFLAGS ${NCURSES_CFLAGS_OTHER}) endif() include(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG CURSES_LIBRARY CURSES_INCLUDE_PATH) mark_as_advanced( CURSES_INCLUDE_PATH CURSES_CURSES_LIBRARY CURSES_NCURSES_LIBRARY CURSES_EXTRA_LIBRARY CURSES_FORM_LIBRARY ) nvtop-3.0.2/cmake/modules/FindLibdrm.cmake000066400000000000000000000065371444130114000204310ustar00rootroot00000000000000#.rst: # FindLibdrm # ------- # # Try to find libdrm on a Unix system. # # This will define the following variables: # # ``Libdrm_FOUND`` # True if (the requested version of) libdrm is available # ``Libdrm_VERSION`` # The version of libdrm # ``Libdrm_LIBRARIES`` # This can be passed to target_link_libraries() instead of the ``Libdrm::Libdrm`` # target # ``Libdrm_INCLUDE_DIRS`` # This should be passed to target_include_directories() if the target is not # used for linking # ``Libdrm_DEFINITIONS`` # This should be passed to target_compile_options() if the target is not # used for linking # # If ``Libdrm_FOUND`` is TRUE, it will also define the following imported target: # # ``Libdrm::Libdrm`` # The libdrm library # # In general we recommend using the imported target, as it is easier to use. # Bear in mind, however, that if the target is in the link interface of an # exported library, it must be made available by the package config file. #============================================================================= # SPDX-FileCopyrightText: 2014 Alex Merry # SPDX-FileCopyrightText: 2014 Martin Gräßlin # # SPDX-License-Identifier: BSD-3-Clause #============================================================================= if(CMAKE_VERSION VERSION_LESS 2.8.12) message(FATAL_ERROR "CMake 2.8.12 is required by FindLibdrm.cmake") endif() if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindLibdrm.cmake") endif() if(NOT WIN32) # Use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls find_package(PkgConfig) pkg_check_modules(PKG_Libdrm QUIET libdrm) set(Libdrm_DEFINITIONS ${PKG_Libdrm_CFLAGS_OTHER}) set(Libdrm_VERSION ${PKG_Libdrm_VERSION}) find_path(Libdrm_INCLUDE_DIR NAMES xf86drm.h HINTS ${PKG_Libdrm_INCLUDE_DIRS} ) find_library(Libdrm_LIBRARY NAMES drm HINTS ${PKG_Libdrm_LIBRARY_DIRS} ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Libdrm FOUND_VAR Libdrm_FOUND REQUIRED_VARS Libdrm_LIBRARY Libdrm_INCLUDE_DIR VERSION_VAR Libdrm_VERSION ) if(Libdrm_FOUND AND NOT TARGET Libdrm::Libdrm) add_library(Libdrm::Libdrm UNKNOWN IMPORTED) set_target_properties(Libdrm::Libdrm PROPERTIES IMPORTED_LOCATION "${Libdrm_LIBRARY}" INTERFACE_COMPILE_OPTIONS "${Libdrm_DEFINITIONS}" INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}/libdrm" ) endif() mark_as_advanced(Libdrm_LIBRARY Libdrm_INCLUDE_DIR) # compatibility variables set(Libdrm_LIBRARIES ${Libdrm_LIBRARY}) set(Libdrm_INCLUDE_DIRS ${Libdrm_INCLUDE_DIR} "${Libdrm_INCLUDE_DIR}/libdrm") set(Libdrm_VERSION_STRING ${Libdrm_VERSION}) else() message(STATUS "FindLibdrm.cmake cannot find libdrm on Windows systems.") set(Libdrm_FOUND FALSE) endif() include(FeatureSummary) set_package_properties(Libdrm PROPERTIES URL "https://wiki.freedesktop.org/dri/" DESCRIPTION "Userspace interface to kernel DRM services" ) nvtop-3.0.2/cmake/modules/FindMSan.cmake000066400000000000000000000043641444130114000200520ustar00rootroot00000000000000# The MIT License (MIT) # # Copyright (c) # 2013 Matthew Arsenault # 2015-2016 RWTH Aachen University, Federal Republic of Germany # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. option(SANITIZE_MEMORY "Enable MemorySanitizer for sanitized targets." Off) set(FLAG_CANDIDATES "-g -fsanitize=memory" ) include(sanitize-helpers) if (SANITIZE_MEMORY) if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") message(WARNING "MemorySanitizer disabled for target ${TARGET} because " "MemorySanitizer is supported for Linux systems only.") set(SANITIZE_MEMORY Off CACHE BOOL "Enable MemorySanitizer for sanitized targets." FORCE) elseif (NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8) message(WARNING "MemorySanitizer disabled for target ${TARGET} because " "MemorySanitizer is supported for 64bit systems only.") set(SANITIZE_MEMORY Off CACHE BOOL "Enable MemorySanitizer for sanitized targets." FORCE) else () sanitizer_check_compiler_flags("${FLAG_CANDIDATES}" "MemorySanitizer" "MSan") endif () endif () function (add_sanitize_memory TARGET) if (NOT SANITIZE_MEMORY) return() endif () sanitizer_add_flags(${TARGET} "MemorySanitizer" "MSan") endfunction () nvtop-3.0.2/cmake/modules/FindSanitizers.cmake000077500000000000000000000072311444130114000213460ustar00rootroot00000000000000# The MIT License (MIT) # # Copyright (c) # 2013 Matthew Arsenault # 2015-2016 RWTH Aachen University, Federal Republic of Germany # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # If any of the used compiler is a GNU compiler, add a second option to static # link against the sanitizers. option(SANITIZE_LINK_STATIC "Try to link static against sanitizers." Off) set(FIND_QUIETLY_FLAG "") if (DEFINED Sanitizers_FIND_QUIETLY) set(FIND_QUIETLY_FLAG "QUIET") endif () find_package(ASan ${FIND_QUIETLY_FLAG}) find_package(TSan ${FIND_QUIETLY_FLAG}) find_package(MSan ${FIND_QUIETLY_FLAG}) find_package(UBSan ${FIND_QUIETLY_FLAG}) function(sanitizer_add_blacklist_file FILE) if(NOT IS_ABSOLUTE ${FILE}) set(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}") endif() get_filename_component(FILE "${FILE}" REALPATH) sanitizer_check_compiler_flags("-fsanitize-blacklist=${FILE}" "SanitizerBlacklist" "SanBlist") endfunction() function(add_sanitizers ...) # If no sanitizer is enabled, return immediately. if (NOT (SANITIZE_ADDRESS OR SANITIZE_MEMORY OR SANITIZE_THREAD OR SANITIZE_UNDEFINED)) return() endif () foreach (TARGET ${ARGV}) # Check if this target will be compiled by exactly one compiler. Other- # wise sanitizers can't be used and a warning should be printed once. get_target_property(TARGET_TYPE ${TARGET} TYPE) if (TARGET_TYPE STREQUAL "INTERFACE_LIBRARY") message(WARNING "Can't use any sanitizers for target ${TARGET}, " "because it is an interface library and cannot be " "compiled directly.") return() endif () sanitizer_target_compilers(${TARGET} TARGET_COMPILER) list(LENGTH TARGET_COMPILER NUM_COMPILERS) if (NUM_COMPILERS GREATER 1) message(WARNING "Can't use any sanitizers for target ${TARGET}, " "because it will be compiled by incompatible compilers. " "Target will be compiled without sanitizers.") return() # If the target is compiled by no or no known compiler, give a warning. elseif (NUM_COMPILERS EQUAL 0) message(WARNING "Sanitizers for target ${TARGET} may not be" " usable, because it uses no or an unknown compiler. " "This is a false warning for targets using only " "object lib(s) as input.") endif () # Add sanitizers for target. add_sanitize_address(${TARGET}) add_sanitize_thread(${TARGET}) add_sanitize_memory(${TARGET}) add_sanitize_undefined(${TARGET}) endforeach () endfunction(add_sanitizers) nvtop-3.0.2/cmake/modules/FindSystemd.cmake000066400000000000000000000023061444130114000206360ustar00rootroot00000000000000# # - Find systemd libraries # # SYSTEMD_INCLUDE_DIRS - where to find systemd/sd-journal.h, etc. # SYSTEMD_LIBRARIES - List of libraries when using libsystemd. # SYSTEMD_FOUND - True if libsystemd is found. # A "systemd" target is created when found pkg_search_module(PC_SYSTEMD QUIET libsystemd) find_path(SYSTEMD_INCLUDE_DIR NAMES systemd/sd-device.h HINTS ${PC_SYSTEMD_INCLUDE_DIRS} ) find_library(SYSTEMD_LIBRARY NAMES systemd HINTS ${PC_SYSTEMD_LIBRARY_DIRS} ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Systemd REQUIRED_VARS SYSTEMD_LIBRARY SYSTEMD_INCLUDE_DIR VERSION_VAR PC_SYSTEMD_VERSION) if(SYSTEMD_FOUND) set(SYSTEMD_LIBRARIES ${SYSTEMD_LIBRARY}) set(SYSTEMD_INCLUDE_DIRS ${SYSTEMD_INCLUDE_DIR}) add_library(systemd INTERFACE IMPORTED GLOBAL) target_include_directories(systemd INTERFACE ${SYSTEMD_INCLUDE_DIRS}) set_target_properties(systemd PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${SYSTEMD_INCLUDE_DIRS}) target_link_libraries(systemd INTERFACE ${SYSTEMD_LIBRARIES}) else() set(SYSTEMD_LIBRARIES) set(SYSTEMD_INCLUDE_DIRS) endif() mark_as_advanced(SYSTEMD_LIBRARIES SYSTEMD_INCLUDE_DIRS)nvtop-3.0.2/cmake/modules/FindTSan.cmake000066400000000000000000000047731444130114000200650ustar00rootroot00000000000000# The MIT License (MIT) # # Copyright (c) # 2013 Matthew Arsenault # 2015-2016 RWTH Aachen University, Federal Republic of Germany # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. option(SANITIZE_THREAD "Enable ThreadSanitizer for sanitized targets." Off) set(FLAG_CANDIDATES "-g -fsanitize=thread" ) # ThreadSanitizer is not compatible with MemorySanitizer. if (SANITIZE_THREAD AND SANITIZE_MEMORY) message(FATAL_ERROR "ThreadSanitizer is not compatible with " "MemorySanitizer.") endif () include(sanitize-helpers) if (SANITIZE_THREAD) if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") message(WARNING "ThreadSanitizer disabled for target ${TARGET} because " "ThreadSanitizer is supported for Linux systems and macOS only.") set(SANITIZE_THREAD Off CACHE BOOL "Enable ThreadSanitizer for sanitized targets." FORCE) elseif (NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8) message(WARNING "ThreadSanitizer disabled for target ${TARGET} because " "ThreadSanitizer is supported for 64bit systems only.") set(SANITIZE_THREAD Off CACHE BOOL "Enable ThreadSanitizer for sanitized targets." FORCE) else () sanitizer_check_compiler_flags("${FLAG_CANDIDATES}" "ThreadSanitizer" "TSan") endif () endif () function (add_sanitize_thread TARGET) if (NOT SANITIZE_THREAD) return() endif () sanitizer_add_flags(${TARGET} "ThreadSanitizer" "TSan") endfunction () nvtop-3.0.2/cmake/modules/FindUBSan.cmake000066400000000000000000000032401444130114000201540ustar00rootroot00000000000000# The MIT License (MIT) # # Copyright (c) # 2013 Matthew Arsenault # 2015-2016 RWTH Aachen University, Federal Republic of Germany # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. option(SANITIZE_UNDEFINED "Enable UndefinedBehaviorSanitizer for sanitized targets." Off) set(FLAG_CANDIDATES "-g -fsanitize=undefined" ) include(sanitize-helpers) if (SANITIZE_UNDEFINED) sanitizer_check_compiler_flags("${FLAG_CANDIDATES}" "UndefinedBehaviorSanitizer" "UBSan") endif () function (add_sanitize_undefined TARGET) if (NOT SANITIZE_UNDEFINED) return() endif () sanitizer_add_flags(${TARGET} "UndefinedBehaviorSanitizer" "UBSan") endfunction () nvtop-3.0.2/cmake/modules/FindUDev.cmake000066400000000000000000000030441444130114000200510ustar00rootroot00000000000000# Configure libudev environment # # UDEV_FOUND - system has a libudev # UDEV_INCLUDE_DIR - where to find header files # UDEV_LIBRARIES - the libraries to link against udev # UDEV_STABLE - it's true when is the version greater or equals to 143 - version when the libudev was stabilized in its API # An "udev" target is created when found # # Adapted from a version of Petr Vanek # copyright (c) 2011 Petr Vanek # copyright (c) 2022 Maxime Schmitt # # Redistribution and use of this file is allowed according to the terms of the BSD license. # pkg_search_module(PC_UDEV QUIET libudev) find_path(UDEV_INCLUDE_DIR NAMES libudev.h HINTS ${PC_UDEV_INCLUDE_DIRS} ) find_library(UDEV_LIBRARY NAMES udev HINTS ${PC_UDEV_LIBRARY_DIRS} ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(UDev REQUIRED_VARS UDEV_LIBRARY UDEV_INCLUDE_DIR VERSION_VAR PC_UDEV_VERSION) if(UDEV_FOUND) if(PC_UDEV_VERSION GREATER_EQUAL "143") set(UDEV_STABLE TRUE) else() set(UDEV_STABLE FALSE) endif() set(UDEV_LIBRARIES ${UDEV_LIBRARY}) set(UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR}) message(STATUS "Libudev stable: ${UDEV_STABLE}") add_library(udev INTERFACE IMPORTED GLOBAL) set_target_properties(udev PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${UDEV_INCLUDE_DIRS}) target_link_libraries(udev INTERFACE ${UDEV_LIBRARIES}) else() set(UDEV_LIBRARIES) set(UDEV_INCLUDE_DIRS) endif() mark_as_advanced(UDEV_LIBRARIES UDEV_INCLUDE_DIRS)nvtop-3.0.2/cmake/modules/asan-wrapper000077500000000000000000000037331444130114000177360ustar00rootroot00000000000000#!/bin/sh # The MIT License (MIT) # # Copyright (c) # 2013 Matthew Arsenault # 2015-2016 RWTH Aachen University, Federal Republic of Germany # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # This script is a wrapper for AddressSanitizer. In some special cases you need # to preload AddressSanitizer to avoid error messages - e.g. if you're # preloading another library to your application. At the moment this script will # only do something, if we're running on a Linux platform. OSX might not be # affected. # Exit immediately, if platform is not Linux. if [ "$(uname)" != "Linux" ] then exec $@ fi # Get the used libasan of the application ($1). If a libasan was found, it will # be prepended to LD_PRELOAD. libasan=$(ldd $1 | grep libasan | sed "s/^[[:space:]]//" | cut -d' ' -f1) if [ -n "$libasan" ] then if [ -n "$LD_PRELOAD" ] then export LD_PRELOAD="$libasan:$LD_PRELOAD" else export LD_PRELOAD="$libasan" fi fi # Execute the application. exec $@ nvtop-3.0.2/cmake/modules/sanitize-helpers.cmake000077500000000000000000000170041444130114000216770ustar00rootroot00000000000000# The MIT License (MIT) # # Copyright (c) # 2013 Matthew Arsenault # 2015-2016 RWTH Aachen University, Federal Republic of Germany # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # Helper function to get the language of a source file. function (sanitizer_lang_of_source FILE RETURN_VAR) get_filename_component(LONGEST_EXT "${FILE}" EXT) # If extension is empty return. This can happen for extensionless headers if("${LONGEST_EXT}" STREQUAL "") set(${RETURN_VAR} "" PARENT_SCOPE) return() endif() # Get shortest extension as some files can have dot in their names string(REGEX REPLACE "^.*(\\.[^.]+)$" "\\1" FILE_EXT ${LONGEST_EXT}) string(TOLOWER "${FILE_EXT}" FILE_EXT) string(SUBSTRING "${FILE_EXT}" 1 -1 FILE_EXT) get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) foreach (LANG ${ENABLED_LANGUAGES}) list(FIND CMAKE_${LANG}_SOURCE_FILE_EXTENSIONS "${FILE_EXT}" TEMP) if (NOT ${TEMP} EQUAL -1) set(${RETURN_VAR} "${LANG}" PARENT_SCOPE) return() endif () endforeach() set(${RETURN_VAR} "" PARENT_SCOPE) endfunction () # Helper function to get compilers used by a target. function (sanitizer_target_compilers TARGET RETURN_VAR) # Check if all sources for target use the same compiler. If a target uses # e.g. C and Fortran mixed and uses different compilers (e.g. clang and # gfortran) this can trigger huge problems, because different compilers may # use different implementations for sanitizers. set(BUFFER "") get_target_property(TSOURCES ${TARGET} SOURCES) foreach (FILE ${TSOURCES}) # If expression was found, FILE is a generator-expression for an object # library. Object libraries will be ignored. string(REGEX MATCH "TARGET_OBJECTS:([^ >]+)" _file ${FILE}) if ("${_file}" STREQUAL "") sanitizer_lang_of_source(${FILE} LANG) if (LANG) list(APPEND BUFFER ${CMAKE_${LANG}_COMPILER_ID}) endif () endif () endforeach () list(REMOVE_DUPLICATES BUFFER) set(${RETURN_VAR} "${BUFFER}" PARENT_SCOPE) endfunction () # Helper function to check compiler flags for language compiler. function (sanitizer_check_compiler_flag FLAG LANG VARIABLE) if (${LANG} STREQUAL "C") include(CheckCCompilerFlag) check_c_compiler_flag("${FLAG}" ${VARIABLE}) elseif (${LANG} STREQUAL "CXX") include(CheckCXXCompilerFlag) check_cxx_compiler_flag("${FLAG}" ${VARIABLE}) elseif (${LANG} STREQUAL "Fortran") # CheckFortranCompilerFlag was introduced in CMake 3.x. To be compatible # with older Cmake versions, we will check if this module is present # before we use it. Otherwise we will define Fortran coverage support as # not available. include(CheckFortranCompilerFlag OPTIONAL RESULT_VARIABLE INCLUDED) if (INCLUDED) check_fortran_compiler_flag("${FLAG}" ${VARIABLE}) elseif (NOT CMAKE_REQUIRED_QUIET) message(STATUS "Performing Test ${VARIABLE}") message(STATUS "Performing Test ${VARIABLE}" " - Failed (Check not supported)") endif () endif() endfunction () # Helper function to test compiler flags. function (sanitizer_check_compiler_flags FLAG_CANDIDATES NAME PREFIX) set(CMAKE_REQUIRED_QUIET ${${PREFIX}_FIND_QUIETLY}) get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) foreach (LANG ${ENABLED_LANGUAGES}) # Sanitizer flags are not dependend on language, but the used compiler. # So instead of searching flags foreach language, search flags foreach # compiler used. set(COMPILER ${CMAKE_${LANG}_COMPILER_ID}) if (NOT DEFINED ${PREFIX}_${COMPILER}_FLAGS) foreach (FLAG ${FLAG_CANDIDATES}) if(NOT CMAKE_REQUIRED_QUIET) message(STATUS "Try ${COMPILER} ${NAME} flag = [${FLAG}]") endif() set(CMAKE_REQUIRED_FLAGS "${FLAG}") unset(${PREFIX}_FLAG_DETECTED CACHE) sanitizer_check_compiler_flag("${FLAG}" ${LANG} ${PREFIX}_FLAG_DETECTED) if (${PREFIX}_FLAG_DETECTED) # If compiler is a GNU compiler, search for static flag, if # SANITIZE_LINK_STATIC is enabled. if (SANITIZE_LINK_STATIC AND (${COMPILER} STREQUAL "GNU")) string(TOLOWER ${PREFIX} PREFIX_lower) sanitizer_check_compiler_flag( "-static-lib${PREFIX_lower}" ${LANG} ${PREFIX}_STATIC_FLAG_DETECTED) if (${PREFIX}_STATIC_FLAG_DETECTED) set(FLAG "-static-lib${PREFIX_lower} ${FLAG}") endif () endif () set(${PREFIX}_${COMPILER}_FLAGS "${FLAG}" CACHE STRING "${NAME} flags for ${COMPILER} compiler.") mark_as_advanced(${PREFIX}_${COMPILER}_FLAGS) break() endif () endforeach () if (NOT ${PREFIX}_FLAG_DETECTED) set(${PREFIX}_${COMPILER}_FLAGS "" CACHE STRING "${NAME} flags for ${COMPILER} compiler.") mark_as_advanced(${PREFIX}_${COMPILER}_FLAGS) message(WARNING "${NAME} is not available for ${COMPILER} " "compiler. Targets using this compiler will be " "compiled without ${NAME}.") endif () endif () endforeach () endfunction () # Helper to assign sanitizer flags for TARGET. function (sanitizer_add_flags TARGET NAME PREFIX) # Get list of compilers used by target and check, if sanitizer is available # for this target. Other compiler checks like check for conflicting # compilers will be done in add_sanitizers function. sanitizer_target_compilers(${TARGET} TARGET_COMPILER) list(LENGTH TARGET_COMPILER NUM_COMPILERS) if ("${${PREFIX}_${TARGET_COMPILER}_FLAGS}" STREQUAL "") return() endif() # Set compile- and link-flags for target. set_property(TARGET ${TARGET} APPEND_STRING PROPERTY COMPILE_FLAGS " ${${PREFIX}_${TARGET_COMPILER}_FLAGS}") set_property(TARGET ${TARGET} APPEND_STRING PROPERTY COMPILE_FLAGS " ${SanBlist_${TARGET_COMPILER}_FLAGS}") set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " ${${PREFIX}_${TARGET_COMPILER}_FLAGS}") endfunction () nvtop-3.0.2/cmake/optimization_flags.cmake000066400000000000000000000015651444130114000206450ustar00rootroot00000000000000set(ADDITIONAL_DEBUG_COMPILE_OPTIONS "-Wall" #"-Wpedantic" "-Wextra" "-Waddress" "-Waggressive-loop-optimizations" #"-Wcast-qual" #"-Wcast-align" "-Wbad-function-cast" "-Wmissing-declarations" "-Wmissing-parameter-type" "-Wmissing-prototypes" "-Wnested-externs" "-Wold-style-declaration" "-Wold-style-definition" "-Wstrict-prototypes" "-Wpointer-sign" "-Wdouble-promotion" "-Wuninitialized" "-Winit-self" "-Wstrict-aliasing" "-Wsuggest-attribute=const" "-Wtrampolines" "-Wfloat-equal" "-Wshadow" "-Wunsafe-loop-optimizations" "-Wfloat-conversion" "-Wlogical-op" "-Wnormalized" "-Wdisabled-optimization" "-Whsa" #"-Wconversion" "-Wunused-result" "-Werror=implicit-function-declaration" #"-Wpadded" "-Wformat" "-Wformat-security" CACHE INTERNAL "String" ) set(ADDITIONAL_RELEASE_LINK_OPTIONS "-Wl,-z,relro") nvtop-3.0.2/desktop/000077500000000000000000000000001444130114000143235ustar00rootroot00000000000000nvtop-3.0.2/desktop/nvtop.desktop000066400000000000000000000002471444130114000170670ustar00rootroot00000000000000[Desktop Entry] Name=nvtop GenericName=GPU Process Monitor Type=Application Terminal=true Exec=nvtop Icon=nvtop Categories=System;Monitor; X-AppImage-Integrate=false nvtop-3.0.2/desktop/nvtop.metainfo.xml.in000066400000000000000000000030011444130114000204130ustar00rootroot00000000000000 io.github.syllo.nvtop nvtop GPU process monitor for AMD, Intel and NVIDIA CC0-1.0 GPL-3.0-or-later Maxime Schmitt

Nvtop stands for Neat Videocard TOP, a (h)top like task monitor for AMD, Intel and NVIDIA GPUs. It can handle multiple GPUs and print information about them in a htop familiar way.

nvtop.desktop nvtop System Monitor https://github.com/Syllo/nvtop The nvtop interface https://github.com/Syllo/nvtop/blob/master/screenshot/NVTOP_ex1.png The nvtop option screen https://github.com/Syllo/nvtop/blob/master/screenshot/Nvtop-config.png nvtop
nvtop-3.0.2/desktop/nvtop.svg000066400000000000000000000055541444130114000162230ustar00rootroot00000000000000 nvtop-3.0.2/include/000077500000000000000000000000001444130114000142755ustar00rootroot00000000000000nvtop-3.0.2/include/ini.h000066400000000000000000000123371444130114000152330ustar00rootroot00000000000000/* inih -- simple .INI file parser SPDX-License-Identifier: BSD-3-Clause Copyright (C) 2009-2020, Ben Hoyt inih is released under the New BSD license (see LICENSE.txt). Go to the project home page for more info: https://github.com/benhoyt/inih */ #ifndef INI_H #define INI_H /* Make this header file easier to include in C++ code */ #ifdef __cplusplus extern "C" { #endif #include /* Nonzero if ini_handler callback should accept lineno parameter. */ #ifndef INI_HANDLER_LINENO #define INI_HANDLER_LINENO 0 #endif /* Typedef for prototype of handler function. */ #if INI_HANDLER_LINENO typedef int (*ini_handler)(void* user, const char* section, const char* name, const char* value, int lineno); #else typedef int (*ini_handler)(void* user, const char* section, const char* name, const char* value); #endif /* Typedef for prototype of fgets-style reader function. */ typedef char* (*ini_reader)(char* str, int num, void* stream); /* Parse given INI-style file. May have [section]s, name=value pairs (whitespace stripped), and comments starting with ';' (semicolon). Section is "" if name=value pair parsed before any section heading. name:value pairs are also supported as a concession to Python's configparser. For each name=value pair parsed, call handler function with given user pointer as well as section, name, and value (data only valid for duration of handler call). Handler should return nonzero on success, zero on error. Returns 0 on success, line number of first error on parse error (doesn't stop on first error), -1 on file open error, or -2 on memory allocation error (only when INI_USE_STACK is zero). */ int ini_parse(const char* filename, ini_handler handler, void* user); /* Same as ini_parse(), but takes a FILE* instead of filename. This doesn't close the file when it's finished -- the caller must do that. */ int ini_parse_file(FILE* file, ini_handler handler, void* user); /* Same as ini_parse(), but takes an ini_reader function pointer instead of filename. Used for implementing custom or string-based I/O (see also ini_parse_string). */ int ini_parse_stream(ini_reader reader, void* stream, ini_handler handler, void* user); /* Same as ini_parse(), but takes a zero-terminated string with the INI data instead of a file. Useful for parsing INI data from a network socket or already in memory. */ int ini_parse_string(const char* string, ini_handler handler, void* user); /* Nonzero to allow multi-line value parsing, in the style of Python's configparser. If allowed, ini_parse() will call the handler with the same name for each subsequent line parsed. */ #ifndef INI_ALLOW_MULTILINE #define INI_ALLOW_MULTILINE 1 #endif /* Nonzero to allow a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of the file. See https://github.com/benhoyt/inih/issues/21 */ #ifndef INI_ALLOW_BOM #define INI_ALLOW_BOM 1 #endif /* Chars that begin a start-of-line comment. Per Python configparser, allow both ; and # comments at the start of a line by default. */ #ifndef INI_START_COMMENT_PREFIXES #define INI_START_COMMENT_PREFIXES ";#" #endif /* Nonzero to allow inline comments (with valid inline comment characters specified by INI_INLINE_COMMENT_PREFIXES). Set to 0 to turn off and match Python 3.2+ configparser behaviour. */ #ifndef INI_ALLOW_INLINE_COMMENTS #define INI_ALLOW_INLINE_COMMENTS 1 #endif #ifndef INI_INLINE_COMMENT_PREFIXES #define INI_INLINE_COMMENT_PREFIXES ";" #endif /* Nonzero to use stack for line buffer, zero to use heap (malloc/free). */ #ifndef INI_USE_STACK #define INI_USE_STACK 1 #endif /* Maximum line length for any line in INI file (stack or heap). Note that this must be 3 more than the longest line (due to '\r', '\n', and '\0'). */ #ifndef INI_MAX_LINE #define INI_MAX_LINE 200 #endif /* Nonzero to allow heap line buffer to grow via realloc(), zero for a fixed-size buffer of INI_MAX_LINE bytes. Only applies if INI_USE_STACK is zero. */ #ifndef INI_ALLOW_REALLOC #define INI_ALLOW_REALLOC 0 #endif /* Initial size in bytes for heap line buffer. Only applies if INI_USE_STACK is zero. */ #ifndef INI_INITIAL_ALLOC #define INI_INITIAL_ALLOC 200 #endif /* Stop parsing on first error (default is to keep parsing). */ #ifndef INI_STOP_ON_FIRST_ERROR #define INI_STOP_ON_FIRST_ERROR 0 #endif /* Nonzero to call the handler at the start of each new section (with name and value NULL). Default is to only call the handler on each name=value pair. */ #ifndef INI_CALL_HANDLER_ON_NEW_SECTION #define INI_CALL_HANDLER_ON_NEW_SECTION 0 #endif /* Nonzero to allow a name without a value (no '=' or ':' on the line) and call the handler with value NULL in this case. Default is to treat no-value lines as an error. */ #ifndef INI_ALLOW_NO_VALUE #define INI_ALLOW_NO_VALUE 0 #endif /* Nonzero to use custom ini_malloc, ini_free, and ini_realloc memory allocation functions (INI_USE_STACK must also be 0). These functions must have the same signatures as malloc/free/realloc and behave in a similar way. ini_realloc is only needed if INI_ALLOW_REALLOC is set. */ #ifndef INI_CUSTOM_ALLOCATOR #define INI_CUSTOM_ALLOCATOR 0 #endif #ifdef __cplusplus } #endif #endif /* INI_H */ nvtop-3.0.2/include/list.h000066400000000000000000000153741444130114000154330ustar00rootroot00000000000000/* * Copyright (C) 2002 Free Software Foundation, Inc. * (originally part of the GNU C Library) * Contributed by Ulrich Drepper , 2002. * * Copyright (C) 2009 Pierre-Marc Fournier * Conversion to RCU list. * Copyright (C) 2010 Mathieu Desnoyers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _LIST_H #define _LIST_H 1 #include /* * container_of - Get the address of an object containing a field. * * @ptr: pointer to the field. * @type: type of the object. * @member: name of the field within the object. */ #define container_of(ptr, type, member) \ __extension__ \ ({ \ const __typeof__(((type *) NULL)->member) * __ptr = (ptr); \ (type *)((char *)__ptr - offsetof(type, member)); \ }) /* * The definitions of this file are adopted from those which can be * found in the Linux kernel headers to enable people familiar with the * latter find their way in these sources as well. */ /* Basic type for the double-link list. */ struct list_head { struct list_head *next, *prev; }; /* Define a variable with the head and tail of the list. */ #define LIST_HEAD(name) \ struct list_head name = { &(name), &(name) } /* Initialize a new list head. */ #define INIT_LIST_HEAD(ptr) \ (ptr)->next = (ptr)->prev = (ptr) #define LIST_HEAD_INIT(name) { .next = &(name), .prev = &(name) } /* Add new element at the head of the list. */ static inline void list_add(struct list_head *newp, struct list_head *head) { head->next->prev = newp; newp->next = head->next; newp->prev = head; head->next = newp; } /* Add new element at the tail of the list. */ static inline void list_add_tail(struct list_head *newp, struct list_head *head) { head->prev->next = newp; newp->next = head; newp->prev = head->prev; head->prev = newp; } /* Remove element from list. */ static inline void __list_del(struct list_head *prev, struct list_head *next) { next->prev = prev; prev->next = next; } /* Remove element from list. */ static inline void list_del(struct list_head *elem) { __list_del(elem->prev, elem->next); } /* Remove element from list, initializing the element's list pointers. */ static inline void list_del_init(struct list_head *elem) { list_del(elem); INIT_LIST_HEAD(elem); } /* Delete from list, add to another list as head. */ static inline void list_move(struct list_head *elem, struct list_head *head) { __list_del(elem->prev, elem->next); list_add(elem, head); } /* Delete from list, add to another list as tail. */ static inline void list_move_tail(struct list_head *elem, struct list_head *head) { __list_del(elem->prev, elem->next); list_add_tail(elem, head); } /* Replace an old entry. */ static inline void list_replace(struct list_head *old, struct list_head *_new) { _new->next = old->next; _new->prev = old->prev; _new->prev->next = _new; _new->next->prev = _new; } /* Join two lists. */ static inline void list_splice(struct list_head *add, struct list_head *head) { /* Do nothing if the list which gets added is empty. */ if (add != add->next) { add->next->prev = head; add->prev->next = head->next; head->next->prev = add->prev; head->next = add->next; } } /* Get typed element from list at a given position. */ #define list_entry(ptr, type, member) container_of(ptr, type, member) /* Get first entry from a list. */ #define list_first_entry(ptr, type, member) \ list_entry((ptr)->next, type, member) /* Iterate forward over the elements of the list. */ #define list_for_each(pos, head) \ for (pos = (head)->next; (pos) != (head); pos = (pos)->next) /* * Iterate forward over the elements list. The list elements can be * removed from the list while doing this. */ #define list_for_each_safe(pos, p, head) \ for (pos = (head)->next, p = (pos)->next; \ (pos) != (head); \ pos = (p), p = (pos)->next) /* Iterate backward over the elements of the list. */ #define list_for_each_prev(pos, head) \ for (pos = (head)->prev; (pos) != (head); pos = (pos)->prev) /* * Iterate backwards over the elements list. The list elements can be * removed from the list while doing this. */ #define list_for_each_prev_safe(pos, p, head) \ for (pos = (head)->prev, p = (pos)->prev; \ (pos) != (head); \ pos = (p), p = (pos)->prev) #define list_for_each_entry(pos, head, member) \ for (pos = list_entry((head)->next, __typeof__(*(pos)), member); \ &(pos)->member != (head); \ pos = list_entry((pos)->member.next, __typeof__(*(pos)), member)) #define list_for_each_entry_reverse(pos, head, member) \ for (pos = list_entry((head)->prev, __typeof__(*(pos)), member); \ &(pos)->member != (head); \ pos = list_entry((pos)->member.prev, __typeof__(*(pos)), member)) #define list_for_each_entry_safe(pos, p, head, member) \ for (pos = list_entry((head)->next, __typeof__(*(pos)), member), \ p = list_entry((pos)->member.next, __typeof__(*(pos)), member); \ &(pos)->member != (head); \ pos = (p), p = list_entry((pos)->member.next, __typeof__(*(pos)), member)) #define list_for_each_entry_reverse_safe(pos, p, head, member) \ for (pos = list_entry((head)->prev, __typeof__(*(pos)), member), \ p = list_entry((pos)->member.prev, __typeof__(*(pos)), member); \ &(pos)->member != (head); pos = (p), p = list_entry((pos)->member.prev, __typeof__(*(pos)), member)) /* * Same as list_for_each_entry_safe, but starts from "pos" which should * point to an entry within the list. */ #define list_for_each_entry_safe_from(pos, p, head, member) \ for (p = list_entry((pos)->member.next, __typeof__(*(pos)), member); \ &(pos)->member != (head); \ pos = (p), p = list_entry((pos)->member.next, __typeof__(*(pos)), member)) static inline int list_empty(struct list_head *head) { return head == head->next; } static inline void list_replace_init(struct list_head *old, struct list_head *_new) { struct list_head *head = old->next; list_del(old); list_add_tail(_new, head); INIT_LIST_HEAD(old); } #endif /* _LIST_H */ nvtop-3.0.2/include/nvtop/000077500000000000000000000000001444130114000154435ustar00rootroot00000000000000nvtop-3.0.2/include/nvtop/common.h000066400000000000000000000031651444130114000171110ustar00rootroot00000000000000/* * * Copyright (C) 2022 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef NVTOP_COMMON_H__ #define NVTOP_COMMON_H__ #if !defined(HAS_REALLOCARRAY) #include #include #undef reallocarray // Reallocarray from musl libc (https://git.musl-libc.org/cgit/musl/tree/src/malloc/reallocarray.c) static void *nvtop_reallocarray__(void *ptr, size_t nmemb, size_t size) { if (size && nmemb > -1 / size) { errno = ENOMEM; return NULL; } return realloc(ptr, nmemb * size); } #define reallocarray(ptr, nmemb, size) nvtop_reallocarray__(ptr, nmemb, size) #endif // !defined(HAS_REALLOCARRAY) // Increment for the number of tracked processes // 16 has been experimentally selected for being small while avoiding multipe allocations in most common cases #define COMMON_PROCESS_LINEAR_REALLOC_INC 16 #define MAX_LINES_PER_PLOT 4 // Helper macro to stringify an integer #define QUOTE(x) #x #define EXPAND_AND_QUOTE(x) QUOTE(x) #endif // NVTOP_COMMON_H__ nvtop-3.0.2/include/nvtop/device_discovery.h000066400000000000000000000053231444130114000211450ustar00rootroot00000000000000/* * * Copyright (C) 2022 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef NVTOP_DEVICE_DISCOVERY_H__ #define NVTOP_DEVICE_DISCOVERY_H__ // Devices typedef struct nvtop_device nvtop_device; nvtop_device *nvtop_device_ref(nvtop_device *device); nvtop_device *nvtop_device_unref(nvtop_device *device); int nvtop_device_new_from_syspath(nvtop_device **ret, const char *syspath); int nvtop_device_get_parent(nvtop_device *child, nvtop_device **parent); int nvtop_device_get_driver(nvtop_device *device, const char **driver); int nvtop_device_get_devname(nvtop_device *device, const char **devname); int nvtop_device_get_property_value(nvtop_device *device, const char *key, const char **value); int nvtop_device_get_sysattr_value(nvtop_device *device, const char *sysattr, const char **value); int nvtop_device_get_syspath(nvtop_device *device, const char **sysPath); // Devices enumerator typedef struct nvtop_device_enumerator nvtop_device_enumerator; int nvtop_enumerator_new(nvtop_device_enumerator **enumerator); nvtop_device_enumerator *nvtop_enumerator_ref(nvtop_device_enumerator *enumerator); nvtop_device_enumerator *nvtop_enumerator_unref(nvtop_device_enumerator *enumerator); int nvtop_device_enumerator_add_match_subsystem(nvtop_device_enumerator *enumerator, const char *subsystem, int match); int nvtop_device_enumerator_add_match_property(nvtop_device_enumerator *enumerator, const char *property, const char *value); int nvtop_device_enumerator_add_match_parent(nvtop_device_enumerator *enumerator, nvtop_device *parent); nvtop_device *nvtop_enumerator_get_device_first(nvtop_device_enumerator *enumerator); nvtop_device *nvtop_enumerator_get_device_next(nvtop_device_enumerator *enumerator); typedef struct { unsigned width; unsigned speed; } nvtop_pcie_link; int nvtop_device_maximum_pcie_link(nvtop_device *dev, nvtop_pcie_link *pcie_info); int nvtop_device_current_pcie_link(nvtop_device *dev, nvtop_pcie_link *pcie_info); nvtop_device *nvtop_device_get_hwmon(nvtop_device *dev); #endif // NVTOP_DEVICE_DISCOVERY_H__ nvtop-3.0.2/include/nvtop/extract_gpuinfo.h000066400000000000000000000025661444130114000210260ustar00rootroot00000000000000/* * * Copyright (C) 2017-2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef EXTRACT_GPUINFO_H_ #define EXTRACT_GPUINFO_H_ #include "nvtop/extract_gpuinfo_common.h" #include bool gpuinfo_init_info_extraction(unsigned *total_dev_count, struct list_head *devices); bool gpuinfo_shutdown_info_extraction(struct list_head *devices); bool gpuinfo_populate_static_infos(struct list_head *devices); bool gpuinfo_refresh_dynamic_info(struct list_head *devices); bool gpuinfo_fix_dynamic_info_from_process_info(struct list_head *devices); bool gpuinfo_refresh_processes(struct list_head *devices); void gpuinfo_clean(struct list_head *devices); void gpuinfo_clear_cache(void); #endif // EXTRACT_GPUINFO_H_ nvtop-3.0.2/include/nvtop/extract_gpuinfo_common.h000066400000000000000000000220141444130114000223640ustar00rootroot00000000000000/* * * Copyright (C) 2021-2022 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef EXTRACT_GPUINFO_COMMON_H__ #define EXTRACT_GPUINFO_COMMON_H__ #include #include #include #include #include #include "list.h" #define IS_VALID(x, y) ((y)[(x) / CHAR_BIT] & (1 << ((x) % CHAR_BIT))) #define SET_VALID(x, y) ((y)[(x) / CHAR_BIT] |= (1 << ((x) % CHAR_BIT))) #define RESET_VALID(x, y) ((y)[(x) / CHAR_BIT] &= ~(1 << ((x) % CHAR_BIT))) #define RESET_ALL(y) memset(y, 0, sizeof(y)) #define SET_VALUE(structPtr, field, value, prefix) \ do { \ (structPtr)->field = (value); \ SET_VALID(prefix##field##_valid, (structPtr)->valid); \ } while (0) #define INVALIDATE_VALUE(structPtr, field, prefix) \ do { \ RESET_VALID(prefix##field##_valid, (structPtr)->valid); \ } while (0) #define VALUE_IS_VALID(structPtr, field, prefix) IS_VALID(prefix##field##_valid, (structPtr)->valid) #define SET_GPUINFO_STATIC(structPtr, field, value) SET_VALUE(structPtr, field, value, gpuinfo_) #define RESET_GPUINFO_STATIC(structPtr, field) INVALIDATE_VALUE(structPtr, field, gpuinfo_) #define GPUINFO_STATIC_FIELD_VALID(structPtr, field) VALUE_IS_VALID(structPtr, field, gpuinfo_) enum gpuinfo_static_info_valid { gpuinfo_device_name_valid = 0, gpuinfo_max_pcie_gen_valid, gpuinfo_max_pcie_link_width_valid, gpuinfo_temperature_shutdown_threshold_valid, gpuinfo_temperature_slowdown_threshold_valid, gpuinfo_static_info_count, }; #define MAX_DEVICE_NAME 128 struct gpuinfo_static_info { char device_name[MAX_DEVICE_NAME]; unsigned max_pcie_gen; unsigned max_pcie_link_width; unsigned temperature_shutdown_threshold; unsigned temperature_slowdown_threshold; bool integrated_graphics; unsigned char valid[(gpuinfo_static_info_count + CHAR_BIT - 1) / CHAR_BIT]; }; #define SET_GPUINFO_DYNAMIC(structPtr, field, value) SET_VALUE(structPtr, field, value, gpuinfo_) #define RESET_GPUINFO_DYNAMIC(structPtr, field) INVALIDATE_VALUE(structPtr, field, gpuinfo_) #define GPUINFO_DYNAMIC_FIELD_VALID(structPtr, field) VALUE_IS_VALID(structPtr, field, gpuinfo_) enum gpuinfo_dynamic_info_valid { gpuinfo_gpu_clock_speed_valid = 0, gpuinfo_gpu_clock_speed_max_valid, gpuinfo_mem_clock_speed_valid, gpuinfo_mem_clock_speed_max_valid, gpuinfo_gpu_util_rate_valid, gpuinfo_mem_util_rate_valid, gpuinfo_encoder_rate_valid, gpuinfo_decoder_rate_valid, gpuinfo_total_memory_valid, gpuinfo_free_memory_valid, gpuinfo_used_memory_valid, gpuinfo_pcie_link_gen_valid, gpuinfo_pcie_link_width_valid, gpuinfo_pcie_rx_valid, gpuinfo_pcie_tx_valid, gpuinfo_fan_speed_valid, gpuinfo_gpu_temp_valid, gpuinfo_power_draw_valid, gpuinfo_power_draw_max_valid, gpuinfo_dynamic_info_count, }; struct gpuinfo_dynamic_info { unsigned int gpu_clock_speed; // Device clock speed in MHz unsigned int gpu_clock_speed_max; // Maximum clock speed in MHz unsigned int mem_clock_speed; // Device clock speed in MHz unsigned int mem_clock_speed_max; // Maximum clock speed in MHz unsigned int gpu_util_rate; // GPU utilization rate in % unsigned int mem_util_rate; // MEM utilization rate in % unsigned int encoder_rate; // Encoder utilization rate in % unsigned int decoder_rate; // Decoder utilization rate in % unsigned long long total_memory; // Total memory (bytes) unsigned long long free_memory; // Unallocated memory (bytes) unsigned long long used_memory; // Allocated memory (bytes) unsigned int pcie_link_gen; // PCIe link generation used unsigned int pcie_link_width; // PCIe line width used unsigned int pcie_rx; // PCIe throughput in KB/s unsigned int pcie_tx; // PCIe throughput in KB/s unsigned int fan_speed; // Fan speed percentage unsigned int gpu_temp; // GPU temperature °celsius unsigned int power_draw; // Power usage in milliwatts unsigned int power_draw_max; // Max power usage in milliwatts bool encode_decode_shared; // True if encode and decode is shared (Intel) unsigned char valid[(gpuinfo_dynamic_info_count + CHAR_BIT - 1) / CHAR_BIT]; }; enum gpu_process_type { gpu_process_unknown = 0, gpu_process_graphical = 1, gpu_process_compute = 2, gpu_process_graphical_compute = 3, gpu_process_type_count, }; #define SET_GPUINFO_PROCESS(structPtr, field, value) SET_VALUE(structPtr, field, value, gpuinfo_process_) #define RESET_GPUINFO_PROCESS(structPtr, field) INVALIDATE_VALUE(structPtr, field, gpuinfo_process_) #define GPUINFO_PROCESS_FIELD_VALID(structPtr, field) VALUE_IS_VALID(structPtr, field, gpuinfo_process_) enum gpuinfo_process_info_valid { gpuinfo_process_cmdline_valid, gpuinfo_process_user_name_valid, gpuinfo_process_gfx_engine_used_valid, gpuinfo_process_compute_engine_used_valid, gpuinfo_process_enc_engine_used_valid, gpuinfo_process_dec_engine_used_valid, gpuinfo_process_gpu_usage_valid, gpuinfo_process_encode_usage_valid, gpuinfo_process_decode_usage_valid, gpuinfo_process_gpu_memory_usage_valid, gpuinfo_process_gpu_memory_percentage_valid, gpuinfo_process_cpu_usage_valid, gpuinfo_process_cpu_memory_virt_valid, gpuinfo_process_cpu_memory_res_valid, gpuinfo_process_info_count }; struct gpu_process { enum gpu_process_type type; pid_t pid; // Process ID char *cmdline; // Process User Name char *user_name; // Process User Name uint64_t gfx_engine_used; // Time in nanoseconds this process spent using the GPU gfx uint64_t compute_engine_used; // Time in nanoseconds this process spent using the GPU compute uint64_t enc_engine_used; // Time in nanoseconds this process spent using the GPU encoder uint64_t dec_engine_used; // Time in nanoseconds this process spent using the GPU decoder unsigned gpu_usage; // Percentage of GPU used by the process unsigned encode_usage; // Percentage of GPU encoder used by the process unsigned decode_usage; // Percentage of GPU decoder used by the process unsigned long long gpu_memory_usage; // Memory used by the process unsigned gpu_memory_percentage; // Percentage of the total device memory // consumed by the process unsigned cpu_usage; unsigned long cpu_memory_virt; unsigned long cpu_memory_res; unsigned char valid[(gpuinfo_process_info_count + CHAR_BIT - 1) / CHAR_BIT]; }; struct gpu_info; struct gpu_vendor { struct list_head list; bool (*init)(void); void (*shutdown)(void); const char *(*last_error_string)(void); bool (*get_device_handles)(struct list_head *devices, unsigned *count); void (*populate_static_info)(struct gpu_info *gpu_info); void (*refresh_dynamic_info)(struct gpu_info *gpu_info); void (*refresh_running_processes)(struct gpu_info *gpu_info); char *name; }; #define PDEV_LEN 16 struct gpu_info { struct list_head list; struct gpu_vendor *vendor; struct gpuinfo_static_info static_info; struct gpuinfo_dynamic_info dynamic_info; unsigned processes_count; struct gpu_process *processes; unsigned processes_array_size; char pdev[PDEV_LEN]; }; void register_gpu_vendor(struct gpu_vendor *vendor); bool extract_drm_fdinfo_key_value(char *buf, char **key, char **val); // fdinfo DRM interface names common to multiple drivers extern const char drm_pdev[]; extern const char drm_client_id[]; inline unsigned busy_usage_from_time_usage_round(uint64_t current_use_ns, uint64_t previous_use_ns, uint64_t time_between_measurement) { return ((current_use_ns - previous_use_ns) * UINT64_C(100) + time_between_measurement / UINT64_C(2)) / time_between_measurement; } unsigned nvtop_pcie_gen_from_link_speed(unsigned linkSpeed); #endif // EXTRACT_GPUINFO_COMMON_H__ nvtop-3.0.2/include/nvtop/extract_processinfo_fdinfo.h000066400000000000000000000041321444130114000232250ustar00rootroot00000000000000/* * * Copyright (C) 2022 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef NVTOP_EXTRACT_PROCESSINFO_FDINFO__ #define NVTOP_EXTRACT_PROCESSINFO_FDINFO__ #include "nvtop/common.h" #include "nvtop/extract_gpuinfo_common.h" #include /** * @brief A callback function that populates the \p process_info structure from * the information gathered while parsing the fdinfo file \p fdinfo_file. Return true if the data in process_info is * valid, false otherwise. */ typedef bool (*processinfo_fdinfo_callback)(struct gpu_info *info, FILE *fdinfo_file, struct gpu_process *process_info); /** * @brief Register a callback function to parse a fdinfo file opened to a DRM driver * * @param callback The callback function * @param info The struct gpu_info that will be updated when the callback succeeds. */ void processinfo_register_fdinfo_callback(processinfo_fdinfo_callback callback, struct gpu_info *info); /** * @brief Remove a previously registered callback. * * @param info The callback to this gpu_info will be removed */ void processinfo_drop_callback(const struct gpu_info *info); /** * @brief Scann all the processes in /proc. Call the registered callbacks on * each file descriptor to the DRM driver that can successfully be oppened. If a * callback succeeds, the gpu_info structure processes array will be updated * with the retrieved data. */ void processinfo_sweep_fdinfos(void); #endif // NVTOP_EXTRACT_PROCESSINFO_FDINFO__ nvtop-3.0.2/include/nvtop/get_process_info.h000066400000000000000000000024341444130114000211470ustar00rootroot00000000000000/* * * Copyright (C) 2017-2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef GET_PROCESS_INFO_H_ #define GET_PROCESS_INFO_H_ #include #include #include #include "nvtop/time.h" struct process_cpu_usage { double total_user_time; // Seconds double total_kernel_time; // Seconds size_t virtual_memory; // Bytes size_t resident_memory; // Bytes nvtop_time timestamp; }; void get_username_from_pid(pid_t pid, char **buffer); void get_command_from_pid(pid_t pid, char **buffer); bool get_process_info(pid_t pid, struct process_cpu_usage *usage); #endif // GET_PROCESS_INFO_H_ nvtop-3.0.2/include/nvtop/info_messages.h000066400000000000000000000016551444130114000204450ustar00rootroot00000000000000/* * * Copyright (C) 2022 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef NVTOP_INFO_MESSAGES_H__ #define NVTOP_INFO_MESSAGES_H__ void get_info_messages(struct list_head *devices, unsigned *num_messages, const char ***messages); #endif // NVTOP_INFO_MESSAGES_H__ nvtop-3.0.2/include/nvtop/interface.h000066400000000000000000000042021444130114000175520ustar00rootroot00000000000000/* * * Copyright (C) 2017-2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef INTERFACE_H_ #define INTERFACE_H_ #include "nvtop/extract_gpuinfo.h" #include "nvtop/interface_common.h" #include "nvtop/interface_options.h" struct nvtop_interface; struct nvtop_interface *initialize_curses(unsigned total_devices, unsigned num_devices, unsigned largest_device_name, nvtop_interface_option options); void clean_ncurses(struct nvtop_interface *interface); void interface_check_monitored_gpu_change(struct nvtop_interface **interface, unsigned allDevCount, unsigned *num_monitored_gpus, struct list_head *monitoredGpus, struct list_head *nonMonitoredGpus); unsigned interface_largest_gpu_name(struct list_head *devices); void draw_gpu_info_ncurses(unsigned monitored_dev_count, struct list_head *devices, struct nvtop_interface *interface); void save_current_data_to_ring(struct list_head *devices, struct nvtop_interface *interface); void update_window_size_to_terminal_size(struct nvtop_interface *inter); void interface_key(int keyId, struct nvtop_interface *inter); bool is_escape_for_quit(struct nvtop_interface *inter); bool interface_freeze_processes(struct nvtop_interface *interface); int interface_update_interval(const struct nvtop_interface *interface); bool show_information_messages(unsigned num_messages, const char **messages); #endif // INTERFACE_H_ nvtop-3.0.2/include/nvtop/interface_common.h000066400000000000000000000026131444130114000211260ustar00rootroot00000000000000/* * * Copyright (C) 2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef INTERFACE_COMMON_H__ #define INTERFACE_COMMON_H__ enum plot_information { plot_gpu_rate = 0, plot_gpu_mem_rate, plot_encoder_rate, plot_decoder_rate, plot_gpu_temperature, plot_gpu_power_draw_rate, plot_fan_speed, plot_gpu_clock_rate, plot_gpu_mem_clock_rate, plot_information_count }; typedef int plot_info_to_draw; enum process_field { process_pid = 0, process_user, process_gpu_id, process_type, process_gpu_rate, process_enc_rate, process_dec_rate, process_memory, process_cpu_usage, process_cpu_mem_usage, process_command, process_field_count, }; typedef int process_field_displayed; #endif // INTERFACE_COMMON_H__ nvtop-3.0.2/include/nvtop/interface_internal_common.h000066400000000000000000000076171444130114000230330ustar00rootroot00000000000000/* * * Copyright (C) 2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef INTERFACE_INTERNAL_COMMON_H__ #define INTERFACE_INTERNAL_COMMON_H__ #include "nvtop/common.h" #include "nvtop/interface_layout_selection.h" #include "nvtop/interface_options.h" #include "nvtop/interface_ring_buffer.h" #include "nvtop/time.h" #include #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) enum nvtop_option_window_state { nvtop_option_state_hidden, nvtop_option_state_kill, nvtop_option_state_sort_by, }; enum interface_color { cyan_color = 1, yellow_color, magenta_color, green_color, red_color, blue_color, }; struct device_window { WINDOW *name_win; // Name of the GPU WINDOW *gpu_util_enc_dec; WINDOW *gpu_util_no_enc_or_dec; WINDOW *gpu_util_no_enc_and_dec; WINDOW *mem_util_enc_dec; WINDOW *mem_util_no_enc_or_dec; WINDOW *mem_util_no_enc_and_dec; WINDOW *encode_util; WINDOW *decode_util; WINDOW *fan_speed; WINDOW *temperature; WINDOW *power_info; WINDOW *gpu_clock_info; WINDOW *mem_clock_info; WINDOW *pcie_info; bool enc_was_visible; bool dec_was_visible; nvtop_time last_decode_seen; nvtop_time last_encode_seen; }; static const unsigned int option_window_size = 13; struct option_window { enum nvtop_option_window_state state; enum nvtop_option_window_state previous_state; unsigned int selected_row; unsigned int offset; WINDOW *option_win; }; struct process_window { unsigned offset; unsigned offset_column; WINDOW *process_win; WINDOW *process_with_option_win; unsigned selected_row; pid_t selected_pid; struct option_window option_window; }; struct plot_window { size_t num_data; double *data; WINDOW *win; WINDOW *plot_window; unsigned num_devices_to_plot; unsigned devices_ids[MAX_LINES_PER_PLOT]; }; enum setup_window_section { setup_general_selected, setup_header_selected, setup_chart_selected, setup_process_list_selected, setup_monitored_gpu_list_selected, setup_window_selection_count }; struct setup_window { unsigned indentation_level; enum setup_window_section selected_section; bool visible; WINDOW *clean_space; WINDOW *setup; WINDOW *single; WINDOW *split[2]; unsigned options_selected[2]; }; // Keep gpu information every 1 second for 10 minutes struct nvtop_interface { nvtop_interface_option options; unsigned total_dev_count; unsigned monitored_dev_count; struct device_window *devices_win; struct process_window process; WINDOW *shortcut_window; unsigned num_plots; struct plot_window *plots; interface_ring_buffer saved_data_ring; struct setup_window setup_win; }; enum device_field { device_name = 0, device_fan_speed, device_temperature, device_power, device_pcie, device_clock, device_field_count, }; inline void set_attribute_between(WINDOW *win, int startY, int startX, int endX, attr_t attr, short pair) { int rows, cols; getmaxyx(win, rows, cols); (void)rows; if (startX >= cols || endX < 0) return; startX = startX < 0 ? 0 : startX; endX = endX > cols ? cols : endX; int size = endX - startX; mvwchgat(win, startY, startX, size, attr, pair, NULL); } #endif // INTERFACE_INTERNAL_COMMON_H__ nvtop-3.0.2/include/nvtop/interface_layout_selection.h000066400000000000000000000016621444130114000232230ustar00rootroot00000000000000#ifndef INTERFACE_LAYOUT_SELECTION_H__ #define INTERFACE_LAYOUT_SELECTION_H__ #include "nvtop/interface_common.h" #include "nvtop/interface_options.h" #include struct window_position { unsigned posX, posY, sizeX, sizeY; }; // Should be fine #define MAX_CHARTS 64 void compute_sizes_from_layout(unsigned monitored_dev_count, unsigned device_header_rows, unsigned device_header_cols, unsigned rows, unsigned cols, const nvtop_interface_gpu_opts *gpu_opts, process_field_displayed process_field_displayed, struct window_position *device_positions, unsigned *num_plots, struct window_position plot_positions[MAX_CHARTS], unsigned *map_device_to_plot, struct window_position *process_position, struct window_position *setup_position); #endif // INTERFACE_LAYOUT_SELECTION_H__ nvtop-3.0.2/include/nvtop/interface_options.h000066400000000000000000000127751444130114000213430ustar00rootroot00000000000000/* * * Copyright (C) 2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef INTERFACE_OPTIONS_H__ #define INTERFACE_OPTIONS_H__ #include "nvtop/common.h" #include "nvtop/extract_gpuinfo_common.h" #include "nvtop/interface_common.h" #include typedef struct { plot_info_to_draw to_draw; // The set of metrics to draw for this gpu bool doNotMonitor; // True if this GPU should not be monitored struct gpu_info *linkedGpu; // The gpu to which this option apply } nvtop_interface_gpu_opts; typedef struct nvtop_interface_option_struct { bool plot_left_to_right; // true to reverse the plot refresh direction defines inactivity (0 use rate) before hiding it bool temperature_in_fahrenheit; // Switch from celsius to fahrenheit temperature scale bool use_color; // Name self explanatory double encode_decode_hiding_timer; // Negative to always display, positive nvtop_interface_gpu_opts *gpu_specific_opts; // GPU specific options char *config_file_location; // Location of the config file enum process_field sort_processes_by; // Specify the field used to order the processes bool sort_descending_order; // Sort in descenging order int update_interval; // Interval between interface update in milliseconds process_field_displayed process_fields_displayed; // Which columns of the // process list are displayed bool show_startup_messages; // True to show the startup messages bool filter_nvtop_pid; // Do not show nvtop pid in the processes list bool has_monitored_set_changed; // True if the set of monitored gpu was modified through the interface } nvtop_interface_option; inline bool plot_isset_draw_info(enum plot_information check_info, plot_info_to_draw to_draw) { return (to_draw & (1 << check_info)) > 0; } inline unsigned plot_count_draw_info(plot_info_to_draw to_draw) { unsigned count = 0; for (int i = plot_gpu_rate; i < plot_information_count; ++i) { count += plot_isset_draw_info((enum plot_information)i, to_draw); } return count; } inline plot_info_to_draw plot_add_draw_info(enum plot_information set_info, plot_info_to_draw to_draw) { if (plot_count_draw_info(to_draw) < MAX_LINES_PER_PLOT) return to_draw | (1 << set_info); else return to_draw; } inline plot_info_to_draw plot_remove_draw_info(enum plot_information reset_info, plot_info_to_draw to_draw) { return to_draw & (~(1 << reset_info)); } inline plot_info_to_draw plot_default_draw_info(void) { return (1 << plot_gpu_rate) | (1 << plot_gpu_mem_rate); } void alloc_interface_options_internals(char *config_file_location, unsigned num_devices, struct list_head *devices, nvtop_interface_option *options); unsigned interface_check_and_fix_monitored_gpus(unsigned num_devices, struct list_head *monitoredGpus, struct list_head *nonMonitoredGpus, nvtop_interface_option *options); bool load_interface_options_from_config_file(unsigned num_devices, nvtop_interface_option *options); bool save_interface_options_to_config_file(unsigned total_dev_count, const nvtop_interface_option *options); inline bool process_is_field_displayed(enum process_field field, process_field_displayed fields_displayed) { return (fields_displayed & (1 << field)) > 0; } inline process_field_displayed process_remove_field_to_display(enum process_field field, process_field_displayed fields_displayed) { return fields_displayed & (~(1 << field)); } inline process_field_displayed process_add_field_to_display(enum process_field field, process_field_displayed fields_displayed) { return fields_displayed | (1 << field); } inline process_field_displayed process_default_displayed_field(void) { process_field_displayed to_display = 0; for (int field = process_pid; field < process_field_count; ++field) { to_display = process_add_field_to_display((enum process_field)field, to_display); } to_display = process_remove_field_to_display(process_enc_rate, to_display); to_display = process_remove_field_to_display(process_dec_rate, to_display); return to_display; } inline unsigned process_field_displayed_count(process_field_displayed fields_displayed) { unsigned displayed_count = 0; for (int field = process_pid; field < process_field_count; ++field) { if (process_is_field_displayed((enum process_field)field, fields_displayed)) displayed_count++; } return displayed_count; } enum process_field process_default_sort_by_from(process_field_displayed fields_displayed); #endif // INTERFACE_OPTIONS_H__ nvtop-3.0.2/include/nvtop/interface_ring_buffer.h000066400000000000000000000114541444130114000221310ustar00rootroot00000000000000/* * * Copyright (C) 2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef INTERFACE_RING_BUFFER_H__ #define INTERFACE_RING_BUFFER_H__ #include typedef struct interface_ring_buffer_st { unsigned monitored_dev_count; unsigned per_device_data_saved; unsigned buffer_size; void *ring_buffer[2]; } interface_ring_buffer; #define INTERFACE_RING_BUFFER_DATA(ring_buffer_ptr, name) \ unsigned(*name)[ring_buffer_ptr->per_device_data_saved][ring_buffer_ptr->buffer_size] = \ (unsigned(*)[ring_buffer_ptr->per_device_data_saved][ring_buffer_ptr->buffer_size]) \ ring_buffer_ptr->ring_buffer[1]; #define INTERFACE_RING_BUFFER_INDICES(ring_buffer_ptr, name) \ unsigned(*name)[ring_buffer_ptr->per_device_data_saved][2] = \ (unsigned(*)[ring_buffer_ptr->per_device_data_saved][2])ring_buffer_ptr->ring_buffer[0]; void interface_alloc_ring_buffer(unsigned monitored_dev_count, unsigned per_device_data, unsigned buffer_size, interface_ring_buffer *ring_buffer); void interface_free_ring_buffer(interface_ring_buffer *buffer); inline unsigned interface_ring_buffer_data_stored(const interface_ring_buffer *buff, unsigned device, unsigned which_data) { INTERFACE_RING_BUFFER_INDICES(buff, indices); unsigned start = indices[device][which_data][0]; unsigned end = indices[device][which_data][1]; unsigned length = end - start; if (end < start) { // Has wrapped around the buffer length += buff->buffer_size; } return length; } inline unsigned interface_index_in_ring(const interface_ring_buffer *buff, unsigned device, unsigned which_data, unsigned index) { assert(interface_ring_buffer_data_stored(buff, device, which_data) > index); INTERFACE_RING_BUFFER_INDICES(buff, indices); unsigned start = indices[device][which_data][0]; unsigned location = start + index; if (location >= buff->buffer_size) location -= buff->buffer_size; return location; } inline unsigned interface_ring_buffer_get(const interface_ring_buffer *buff, unsigned device, unsigned which_data, unsigned index) { INTERFACE_RING_BUFFER_DATA(buff, data); unsigned index_in_ring = interface_index_in_ring(buff, device, which_data, index); return data[device][which_data][index_in_ring]; } inline void interface_ring_buffer_push(interface_ring_buffer *buff, unsigned device, unsigned which_data, unsigned value) { INTERFACE_RING_BUFFER_INDICES(buff, indices); INTERFACE_RING_BUFFER_DATA(buff, data); unsigned start = indices[device][which_data][0]; unsigned end = indices[device][which_data][1]; // If ring full, move start index data[device][which_data][end] = value; end++; if (end == buff->buffer_size) end -= buff->buffer_size; if (end == start) { start++; if (start == buff->buffer_size) start -= buff->buffer_size; } indices[device][which_data][0] = start; indices[device][which_data][1] = end; } inline void interface_ring_buffer_pop(interface_ring_buffer *buff, unsigned device, unsigned which_data) { INTERFACE_RING_BUFFER_INDICES(buff, indices); unsigned start = indices[device][which_data][0]; unsigned end = indices[device][which_data][1]; if (start != end) { start++; if (start == buff->buffer_size) start -= buff->buffer_size; indices[device][which_data][0] = start; } } inline void interface_ring_buffer_empty_select(interface_ring_buffer *buff, unsigned device, unsigned which_data) { INTERFACE_RING_BUFFER_INDICES(buff, indices); indices[device][which_data][0] = 0; indices[device][which_data][1] = 0; } inline void interface_ring_buffer_empty(interface_ring_buffer *buff, unsigned device) { for (unsigned i = 0; i < buff->per_device_data_saved; ++i) { interface_ring_buffer_empty_select(buff, device, i); } } #endif // INTERFACE_RING_BUFFER_H__ nvtop-3.0.2/include/nvtop/interface_setup_win.h000066400000000000000000000027371444130114000216620ustar00rootroot00000000000000/* * * Copyright (C) 2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef INTERFACE_SETUP_WIN_H__ #define INTERFACE_SETUP_WIN_H__ #include "nvtop/extract_gpuinfo.h" #include "nvtop/interface_internal_common.h" #include "nvtop/interface_layout_selection.h" void alloc_setup_window(struct window_position *position, struct setup_window *setup_win); void free_setup_window(struct setup_window *setup_win); void show_setup_window(struct nvtop_interface *interface); void hide_setup_window(struct nvtop_interface *interface); void draw_setup_window(unsigned monitored_dev_count, struct list_head *devices, struct nvtop_interface *interface); void draw_setup_window_shortcuts(struct nvtop_interface *interface); void handle_setup_win_keypress(int keyId, struct nvtop_interface *interface); #endif // INTERFACE_SETUP_WIN_H__ nvtop-3.0.2/include/nvtop/plot.h000066400000000000000000000022721444130114000165750ustar00rootroot00000000000000/* * * Copyright (C) 2018 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef __PLOT_H_ #define __PLOT_H_ #include "nvtop/common.h" #include #include #include #define PLOT_MAX_LEGEND_SIZE 35 void nvtop_line_plot(WINDOW *win, size_t num_data, const double *data, unsigned num_plots, bool legend_left, char legend[MAX_LINES_PER_PLOT][PLOT_MAX_LEGEND_SIZE]); void draw_rectangle(WINDOW *win, unsigned startX, unsigned startY, unsigned sizeX, unsigned sizeY); #endif // __PLOT_H_ nvtop-3.0.2/include/nvtop/time.h000066400000000000000000000050451444130114000165560ustar00rootroot00000000000000/* * * Copyright (C) 2018-2022 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef NVTOP_TIME_H_ #define NVTOP_TIME_H_ #include #include #include #ifdef CLOCK_MONOTONIC_RAW #define NVTOP_CLOCK CLOCK_MONOTONIC_RAW #else #define NVTOP_CLOCK CLOCK_MONOTONIC #endif typedef struct timespec nvtop_time; inline void nvtop_get_current_time(nvtop_time *time) { clock_gettime(NVTOP_CLOCK, time); } inline double nvtop_difftime(nvtop_time t0, nvtop_time t1) { double secdiff = difftime(t1.tv_sec, t0.tv_sec); if (t1.tv_nsec < t0.tv_nsec) { long val = 1000000000l - t0.tv_nsec + t1.tv_nsec; secdiff += (double)val / 1e9 - 1.; } else { long val = t1.tv_nsec - t0.tv_nsec; secdiff += (double)val / 1e9; } return secdiff; } inline uint64_t nvtop_time_u64(nvtop_time t0) { return (uint64_t)(t0.tv_sec) * UINT64_C(1000000000) + t0.tv_nsec; } inline uint64_t nvtop_difftime_u64(nvtop_time t0, nvtop_time t1) { return (uint64_t)(t1.tv_sec - t0.tv_sec) * UINT64_C(1000000000) + (uint64_t)t1.tv_nsec - (uint64_t)t0.tv_nsec; } inline nvtop_time nvtop_hmns_to_time(unsigned hour, unsigned minutes, unsigned long nanosec) { nvtop_time t = {hour * 60 * 60 + 60 * minutes + nanosec / 1000000, nanosec % 1000000}; return t; } inline nvtop_time nvtop_substract_time(nvtop_time t0, nvtop_time t1) { nvtop_time t = t0.tv_nsec - t1.tv_nsec < 0 ? (nvtop_time){t0.tv_sec - t1.tv_sec - 1, t0.tv_nsec - t1.tv_nsec + 1000000} : (nvtop_time){t0.tv_sec - t1.tv_sec, t0.tv_nsec - t1.tv_nsec}; return t; } inline nvtop_time nvtop_add_time(nvtop_time t0, nvtop_time t1) { nvtop_time t = t0.tv_nsec + t1.tv_nsec > 1000000 ? (nvtop_time){t0.tv_sec + t1.tv_sec + 1, t0.tv_nsec + t1.tv_nsec - 1000000} : (nvtop_time){t0.tv_sec + t1.tv_sec, t0.tv_nsec + t1.tv_nsec}; return t; } #endif // NVTOP_TIME_H_ nvtop-3.0.2/include/nvtop/version.h.in000066400000000000000000000020631444130114000177070ustar00rootroot00000000000000/* * * Copyright (C) 2018 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #ifndef __NVTOP_VERSION_H_ #define __NVTOP_VERSION_H_ #define NVTOP_VERSION_MAJOR @nvtop_VERSION_MAJOR@ #define NVTOP_VERSION_MINOR @nvtop_VERSION_MINOR@ #define NVTOP_VERSION_PATCH @nvtop_VERSION_PATCH@ #define NVTOP_VERSION_STRING "@nvtop_VERSION_MAJOR@.@nvtop_VERSION_MINOR@.@nvtop_VERSION_PATCH@" #endif // __NVTOP_VERSION_H_ nvtop-3.0.2/include/uthash.h000066400000000000000000002200711444130114000157440ustar00rootroot00000000000000/* Copyright (c) 2003-2021, Troy D. Hanson http://troydhanson.github.io/uthash/ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef UTHASH_H #define UTHASH_H #define UTHASH_VERSION 2.3.0 #include /* memcmp, memset, strlen */ #include /* ptrdiff_t */ #include /* exit */ #if defined(HASH_DEFINE_OWN_STDINT) && HASH_DEFINE_OWN_STDINT /* This codepath is provided for backward compatibility, but I plan to remove it. */ #warning "HASH_DEFINE_OWN_STDINT is deprecated; please use HASH_NO_STDINT instead" typedef unsigned int uint32_t; typedef unsigned char uint8_t; #elif defined(HASH_NO_STDINT) && HASH_NO_STDINT #else #include /* uint8_t, uint32_t */ #endif /* These macros use decltype or the earlier __typeof GNU extension. As decltype is only available in newer compilers (VS2010 or gcc 4.3+ when compiling c++ source) this code uses whatever method is needed or, for VS2008 where neither is available, uses casting workarounds. */ #if !defined(DECLTYPE) && !defined(NO_DECLTYPE) #if defined(_MSC_VER) /* MS compiler */ #if _MSC_VER >= 1600 && defined(__cplusplus) /* VS2010 or newer in C++ mode */ #define DECLTYPE(x) (decltype(x)) #else /* VS2008 or older (or VS2010 in C mode) */ #define NO_DECLTYPE #endif #elif defined(__BORLANDC__) || defined(__ICCARM__) || defined(__LCC__) || defined(__WATCOMC__) #define NO_DECLTYPE #else /* GNU, Sun and other compilers */ #define DECLTYPE(x) (__typeof(x)) #endif #endif #ifdef NO_DECLTYPE #define DECLTYPE(x) #define DECLTYPE_ASSIGN(dst,src) \ do { \ char **_da_dst = (char**)(&(dst)); \ *_da_dst = (char*)(src); \ } while (0) #else #define DECLTYPE_ASSIGN(dst,src) \ do { \ (dst) = DECLTYPE(dst)(src); \ } while (0) #endif #ifndef uthash_malloc #define uthash_malloc(sz) malloc(sz) /* malloc fcn */ #endif #ifndef uthash_free #define uthash_free(ptr,sz) free(ptr) /* free fcn */ #endif #ifndef uthash_bzero #define uthash_bzero(a,n) memset(a,'\0',n) #endif #ifndef uthash_strlen #define uthash_strlen(s) strlen(s) #endif #ifndef HASH_FUNCTION #define HASH_FUNCTION(keyptr,keylen,hashv) HASH_JEN(keyptr, keylen, hashv) #endif #ifndef HASH_KEYCMP #define HASH_KEYCMP(a,b,n) memcmp(a,b,n) #endif #ifndef uthash_noexpand_fyi #define uthash_noexpand_fyi(tbl) /* can be defined to log noexpand */ #endif #ifndef uthash_expand_fyi #define uthash_expand_fyi(tbl) /* can be defined to log expands */ #endif #ifndef HASH_NONFATAL_OOM #define HASH_NONFATAL_OOM 0 #endif #if HASH_NONFATAL_OOM /* malloc failures can be recovered from */ #ifndef uthash_nonfatal_oom #define uthash_nonfatal_oom(obj) do {} while (0) /* non-fatal OOM error */ #endif #define HASH_RECORD_OOM(oomed) do { (oomed) = 1; } while (0) #define IF_HASH_NONFATAL_OOM(x) x #else /* malloc failures result in lost memory, hash tables are unusable */ #ifndef uthash_fatal #define uthash_fatal(msg) exit(-1) /* fatal OOM error */ #endif #define HASH_RECORD_OOM(oomed) uthash_fatal("out of memory") #define IF_HASH_NONFATAL_OOM(x) #endif /* initial number of buckets */ #define HASH_INITIAL_NUM_BUCKETS 32U /* initial number of buckets */ #define HASH_INITIAL_NUM_BUCKETS_LOG2 5U /* lg2 of initial number of buckets */ #define HASH_BKT_CAPACITY_THRESH 10U /* expand when bucket count reaches */ /* calculate the element whose hash handle address is hhp */ #define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho))) /* calculate the hash handle from element address elp */ #define HH_FROM_ELMT(tbl,elp) ((UT_hash_handle*)(void*)(((char*)(elp)) + ((tbl)->hho))) #define HASH_ROLLBACK_BKT(hh, head, itemptrhh) \ do { \ struct UT_hash_handle *_hd_hh_item = (itemptrhh); \ unsigned _hd_bkt; \ HASH_TO_BKT(_hd_hh_item->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ (head)->hh.tbl->buckets[_hd_bkt].count++; \ _hd_hh_item->hh_next = NULL; \ _hd_hh_item->hh_prev = NULL; \ } while (0) #define HASH_VALUE(keyptr,keylen,hashv) \ do { \ HASH_FUNCTION(keyptr, keylen, hashv); \ } while (0) #define HASH_FIND_BYHASHVALUE(hh,head,keyptr,keylen,hashval,out) \ do { \ (out) = NULL; \ if (head) { \ unsigned _hf_bkt; \ HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _hf_bkt); \ if (HASH_BLOOM_TEST((head)->hh.tbl, hashval) != 0) { \ HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], keyptr, keylen, hashval, out); \ } \ } \ } while (0) #define HASH_FIND(hh,head,keyptr,keylen,out) \ do { \ (out) = NULL; \ if (head) { \ unsigned _hf_hashv; \ HASH_VALUE(keyptr, keylen, _hf_hashv); \ HASH_FIND_BYHASHVALUE(hh, head, keyptr, keylen, _hf_hashv, out); \ } \ } while (0) #ifdef HASH_BLOOM #define HASH_BLOOM_BITLEN (1UL << HASH_BLOOM) #define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8UL) + (((HASH_BLOOM_BITLEN%8UL)!=0UL) ? 1UL : 0UL) #define HASH_BLOOM_MAKE(tbl,oomed) \ do { \ (tbl)->bloom_nbits = HASH_BLOOM; \ (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN); \ if (!(tbl)->bloom_bv) { \ HASH_RECORD_OOM(oomed); \ } else { \ uthash_bzero((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE; \ } \ } while (0) #define HASH_BLOOM_FREE(tbl) \ do { \ uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN); \ } while (0) #define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8U] |= (1U << ((idx)%8U))) #define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8U] & (1U << ((idx)%8U))) #define HASH_BLOOM_ADD(tbl,hashv) \ HASH_BLOOM_BITSET((tbl)->bloom_bv, ((hashv) & (uint32_t)((1UL << (tbl)->bloom_nbits) - 1U))) #define HASH_BLOOM_TEST(tbl,hashv) \ HASH_BLOOM_BITTEST((tbl)->bloom_bv, ((hashv) & (uint32_t)((1UL << (tbl)->bloom_nbits) - 1U))) #else #define HASH_BLOOM_MAKE(tbl,oomed) #define HASH_BLOOM_FREE(tbl) #define HASH_BLOOM_ADD(tbl,hashv) #define HASH_BLOOM_TEST(tbl,hashv) (1) #define HASH_BLOOM_BYTELEN 0U #endif #define HASH_MAKE_TABLE(hh,head,oomed) \ do { \ (head)->hh.tbl = (UT_hash_table*)uthash_malloc(sizeof(UT_hash_table)); \ if (!(head)->hh.tbl) { \ HASH_RECORD_OOM(oomed); \ } else { \ uthash_bzero((head)->hh.tbl, sizeof(UT_hash_table)); \ (head)->hh.tbl->tail = &((head)->hh); \ (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS; \ (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2; \ (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head); \ (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc( \ HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket)); \ (head)->hh.tbl->signature = HASH_SIGNATURE; \ if (!(head)->hh.tbl->buckets) { \ HASH_RECORD_OOM(oomed); \ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ } else { \ uthash_bzero((head)->hh.tbl->buckets, \ HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket)); \ HASH_BLOOM_MAKE((head)->hh.tbl, oomed); \ IF_HASH_NONFATAL_OOM( \ if (oomed) { \ uthash_free((head)->hh.tbl->buckets, \ HASH_INITIAL_NUM_BUCKETS*sizeof(struct UT_hash_bucket)); \ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ } \ ) \ } \ } \ } while (0) #define HASH_REPLACE_BYHASHVALUE_INORDER(hh,head,fieldname,keylen_in,hashval,add,replaced,cmpfcn) \ do { \ (replaced) = NULL; \ HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \ if (replaced) { \ HASH_DELETE(hh, head, replaced); \ } \ HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn); \ } while (0) #define HASH_REPLACE_BYHASHVALUE(hh,head,fieldname,keylen_in,hashval,add,replaced) \ do { \ (replaced) = NULL; \ HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \ if (replaced) { \ HASH_DELETE(hh, head, replaced); \ } \ HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add); \ } while (0) #define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced) \ do { \ unsigned _hr_hashv; \ HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv); \ HASH_REPLACE_BYHASHVALUE(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced); \ } while (0) #define HASH_REPLACE_INORDER(hh,head,fieldname,keylen_in,add,replaced,cmpfcn) \ do { \ unsigned _hr_hashv; \ HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv); \ HASH_REPLACE_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced, cmpfcn); \ } while (0) #define HASH_APPEND_LIST(hh, head, add) \ do { \ (add)->hh.next = NULL; \ (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail); \ (head)->hh.tbl->tail->next = (add); \ (head)->hh.tbl->tail = &((add)->hh); \ } while (0) #define HASH_AKBI_INNER_LOOP(hh,head,add,cmpfcn) \ do { \ do { \ if (cmpfcn(DECLTYPE(head)(_hs_iter), add) > 0) { \ break; \ } \ } while ((_hs_iter = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->next)); \ } while (0) #ifdef NO_DECLTYPE #undef HASH_AKBI_INNER_LOOP #define HASH_AKBI_INNER_LOOP(hh,head,add,cmpfcn) \ do { \ char *_hs_saved_head = (char*)(head); \ do { \ DECLTYPE_ASSIGN(head, _hs_iter); \ if (cmpfcn(head, add) > 0) { \ DECLTYPE_ASSIGN(head, _hs_saved_head); \ break; \ } \ DECLTYPE_ASSIGN(head, _hs_saved_head); \ } while ((_hs_iter = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->next)); \ } while (0) #endif #if HASH_NONFATAL_OOM #define HASH_ADD_TO_TABLE(hh,head,keyptr,keylen_in,hashval,add,oomed) \ do { \ if (!(oomed)) { \ unsigned _ha_bkt; \ (head)->hh.tbl->num_items++; \ HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _ha_bkt); \ HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt], hh, &(add)->hh, oomed); \ if (oomed) { \ HASH_ROLLBACK_BKT(hh, head, &(add)->hh); \ HASH_DELETE_HH(hh, head, &(add)->hh); \ (add)->hh.tbl = NULL; \ uthash_nonfatal_oom(add); \ } else { \ HASH_BLOOM_ADD((head)->hh.tbl, hashval); \ HASH_EMIT_KEY(hh, head, keyptr, keylen_in); \ } \ } else { \ (add)->hh.tbl = NULL; \ uthash_nonfatal_oom(add); \ } \ } while (0) #else #define HASH_ADD_TO_TABLE(hh,head,keyptr,keylen_in,hashval,add,oomed) \ do { \ unsigned _ha_bkt; \ (head)->hh.tbl->num_items++; \ HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _ha_bkt); \ HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt], hh, &(add)->hh, oomed); \ HASH_BLOOM_ADD((head)->hh.tbl, hashval); \ HASH_EMIT_KEY(hh, head, keyptr, keylen_in); \ } while (0) #endif #define HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh,head,keyptr,keylen_in,hashval,add,cmpfcn) \ do { \ IF_HASH_NONFATAL_OOM( int _ha_oomed = 0; ) \ (add)->hh.hashv = (hashval); \ (add)->hh.key = (char*) (keyptr); \ (add)->hh.keylen = (unsigned) (keylen_in); \ if (!(head)) { \ (add)->hh.next = NULL; \ (add)->hh.prev = NULL; \ HASH_MAKE_TABLE(hh, add, _ha_oomed); \ IF_HASH_NONFATAL_OOM( if (!_ha_oomed) { ) \ (head) = (add); \ IF_HASH_NONFATAL_OOM( } ) \ } else { \ void *_hs_iter = (head); \ (add)->hh.tbl = (head)->hh.tbl; \ HASH_AKBI_INNER_LOOP(hh, head, add, cmpfcn); \ if (_hs_iter) { \ (add)->hh.next = _hs_iter; \ if (((add)->hh.prev = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->prev)) { \ HH_FROM_ELMT((head)->hh.tbl, (add)->hh.prev)->next = (add); \ } else { \ (head) = (add); \ } \ HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->prev = (add); \ } else { \ HASH_APPEND_LIST(hh, head, add); \ } \ } \ HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, _ha_oomed); \ HASH_FSCK(hh, head, "HASH_ADD_KEYPTR_BYHASHVALUE_INORDER"); \ } while (0) #define HASH_ADD_KEYPTR_INORDER(hh,head,keyptr,keylen_in,add,cmpfcn) \ do { \ unsigned _hs_hashv; \ HASH_VALUE(keyptr, keylen_in, _hs_hashv); \ HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, keyptr, keylen_in, _hs_hashv, add, cmpfcn); \ } while (0) #define HASH_ADD_BYHASHVALUE_INORDER(hh,head,fieldname,keylen_in,hashval,add,cmpfcn) \ HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn) #define HASH_ADD_INORDER(hh,head,fieldname,keylen_in,add,cmpfcn) \ HASH_ADD_KEYPTR_INORDER(hh, head, &((add)->fieldname), keylen_in, add, cmpfcn) #define HASH_ADD_KEYPTR_BYHASHVALUE(hh,head,keyptr,keylen_in,hashval,add) \ do { \ IF_HASH_NONFATAL_OOM( int _ha_oomed = 0; ) \ (add)->hh.hashv = (hashval); \ (add)->hh.key = (const void*) (keyptr); \ (add)->hh.keylen = (unsigned) (keylen_in); \ if (!(head)) { \ (add)->hh.next = NULL; \ (add)->hh.prev = NULL; \ HASH_MAKE_TABLE(hh, add, _ha_oomed); \ IF_HASH_NONFATAL_OOM( if (!_ha_oomed) { ) \ (head) = (add); \ IF_HASH_NONFATAL_OOM( } ) \ } else { \ (add)->hh.tbl = (head)->hh.tbl; \ HASH_APPEND_LIST(hh, head, add); \ } \ HASH_ADD_TO_TABLE(hh, head, keyptr, keylen_in, hashval, add, _ha_oomed); \ HASH_FSCK(hh, head, "HASH_ADD_KEYPTR_BYHASHVALUE"); \ } while (0) #define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add) \ do { \ unsigned _ha_hashv; \ HASH_VALUE(keyptr, keylen_in, _ha_hashv); \ HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, keyptr, keylen_in, _ha_hashv, add); \ } while (0) #define HASH_ADD_BYHASHVALUE(hh,head,fieldname,keylen_in,hashval,add) \ HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add) #define HASH_ADD(hh,head,fieldname,keylen_in,add) \ HASH_ADD_KEYPTR(hh, head, &((add)->fieldname), keylen_in, add) #define HASH_TO_BKT(hashv,num_bkts,bkt) \ do { \ bkt = ((hashv) & ((num_bkts) - 1U)); \ } while (0) /* delete "delptr" from the hash table. * "the usual" patch-up process for the app-order doubly-linked-list. * The use of _hd_hh_del below deserves special explanation. * These used to be expressed using (delptr) but that led to a bug * if someone used the same symbol for the head and deletee, like * HASH_DELETE(hh,users,users); * We want that to work, but by changing the head (users) below * we were forfeiting our ability to further refer to the deletee (users) * in the patch-up process. Solution: use scratch space to * copy the deletee pointer, then the latter references are via that * scratch pointer rather than through the repointed (users) symbol. */ #define HASH_DELETE(hh,head,delptr) \ HASH_DELETE_HH(hh, head, &(delptr)->hh) #define HASH_DELETE_HH(hh,head,delptrhh) \ do { \ struct UT_hash_handle *_hd_hh_del = (delptrhh); \ if ((_hd_hh_del->prev == NULL) && (_hd_hh_del->next == NULL)) { \ HASH_BLOOM_FREE((head)->hh.tbl); \ uthash_free((head)->hh.tbl->buckets, \ (head)->hh.tbl->num_buckets * sizeof(struct UT_hash_bucket)); \ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ (head) = NULL; \ } else { \ unsigned _hd_bkt; \ if (_hd_hh_del == (head)->hh.tbl->tail) { \ (head)->hh.tbl->tail = HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev); \ } \ if (_hd_hh_del->prev != NULL) { \ HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev)->next = _hd_hh_del->next; \ } else { \ DECLTYPE_ASSIGN(head, _hd_hh_del->next); \ } \ if (_hd_hh_del->next != NULL) { \ HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->next)->prev = _hd_hh_del->prev; \ } \ HASH_TO_BKT(_hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt); \ HASH_DEL_IN_BKT((head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del); \ (head)->hh.tbl->num_items--; \ } \ HASH_FSCK(hh, head, "HASH_DELETE_HH"); \ } while (0) /* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */ #define HASH_FIND_STR(head,findstr,out) \ do { \ unsigned _uthash_hfstr_keylen = (unsigned)uthash_strlen(findstr); \ HASH_FIND(hh, head, findstr, _uthash_hfstr_keylen, out); \ } while (0) #define HASH_ADD_STR(head,strfield,add) \ do { \ unsigned _uthash_hastr_keylen = (unsigned)uthash_strlen((add)->strfield); \ HASH_ADD(hh, head, strfield[0], _uthash_hastr_keylen, add); \ } while (0) #define HASH_REPLACE_STR(head,strfield,add,replaced) \ do { \ unsigned _uthash_hrstr_keylen = (unsigned)uthash_strlen((add)->strfield); \ HASH_REPLACE(hh, head, strfield[0], _uthash_hrstr_keylen, add, replaced); \ } while (0) #define HASH_FIND_INT(head,findint,out) \ HASH_FIND(hh,head,findint,sizeof(int),out) #define HASH_ADD_INT(head,intfield,add) \ HASH_ADD(hh,head,intfield,sizeof(int),add) #define HASH_REPLACE_INT(head,intfield,add,replaced) \ HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced) #define HASH_FIND_PTR(head,findptr,out) \ HASH_FIND(hh,head,findptr,sizeof(void *),out) #define HASH_ADD_PTR(head,ptrfield,add) \ HASH_ADD(hh,head,ptrfield,sizeof(void *),add) #define HASH_REPLACE_PTR(head,ptrfield,add,replaced) \ HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced) #define HASH_DEL(head,delptr) \ HASH_DELETE(hh,head,delptr) /* HASH_FSCK checks hash integrity on every add/delete when HASH_DEBUG is defined. * This is for uthash developer only; it compiles away if HASH_DEBUG isn't defined. */ #ifdef HASH_DEBUG #include /* fprintf, stderr */ #define HASH_OOPS(...) do { fprintf(stderr, __VA_ARGS__); exit(-1); } while (0) #define HASH_FSCK(hh,head,where) \ do { \ struct UT_hash_handle *_thh; \ if (head) { \ unsigned _bkt_i; \ unsigned _count = 0; \ char *_prev; \ for (_bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; ++_bkt_i) { \ unsigned _bkt_count = 0; \ _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head; \ _prev = NULL; \ while (_thh) { \ if (_prev != (char*)(_thh->hh_prev)) { \ HASH_OOPS("%s: invalid hh_prev %p, actual %p\n", \ (where), (void*)_thh->hh_prev, (void*)_prev); \ } \ _bkt_count++; \ _prev = (char*)(_thh); \ _thh = _thh->hh_next; \ } \ _count += _bkt_count; \ if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) { \ HASH_OOPS("%s: invalid bucket count %u, actual %u\n", \ (where), (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count); \ } \ } \ if (_count != (head)->hh.tbl->num_items) { \ HASH_OOPS("%s: invalid hh item count %u, actual %u\n", \ (where), (head)->hh.tbl->num_items, _count); \ } \ _count = 0; \ _prev = NULL; \ _thh = &(head)->hh; \ while (_thh) { \ _count++; \ if (_prev != (char*)_thh->prev) { \ HASH_OOPS("%s: invalid prev %p, actual %p\n", \ (where), (void*)_thh->prev, (void*)_prev); \ } \ _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh); \ _thh = (_thh->next ? HH_FROM_ELMT((head)->hh.tbl, _thh->next) : NULL); \ } \ if (_count != (head)->hh.tbl->num_items) { \ HASH_OOPS("%s: invalid app item count %u, actual %u\n", \ (where), (head)->hh.tbl->num_items, _count); \ } \ } \ } while (0) #else #define HASH_FSCK(hh,head,where) #endif /* When compiled with -DHASH_EMIT_KEYS, length-prefixed keys are emitted to * the descriptor to which this macro is defined for tuning the hash function. * The app can #include to get the prototype for write(2). */ #ifdef HASH_EMIT_KEYS #define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) \ do { \ unsigned _klen = fieldlen; \ write(HASH_EMIT_KEYS, &_klen, sizeof(_klen)); \ write(HASH_EMIT_KEYS, keyptr, (unsigned long)fieldlen); \ } while (0) #else #define HASH_EMIT_KEY(hh,head,keyptr,fieldlen) #endif /* The Bernstein hash function, used in Perl prior to v5.6. Note (x<<5+x)=x*33. */ #define HASH_BER(key,keylen,hashv) \ do { \ unsigned _hb_keylen = (unsigned)keylen; \ const unsigned char *_hb_key = (const unsigned char*)(key); \ (hashv) = 0; \ while (_hb_keylen-- != 0U) { \ (hashv) = (((hashv) << 5) + (hashv)) + *_hb_key++; \ } \ } while (0) /* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */ #define HASH_SAX(key,keylen,hashv) \ do { \ unsigned _sx_i; \ const unsigned char *_hs_key = (const unsigned char*)(key); \ hashv = 0; \ for (_sx_i=0; _sx_i < keylen; _sx_i++) { \ hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i]; \ } \ } while (0) /* FNV-1a variation */ #define HASH_FNV(key,keylen,hashv) \ do { \ unsigned _fn_i; \ const unsigned char *_hf_key = (const unsigned char*)(key); \ (hashv) = 2166136261U; \ for (_fn_i=0; _fn_i < keylen; _fn_i++) { \ hashv = hashv ^ _hf_key[_fn_i]; \ hashv = hashv * 16777619U; \ } \ } while (0) #define HASH_OAT(key,keylen,hashv) \ do { \ unsigned _ho_i; \ const unsigned char *_ho_key=(const unsigned char*)(key); \ hashv = 0; \ for(_ho_i=0; _ho_i < keylen; _ho_i++) { \ hashv += _ho_key[_ho_i]; \ hashv += (hashv << 10); \ hashv ^= (hashv >> 6); \ } \ hashv += (hashv << 3); \ hashv ^= (hashv >> 11); \ hashv += (hashv << 15); \ } while (0) #define HASH_JEN_MIX(a,b,c) \ do { \ a -= b; a -= c; a ^= ( c >> 13 ); \ b -= c; b -= a; b ^= ( a << 8 ); \ c -= a; c -= b; c ^= ( b >> 13 ); \ a -= b; a -= c; a ^= ( c >> 12 ); \ b -= c; b -= a; b ^= ( a << 16 ); \ c -= a; c -= b; c ^= ( b >> 5 ); \ a -= b; a -= c; a ^= ( c >> 3 ); \ b -= c; b -= a; b ^= ( a << 10 ); \ c -= a; c -= b; c ^= ( b >> 15 ); \ } while (0) #define HASH_JEN(key,keylen,hashv) \ do { \ unsigned _hj_i,_hj_j,_hj_k; \ unsigned const char *_hj_key=(unsigned const char*)(key); \ hashv = 0xfeedbeefu; \ _hj_i = _hj_j = 0x9e3779b9u; \ _hj_k = (unsigned)(keylen); \ while (_hj_k >= 12U) { \ _hj_i += (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 ) \ + ( (unsigned)_hj_key[2] << 16 ) \ + ( (unsigned)_hj_key[3] << 24 ) ); \ _hj_j += (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 ) \ + ( (unsigned)_hj_key[6] << 16 ) \ + ( (unsigned)_hj_key[7] << 24 ) ); \ hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 ) \ + ( (unsigned)_hj_key[10] << 16 ) \ + ( (unsigned)_hj_key[11] << 24 ) ); \ \ HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ \ _hj_key += 12; \ _hj_k -= 12U; \ } \ hashv += (unsigned)(keylen); \ switch ( _hj_k ) { \ case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); /* FALLTHROUGH */ \ case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); /* FALLTHROUGH */ \ case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); /* FALLTHROUGH */ \ case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); /* FALLTHROUGH */ \ case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); /* FALLTHROUGH */ \ case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); /* FALLTHROUGH */ \ case 5: _hj_j += _hj_key[4]; /* FALLTHROUGH */ \ case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); /* FALLTHROUGH */ \ case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); /* FALLTHROUGH */ \ case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); /* FALLTHROUGH */ \ case 1: _hj_i += _hj_key[0]; /* FALLTHROUGH */ \ default: ; \ } \ HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ } while (0) /* The Paul Hsieh hash function */ #undef get16bits #if (defined(__GNUC__) && defined(__i386__)) || defined(__WATCOMC__) \ || defined(_MSC_VER) || defined (__BORLANDC__) || defined (__TURBOC__) #define get16bits(d) (*((const uint16_t *) (d))) #endif #if !defined (get16bits) #define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8) \ +(uint32_t)(((const uint8_t *)(d))[0]) ) #endif #define HASH_SFH(key,keylen,hashv) \ do { \ unsigned const char *_sfh_key=(unsigned const char*)(key); \ uint32_t _sfh_tmp, _sfh_len = (uint32_t)keylen; \ \ unsigned _sfh_rem = _sfh_len & 3U; \ _sfh_len >>= 2; \ hashv = 0xcafebabeu; \ \ /* Main loop */ \ for (;_sfh_len > 0U; _sfh_len--) { \ hashv += get16bits (_sfh_key); \ _sfh_tmp = ((uint32_t)(get16bits (_sfh_key+2)) << 11) ^ hashv; \ hashv = (hashv << 16) ^ _sfh_tmp; \ _sfh_key += 2U*sizeof (uint16_t); \ hashv += hashv >> 11; \ } \ \ /* Handle end cases */ \ switch (_sfh_rem) { \ case 3: hashv += get16bits (_sfh_key); \ hashv ^= hashv << 16; \ hashv ^= (uint32_t)(_sfh_key[sizeof (uint16_t)]) << 18; \ hashv += hashv >> 11; \ break; \ case 2: hashv += get16bits (_sfh_key); \ hashv ^= hashv << 11; \ hashv += hashv >> 17; \ break; \ case 1: hashv += *_sfh_key; \ hashv ^= hashv << 10; \ hashv += hashv >> 1; \ break; \ default: ; \ } \ \ /* Force "avalanching" of final 127 bits */ \ hashv ^= hashv << 3; \ hashv += hashv >> 5; \ hashv ^= hashv << 4; \ hashv += hashv >> 17; \ hashv ^= hashv << 25; \ hashv += hashv >> 6; \ } while (0) /* iterate over items in a known bucket to find desired item */ #define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,hashval,out) \ do { \ if ((head).hh_head != NULL) { \ DECLTYPE_ASSIGN(out, ELMT_FROM_HH(tbl, (head).hh_head)); \ } else { \ (out) = NULL; \ } \ while ((out) != NULL) { \ if ((out)->hh.hashv == (hashval) && (out)->hh.keylen == (keylen_in)) { \ if (HASH_KEYCMP((out)->hh.key, keyptr, keylen_in) == 0) { \ break; \ } \ } \ if ((out)->hh.hh_next != NULL) { \ DECLTYPE_ASSIGN(out, ELMT_FROM_HH(tbl, (out)->hh.hh_next)); \ } else { \ (out) = NULL; \ } \ } \ } while (0) /* add an item to a bucket */ #define HASH_ADD_TO_BKT(head,hh,addhh,oomed) \ do { \ UT_hash_bucket *_ha_head = &(head); \ _ha_head->count++; \ (addhh)->hh_next = _ha_head->hh_head; \ (addhh)->hh_prev = NULL; \ if (_ha_head->hh_head != NULL) { \ _ha_head->hh_head->hh_prev = (addhh); \ } \ _ha_head->hh_head = (addhh); \ if ((_ha_head->count >= ((_ha_head->expand_mult + 1U) * HASH_BKT_CAPACITY_THRESH)) \ && !(addhh)->tbl->noexpand) { \ HASH_EXPAND_BUCKETS(addhh,(addhh)->tbl, oomed); \ IF_HASH_NONFATAL_OOM( \ if (oomed) { \ HASH_DEL_IN_BKT(head,addhh); \ } \ ) \ } \ } while (0) /* remove an item from a given bucket */ #define HASH_DEL_IN_BKT(head,delhh) \ do { \ UT_hash_bucket *_hd_head = &(head); \ _hd_head->count--; \ if (_hd_head->hh_head == (delhh)) { \ _hd_head->hh_head = (delhh)->hh_next; \ } \ if ((delhh)->hh_prev) { \ (delhh)->hh_prev->hh_next = (delhh)->hh_next; \ } \ if ((delhh)->hh_next) { \ (delhh)->hh_next->hh_prev = (delhh)->hh_prev; \ } \ } while (0) /* Bucket expansion has the effect of doubling the number of buckets * and redistributing the items into the new buckets. Ideally the * items will distribute more or less evenly into the new buckets * (the extent to which this is true is a measure of the quality of * the hash function as it applies to the key domain). * * With the items distributed into more buckets, the chain length * (item count) in each bucket is reduced. Thus by expanding buckets * the hash keeps a bound on the chain length. This bounded chain * length is the essence of how a hash provides constant time lookup. * * The calculation of tbl->ideal_chain_maxlen below deserves some * explanation. First, keep in mind that we're calculating the ideal * maximum chain length based on the *new* (doubled) bucket count. * In fractions this is just n/b (n=number of items,b=new num buckets). * Since the ideal chain length is an integer, we want to calculate * ceil(n/b). We don't depend on floating point arithmetic in this * hash, so to calculate ceil(n/b) with integers we could write * * ceil(n/b) = (n/b) + ((n%b)?1:0) * * and in fact a previous version of this hash did just that. * But now we have improved things a bit by recognizing that b is * always a power of two. We keep its base 2 log handy (call it lb), * so now we can write this with a bit shift and logical AND: * * ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0) * */ #define HASH_EXPAND_BUCKETS(hh,tbl,oomed) \ do { \ unsigned _he_bkt; \ unsigned _he_bkt_i; \ struct UT_hash_handle *_he_thh, *_he_hh_nxt; \ UT_hash_bucket *_he_new_buckets, *_he_newbkt; \ _he_new_buckets = (UT_hash_bucket*)uthash_malloc( \ sizeof(struct UT_hash_bucket) * (tbl)->num_buckets * 2U); \ if (!_he_new_buckets) { \ HASH_RECORD_OOM(oomed); \ } else { \ uthash_bzero(_he_new_buckets, \ sizeof(struct UT_hash_bucket) * (tbl)->num_buckets * 2U); \ (tbl)->ideal_chain_maxlen = \ ((tbl)->num_items >> ((tbl)->log2_num_buckets+1U)) + \ ((((tbl)->num_items & (((tbl)->num_buckets*2U)-1U)) != 0U) ? 1U : 0U); \ (tbl)->nonideal_items = 0; \ for (_he_bkt_i = 0; _he_bkt_i < (tbl)->num_buckets; _he_bkt_i++) { \ _he_thh = (tbl)->buckets[ _he_bkt_i ].hh_head; \ while (_he_thh != NULL) { \ _he_hh_nxt = _he_thh->hh_next; \ HASH_TO_BKT(_he_thh->hashv, (tbl)->num_buckets * 2U, _he_bkt); \ _he_newbkt = &(_he_new_buckets[_he_bkt]); \ if (++(_he_newbkt->count) > (tbl)->ideal_chain_maxlen) { \ (tbl)->nonideal_items++; \ if (_he_newbkt->count > _he_newbkt->expand_mult * (tbl)->ideal_chain_maxlen) { \ _he_newbkt->expand_mult++; \ } \ } \ _he_thh->hh_prev = NULL; \ _he_thh->hh_next = _he_newbkt->hh_head; \ if (_he_newbkt->hh_head != NULL) { \ _he_newbkt->hh_head->hh_prev = _he_thh; \ } \ _he_newbkt->hh_head = _he_thh; \ _he_thh = _he_hh_nxt; \ } \ } \ uthash_free((tbl)->buckets, (tbl)->num_buckets * sizeof(struct UT_hash_bucket)); \ (tbl)->num_buckets *= 2U; \ (tbl)->log2_num_buckets++; \ (tbl)->buckets = _he_new_buckets; \ (tbl)->ineff_expands = ((tbl)->nonideal_items > ((tbl)->num_items >> 1)) ? \ ((tbl)->ineff_expands+1U) : 0U; \ if ((tbl)->ineff_expands > 1U) { \ (tbl)->noexpand = 1; \ uthash_noexpand_fyi(tbl); \ } \ uthash_expand_fyi(tbl); \ } \ } while (0) /* This is an adaptation of Simon Tatham's O(n log(n)) mergesort */ /* Note that HASH_SORT assumes the hash handle name to be hh. * HASH_SRT was added to allow the hash handle name to be passed in. */ #define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn) #define HASH_SRT(hh,head,cmpfcn) \ do { \ unsigned _hs_i; \ unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize; \ struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail; \ if (head != NULL) { \ _hs_insize = 1; \ _hs_looping = 1; \ _hs_list = &((head)->hh); \ while (_hs_looping != 0U) { \ _hs_p = _hs_list; \ _hs_list = NULL; \ _hs_tail = NULL; \ _hs_nmerges = 0; \ while (_hs_p != NULL) { \ _hs_nmerges++; \ _hs_q = _hs_p; \ _hs_psize = 0; \ for (_hs_i = 0; _hs_i < _hs_insize; ++_hs_i) { \ _hs_psize++; \ _hs_q = ((_hs_q->next != NULL) ? \ HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL); \ if (_hs_q == NULL) { \ break; \ } \ } \ _hs_qsize = _hs_insize; \ while ((_hs_psize != 0U) || ((_hs_qsize != 0U) && (_hs_q != NULL))) { \ if (_hs_psize == 0U) { \ _hs_e = _hs_q; \ _hs_q = ((_hs_q->next != NULL) ? \ HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL); \ _hs_qsize--; \ } else if ((_hs_qsize == 0U) || (_hs_q == NULL)) { \ _hs_e = _hs_p; \ if (_hs_p != NULL) { \ _hs_p = ((_hs_p->next != NULL) ? \ HH_FROM_ELMT((head)->hh.tbl, _hs_p->next) : NULL); \ } \ _hs_psize--; \ } else if ((cmpfcn( \ DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl, _hs_p)), \ DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl, _hs_q)) \ )) <= 0) { \ _hs_e = _hs_p; \ if (_hs_p != NULL) { \ _hs_p = ((_hs_p->next != NULL) ? \ HH_FROM_ELMT((head)->hh.tbl, _hs_p->next) : NULL); \ } \ _hs_psize--; \ } else { \ _hs_e = _hs_q; \ _hs_q = ((_hs_q->next != NULL) ? \ HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL); \ _hs_qsize--; \ } \ if ( _hs_tail != NULL ) { \ _hs_tail->next = ((_hs_e != NULL) ? \ ELMT_FROM_HH((head)->hh.tbl, _hs_e) : NULL); \ } else { \ _hs_list = _hs_e; \ } \ if (_hs_e != NULL) { \ _hs_e->prev = ((_hs_tail != NULL) ? \ ELMT_FROM_HH((head)->hh.tbl, _hs_tail) : NULL); \ } \ _hs_tail = _hs_e; \ } \ _hs_p = _hs_q; \ } \ if (_hs_tail != NULL) { \ _hs_tail->next = NULL; \ } \ if (_hs_nmerges <= 1U) { \ _hs_looping = 0; \ (head)->hh.tbl->tail = _hs_tail; \ DECLTYPE_ASSIGN(head, ELMT_FROM_HH((head)->hh.tbl, _hs_list)); \ } \ _hs_insize *= 2U; \ } \ HASH_FSCK(hh, head, "HASH_SRT"); \ } \ } while (0) /* This function selects items from one hash into another hash. * The end result is that the selected items have dual presence * in both hashes. There is no copy of the items made; rather * they are added into the new hash through a secondary hash * hash handle that must be present in the structure. */ #define HASH_SELECT(hh_dst, dst, hh_src, src, cond) \ do { \ unsigned _src_bkt, _dst_bkt; \ void *_last_elt = NULL, *_elt; \ UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL; \ ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst)); \ if ((src) != NULL) { \ for (_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) { \ for (_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head; \ _src_hh != NULL; \ _src_hh = _src_hh->hh_next) { \ _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh); \ if (cond(_elt)) { \ IF_HASH_NONFATAL_OOM( int _hs_oomed = 0; ) \ _dst_hh = (UT_hash_handle*)(void*)(((char*)_elt) + _dst_hho); \ _dst_hh->key = _src_hh->key; \ _dst_hh->keylen = _src_hh->keylen; \ _dst_hh->hashv = _src_hh->hashv; \ _dst_hh->prev = _last_elt; \ _dst_hh->next = NULL; \ if (_last_elt_hh != NULL) { \ _last_elt_hh->next = _elt; \ } \ if ((dst) == NULL) { \ DECLTYPE_ASSIGN(dst, _elt); \ HASH_MAKE_TABLE(hh_dst, dst, _hs_oomed); \ IF_HASH_NONFATAL_OOM( \ if (_hs_oomed) { \ uthash_nonfatal_oom(_elt); \ (dst) = NULL; \ continue; \ } \ ) \ } else { \ _dst_hh->tbl = (dst)->hh_dst.tbl; \ } \ HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt); \ HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt], hh_dst, _dst_hh, _hs_oomed); \ (dst)->hh_dst.tbl->num_items++; \ IF_HASH_NONFATAL_OOM( \ if (_hs_oomed) { \ HASH_ROLLBACK_BKT(hh_dst, dst, _dst_hh); \ HASH_DELETE_HH(hh_dst, dst, _dst_hh); \ _dst_hh->tbl = NULL; \ uthash_nonfatal_oom(_elt); \ continue; \ } \ ) \ HASH_BLOOM_ADD(_dst_hh->tbl, _dst_hh->hashv); \ _last_elt = _elt; \ _last_elt_hh = _dst_hh; \ } \ } \ } \ } \ HASH_FSCK(hh_dst, dst, "HASH_SELECT"); \ } while (0) #define HASH_CLEAR(hh,head) \ do { \ if ((head) != NULL) { \ HASH_BLOOM_FREE((head)->hh.tbl); \ uthash_free((head)->hh.tbl->buckets, \ (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket)); \ uthash_free((head)->hh.tbl, sizeof(UT_hash_table)); \ (head) = NULL; \ } \ } while (0) #define HASH_OVERHEAD(hh,head) \ (((head) != NULL) ? ( \ (size_t)(((head)->hh.tbl->num_items * sizeof(UT_hash_handle)) + \ ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket)) + \ sizeof(UT_hash_table) + \ (HASH_BLOOM_BYTELEN))) : 0U) #ifdef NO_DECLTYPE #define HASH_ITER(hh,head,el,tmp) \ for(((el)=(head)), ((*(char**)(&(tmp)))=(char*)((head!=NULL)?(head)->hh.next:NULL)); \ (el) != NULL; ((el)=(tmp)), ((*(char**)(&(tmp)))=(char*)((tmp!=NULL)?(tmp)->hh.next:NULL))) #else #define HASH_ITER(hh,head,el,tmp) \ for(((el)=(head)), ((tmp)=DECLTYPE(el)((head!=NULL)?(head)->hh.next:NULL)); \ (el) != NULL; ((el)=(tmp)), ((tmp)=DECLTYPE(el)((tmp!=NULL)?(tmp)->hh.next:NULL))) #endif /* obtain a count of items in the hash */ #define HASH_COUNT(head) HASH_CNT(hh,head) #define HASH_CNT(hh,head) ((head != NULL)?((head)->hh.tbl->num_items):0U) typedef struct UT_hash_bucket { struct UT_hash_handle *hh_head; unsigned count; /* expand_mult is normally set to 0. In this situation, the max chain length * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If * the bucket's chain exceeds this length, bucket expansion is triggered). * However, setting expand_mult to a non-zero value delays bucket expansion * (that would be triggered by additions to this particular bucket) * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH. * (The multiplier is simply expand_mult+1). The whole idea of this * multiplier is to reduce bucket expansions, since they are expensive, in * situations where we know that a particular bucket tends to be overused. * It is better to let its chain length grow to a longer yet-still-bounded * value, than to do an O(n) bucket expansion too often. */ unsigned expand_mult; } UT_hash_bucket; /* random signature used only to find hash tables in external analysis */ #define HASH_SIGNATURE 0xa0111fe1u #define HASH_BLOOM_SIGNATURE 0xb12220f2u typedef struct UT_hash_table { UT_hash_bucket *buckets; unsigned num_buckets, log2_num_buckets; unsigned num_items; struct UT_hash_handle *tail; /* tail hh in app order, for fast append */ ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */ /* in an ideal situation (all buckets used equally), no bucket would have * more than ceil(#items/#buckets) items. that's the ideal chain length. */ unsigned ideal_chain_maxlen; /* nonideal_items is the number of items in the hash whose chain position * exceeds the ideal chain maxlen. these items pay the penalty for an uneven * hash distribution; reaching them in a chain traversal takes >ideal steps */ unsigned nonideal_items; /* ineffective expands occur when a bucket doubling was performed, but * afterward, more than half the items in the hash had nonideal chain * positions. If this happens on two consecutive expansions we inhibit any * further expansion, as it's not helping; this happens when the hash * function isn't a good fit for the key domain. When expansion is inhibited * the hash will still work, albeit no longer in constant time. */ unsigned ineff_expands, noexpand; uint32_t signature; /* used only to find hash tables in external analysis */ #ifdef HASH_BLOOM uint32_t bloom_sig; /* used only to test bloom exists in external analysis */ uint8_t *bloom_bv; uint8_t bloom_nbits; #endif } UT_hash_table; typedef struct UT_hash_handle { struct UT_hash_table *tbl; void *prev; /* prev element in app order */ void *next; /* next element in app order */ struct UT_hash_handle *hh_prev; /* previous hh in bucket order */ struct UT_hash_handle *hh_next; /* next hh in bucket order */ const void *key; /* ptr to enclosing struct's key */ unsigned keylen; /* enclosing struct's key len */ unsigned hashv; /* result of hash-fcn(key) */ } UT_hash_handle; #endif /* UTHASH_H */ nvtop-3.0.2/manpage/000077500000000000000000000000001444130114000142625ustar00rootroot00000000000000nvtop-3.0.2/manpage/nvtop.in000066400000000000000000000075671444130114000157770ustar00rootroot00000000000000.\" Manpage for nvtop .\" Contact maxime.schmitt91@gmail.com .TH nvtop 1 "@TODAY_MANPAGE@" "Version @nvtop_VERSION_MAJOR@.@nvtop_VERSION_MINOR@.@nvtop_VERSION_PATCH@" "nvtop command" .SH NAME nvtop \- interactive GPU process viewer .SH SYNOPSIS .B nvtop \fR[\fB\-hv\fR] \fR[\fB\-d\fR \fIdelay\fR] .SH DESCRIPTION nvtop is a ncurses\-based GPU status viewer for AMD, Intel and NVIDIA GPUs. .SH COMMAND\-LINE OPTIONS .TP .BR \-d ", " \-\-delay =\fIdelay\fR Delay between updates, in tenths of seconds (\fIdelay\fR * 0.1s). .TP .BR \-h ", " \-\-help Print the help and exit. .TP .BR \-C ", " \-\-no\-color Monochrome mode. .TP .BR \-f ", " \-\-freedom\-unit Use fahrenheit as temperature scale. .TP .BR \-E ", " \-\-encode\-hide =\fIseconds\fR Modify the setting for the encode/decode auto-hide timer. Always visible if negative. Default to 30 seconds. .TP .BR \-r ", " \-\-reverse\-abs Reverse abscissa: switch the plot data order from "old --- recent" (default) to "recent --- old". .TP .BR \-p ", " \-\-no\-plot Show only one bar plot corresponding to the maximum of all GPUs. .TP .BR \-v ", " \-\-version Print the version and exit. .SH INTERACTIVE SETUP WINDOW .TP You can enter the setup utility by pressing \fBF2\fR to view and modify the following interface options: .TP .I General This section deals with general interface options. \fBColor support\fR and \fBinterface update interval\fR can be modified. .TP .I Devices This section deals with the devices display (top of the interface). You can \fBswitch the temperature scale to fahrenheit\fR and \fBset the encoder/decoder hiding timer\fR. .TP .I Chart This section deals with the line plots (middle of the interface). You can \fBreverse the plot direction\fR and \fBselect which metric is being shown in the plots\fR. .TP .I Processes This section deals with the process list (bottom of the interface). You can \fBselect the sort order\fR, \fBselect the metric by which to sort the processes by\fR and \fBselect which metric is displayed\fR. .SH INTERACTIVE COMMANDS .TP The following commands are available while in nvtop: .TP .BR Up Select (highlight) the previous process. .TP .BR Down Select (highlight) the next process. .TP .BR Left\ /\ Right Scroll in the process row. .TP .BR + Sort increasingly. .TP .BR - Sort decreasingly. .TP .BR F2 Enter the setup utility to modify the interface options. .TP .BR F12 Save the current interface options to persistent storage. See the \fBCONFIGURATION FILE\fR section. .TP .BR F9 "Kill" process: Select a signal to send to the highlighted process. .TP .BR F6 Sort: Select the field for sorting. The current sort field is highlighted inside the header bar. .TP .BR F10 ", " q ", " Esc Quit. .SH DYNAMIC METERS .TP When the video encoder (ENC) and decoder (DEC) of the GPU are in use, new percentage meters will appear next to the GPU utilization bar. They will disappear automatically after some time of inactivity (see option -E). .SH CONFIGURATION FILE .LP The configuration file follows the \fIXDG Base Directory Specification\fR and is stored at \fI$XDG_CONFIG_HOME/nvtop/interface.ini\fR. The location defaults to \fI$HOME/.config/nvtop/interface.ini\fR if the XDG location is not defined. .LP Do not edit this file. The file is automatically created or updated upon toggling the interface saving key \fBF12\fR. .LP The configuration is loaded during program initialization. If no configuration file is present, default options are used. .SH MEMORY SIZES .TP Memory sizes in nvtop are displayed as multiples of 1024 bytes or 1 KiB. .SH BUGS .TP .BR "Some fields are shown as N/A" Ask AMD or NVIDIA for better support of your hardware! If your card uses the AMDGPU driver, a more recent kernel might have improved support. .TP .BR "Compatibility issues" Does not work with nouveau driver stack and older NVIDIA GPU for the time being. Does not work for AMD graphics card using the old radeon driver. .SH AUTHOR Written by Maxime Schmitt. nvtop-3.0.2/screenshot/000077500000000000000000000000001444130114000150275ustar00rootroot00000000000000nvtop-3.0.2/screenshot/NVTOP_ex1.png000066400000000000000000001730011444130114000172220ustar00rootroot00000000000000‰PNG  IHDRzô·Ã…iCCPICC profile(‘}‘=HÃ@Å_SKU*VqÈP;Y'­B*”Z¡U“K?„& IŠ‹£àZpðc±êà⬫ƒ« ~€¸¹9)ºH‰ÿK -b<8îÇ»{»w€P/3ÕìTÍ2Ò‰¸˜Í­ˆÁWÐ.L#*1SŸM¥’ð_÷ðñõ.Ƴ¼Ïý9z”¼ÉŸH<ÃtÃ"^'žÜ´tÎûÄaV’âsâƒ.HüÈuÙå7ÎE‡ž62é9â0±Xlc¹YÉP‰'ˆ#ŠªQ¾uYá¼ÅY-WYóžü…¡¼¶¼ÄušCH`‹HA„Œ*6P†…­)&Ò´÷ð:þ¹drm€‘c¨?øüîÖ,Œ¹I¡8x±ía ¸ 4j¶ý}lÛÀÿ \i-¥L}’^ki‘# w¸¸niòp¹ <é’!9’Ÿ¦P(ïgôM9 ïè^u{kîãôÈPWÉààˆ){ÍãÝí½ý{¦Ùß³ÛrÁÙ,è<bKGDÿÿÿ ½§“ pHYs  šœtIMEå ipþ« IDATxÚìÝy\åþÿñ×Ü û&¸ š˜æ¾ ‰ŠY¦–¸§ç§é9Ùf–¥åñH’zJË=:Fj™ä7×ÒĽL2swK31—#àÆÎ½Íïê¶û Üâ©|žp_÷l×Ì\óž¹g®QêÔ©£"„B!„B!„⮥“*B!„B!„Bˆ»›\èB!„B!„Bˆ»œ\èB!„B!„Bˆ»œ\èB!„B!„Bˆ»œÞ××÷í;i†?ŠÕjÅd2±gÏÆÇåË—øôÓOíãÙµ«ôí’ë“C06nj2*¶Ë™˜¾]‡õÌ/×ë0¨®Ýú¡«yjÖUÌ?ìÀüÃvÜžŽ>¸>ŠÑPQÍf¬§¦àóù¶}µôiCÿª¹Ö$½0•m—¾æxö!:WíMçª}0Û íßϳå{*€7ü‡ƒ×ö°1}Õ]ƒxþ¾ÑÌ8¥mÚ-[2fÌš4iÀš5k˜6mV«Õþ€€LãÆ9uêü1yyyš/2¼ùæ›ôèÑNg_¿ùùùRwÿ¨=œ†žÍ0©&ŒŠ ©çØøÛr.œEAáµûÿÍÎËßrðÚn{]w¬Ú“9§'¡¢VÈ<8ÛþÿðÎ;ïЯ_?Z´hQ¦áo¤gϞ̞=ÛÞî|üñÇÄÅÅ9?ö{xpüøqf̘Áœ9s=z4ÿú׿hР&“Éþݬ¬,¶mÛÆ¹sçÆálÿý_¯¾ú*óæÍ«z¯Ò…®Õú`Ô¹*f[Ñ<“¾’ä«;nùúoÒ¤ cÇŽ¥yóæäååñÑG±lÙ² ÛþíŸÎ¦/¯ÿÊ_7wŒí;£oØÅh$oöä2D`ɯ’_%¿J~•ü*ùµtûgyë? €É“'BVV³fÍbãÆ릤òŠjß%¿–ýßèü¥<ù³¼ç?÷B~½mz >ŸõÌ)t5kãÖÿ9o_Lß]¡3¤š )\½ä¶W„1¼ºZuÈûð]Ð)¸=õ ÆÖÙ˜“wVØ4zõêÅG}Ä¥KŽ'»víÂÏÏ ðË/EæzõêáããCrr2/¼ð“&M¢°°É“‹ù—_~™½{÷Ò¬Y3þóŸÿP£F fÍš¥yø:uê`2™ðôô$00´´4ÍËöôÓO3bÄ¢¢¢Ø¿?5¢]»v¥ªŸ´´4ÂÃÃïÊ_‚JZþ… ²páÂëòäÉL›6uëÖa³ÙˆŒŒdüøñšƒ¨ªª¤¤¤`0nØ?ÿüó´lÙ’®]»¢Óéˆ'##ÃÞØ6jÔˆ¸¸8^{í5öíÛGPP<ð€æáq6~-ÛÏäÉ“Y´hµjÕbܸq¼ñÆŒ;¶ÂÖaá–¯0ïú®¨alÜ·§‡“;=Ìfôµ‚q{~$¦+1/û·/ÆÖN6K>* ܽ‚ÅBá7«*tûj[¥ô`ÕÅÏ8——B ·ZÔuoèðÃ×’H¸ø7GsŸ0¶_ÚH®5»ÔÓïܹ3óçÏg÷îÝÔªU‹åË—sæÌ–.]jo¯fÏžMll,ÿ÷ÿÇÃ?Ìܹsyþùç5À€´jÕŠ®]»¢ª*3fÌ`ذa|ðÁV‡ßf¬a÷å͸è\ ó{„§j`æ©hTT6¦Éßj>Ç‘¬½¨¨RSSÙ¾}»æá)iü¥­¿ .˜˜HµjÕnYÃh9qT:¿€¢yìö7LÛ6a>…Ø2£pÓj°Ù´°í“^1Qíÿ±2u)¹Ç1«&þ›ÿ+;/o*Õ2ËJæ‘€neª>ø€;v`µZ9wîßÿ=÷ÝwŸ½<::šI“&ñÝwß‘ÍÆñôô¤V­ZšÆÀ?ü@^^ùùùlÚ´‰ÀÀ@{ùûï¿Ï¤I“ìÿ¿ùæ›Ìœ9³LËb²ràênüŒ¸êŠÚS¹?‘nºHÛ*ñ ç²)”Üãņ}18ŠçîUêi:Û¿|}}™8qâ —KËðÎ.ôfff–}°X°X,Ô«W&MšpéÒ%ôz½½|Ù²e$''“œœLJJŠÃ±¬´ûoÿþýYµj•ÃE>ùäöìÙÃŽ;øôÓO‹Ýñ\·rýÛl6^|ñEvïÞÕj%99™m۶ѪU+ÍÛyöO-Ó¯4ëÿͯæc9ºë¯'oÙ1Qò«äWɯ’_%¿V¾üêlÿ,Oý»ººòÐC1wî\û¾5{ölû±ÆYyE´o’_Ë¿þovþRù³¼ç?÷úùKÅ_èýc奞‡ÂtՊ„Ë#š?HþüXrßÿ7¶s)¸õ¶è»—3°¥]ÀÐøú‚é6ÅöÛÔ«E·>çÿ_¹Ócȃ-í¿Å šâÚïiL›Ö;#†‚Ås‚wIÓ×rÓùWÚ~—‡º`l×ëo©èªV¯ÐÊ^µjO>ù$þþþÅÊ6®N:‘˜˜Xæi;vŒœœœRýêñGPÞ¼y3={öÔ<\½zõ0$%%Ýô;ǧwïÞôïߟ‡~˜}ûöñþûïkžÆÄ‰©^½:]ºtáñÇ'88˜ &8|ÇÏÏ9sæðã?Ò³gOž{î9û£3:ubÆŒL™2…°°0žþyŒFc…ÌŸ–å×âÝwßåµ×^ãÕW_eÊ”)¶Ý)ŠBpp0'OžäÅ_äÙgŸåĉÜÿýöï4mÚ”Ó§O3iÒ$V®\ÉÔ©Sí ™–á)iü¥©?EQ¨]»6ýû÷gÍš5·¬a4´ «Ûå ÐéÐש‡åÇe_yÚ§j®è=¿æý\®e:tmúuÀÓà]æíÈßߟ¾}ûÒ¶m[V¬Xa¹µjÕ²¯?EQxà¸råŠC˜.ɺuëèÓ§Ï<ó >>><ùä“å¼ýöÛtíÚ•¶mÛÒ´iSz÷îÍ;ï¼S¦åp×{ÐÞÿ12LiÚ®we°ñ·tªÚ‹G«ödcú—78Xê©áZ‹ ·:((¥šfIÛÿÞyç,XÀÅ‹Ë4|I|}} !>>žåË—3bćöOË…Šõë×Ó«W/žxâ ¾úê+<<<ìåO=õaaa„……ñÓO?•kÿíß¿±G²^{í5òòòxä‘GèØ±#ñññ\U„[¹þÿWpp°Cÿ]ζÿòìŸZ¦_ÙÖÿ=•_oɯ’_%¿J~•üZùòkEíÇ7ªN‡Á`À×÷ú?þø# 6ÔT^í›ä×ò+éü¥¼ù³¼ç?•áüå–\èPssP|ü0>Ôóæõ¨y¹˜voAW+\\0'ïÂÐêú­ò†Ví°ÐþëË#]1}ÿUQŸCªŠíÚÌI[íåΦ_r-èQ,t5ïCXÅlF5A©¸¢  €U«V1tèÐbe[¶l¡U«Vx{{ãîî΃>Xª_,näÒ¥KšÕ ¢J•*œ\`` Gµÿýñ‹›› àí·ß¶ÿ"?iÒ$þþ÷¿;„]V­ZŲe˸tégÏžµ—½òÊ+üç?ÿaïÞ½¨ªJjj*Ÿ}ö™½\Ëü•gùµøå—_ÈÌÌ$??Ÿ“'+îΣшN§£°°f͚ѴiS pssC§ÓÙë>**Š5kÖ0dÈ ìýwjÞ™’ƯµþÆÇÑ£GÙ¾};×®]cÛ¶mÚºtêgÔd<£&c mOþÂÁjEñô½5;«ìë 퓻ΓÛõ¾¾þVó9bÄÓ Ö!ô†ø†óïF³íÁ ÆcVM¼¶‡‡ª<^¦egóæÍLŸ>‰'rúôi è‘ÙãÇ‹~=nß¾=_~ù%Ï<ó þþþ¿š–$==½{÷Ò§O’““),,tx¬'++‹˜˜¦OŸÎ”)S?~Hù7q¿¾]êG¢JÚþ¡¨ÿ°€€–,YR¦áÙ´i ,`Ô¨Q¼ùæ›DDD­yxWWWÖ¬YCDD<ò›7o.õö£eÿ #==½XY¿ýö­Zµ"<<öìÙÃÏ?ÿ\¡ûÿ­\ÿÖ·o_,‹ÃoζÿòìŸZ¦_×ÿ=“_oɯ’_%¿J~•üZùòkE¸Yýççç³ÿ~† †§§'¡¡¡L:•êÕ«k*¿]í›ä×›svþRÞüYÞóŸÊpþRCyV¼| ûŠ›;Ч7.}á¢:i»6S!–ŸãÚóÉß_ˆaC\Ÿ‚• µ_‘¨Ž-íÂçCÃôKdµ@aŠ» Eó¤xû@nv©^ƦÅÇ̦M›øæ›o>ÏÊÊâÀtèГÉDrr2¹¹¹åšVµjÕøí7mo~îÞ½;5kÖ´ÿêåïïO÷îÝ5í¸ÿýï©Zµ*ƒ‹Åb¿€pôèQEÁÇLJ€€Þ}÷]‡ÛÙ/_¾Œ¯¯¯}9oÖÇYíÚµ)((pX–óçÏP«V-Μ9ãpAãFî¿ÿ~ûÁüi¿².¿Vݺu###ƒ   :vìXî¥?˜L&rrrðóó³÷ÑY½zu233±ýþèVff&111öÆgÞ¼yìÞ½WWW ïLIã×Zô‘£ÓéèÚµ+[¶l¡K—.¥L7­§­í}œ9^È«·/¶+¥ü½¼íÓs&^ztè±aeõÅ¢6jBÃ8õzý8ëã `Gæ7Œ¬ÿ6?e—þîŽ={öðàƒÄ´iÓ %..ŽÀÀ@û¾9mÚ4þö·¿qùòåö£x3ñññ¬^½š5kÖHLL S§Nu¸¹}ûvt:®®®lÙ²¥Ôóÿ]ÆZv_ÞÌ‹Áop>ÿ4×,Žé7õ%Çš…¯ÑŸžÍø%÷Çbãȱ–m[+iû÷óó#::šÞ´OCgû§3GŽáÈ‘#¤¤¤0}útf̘a¹’\¹r…«W¯Þ°+g´ì¿äË/‹ß0þ|²²²9r$Íš5cÏž=ÄÆÆrâĉ ;6ßÊõÿ‡fÍšͳÏ>ëÐvjÙþ˺j™~e\ÿ÷L~½$¿J~•ü*ùUòkåʯ¡¤|2räH¢¢¢Xºt)?þø#³fÍ"&&Æ>¬³òÛѾI~½±5j8=)oþ,ïùOe8)1–u@}­`¬éQ òQóó(Xö y³Þvø³]+ú…‹ËÑd -ÂÐ7m…åÇC`1kžžíÊ%tÕkÞ°LÓôÿ· èëÔ»¾|uêß4˜—Gff&k×®¥_¿~ÅÊyôÑGyôÑGËõØ@HHîîîö—c8Ó³gOžyæÂÃà gøðášKMMåâÅ‹ôèÑã†åYYY\»v—^zɾ|üiy#ñ… psss¸C£V­Z(Š¢ùÆçÏŸ¿é£å?g˯郘˜bcc™1c&LÐük²Ç§uëÖ¿<ýùÄáäÉ“4jÔÈá$áÏo¤u6¼3%¿´õg³ÙØ´i4hÐàÖ·’6Öó¿bhZ¦ÁËÛ>]3_&Ër…æ>–{Qr¬Y¾¶—ß²¿4&55• ðÄOØÛ4?¿¢;ã<<<¨V­-Z´¸áÛÛoÄËË‹víÚ±nÝ:û óøñãéÓ§Ã>ðâ‹/røða¬Vë ÛO­Óx4 îzÏ?õt«>€ÍkHL_EƒÐ)Åžo‡á*bûïÞ½;ƒU«V‘””Ć ðöö&))‰ÐÐPMûçüýýíë™ÒöŸ 0a¦M›VÎÝéÆû¯»»;:uâ믿¾á0Ÿþ9ƒ ¢]»v?~œ T`ºµë aÆÄÇÇ3zôh‡ÇÖ´nÿZ×ïÿîŸÎ¦_×ÿ½–_oɯ’_%¿J~•üZ¹ò«VeÍ'iii¼þúëôë×qãÆì°:+¿Õí›ä×›Órþ¢5ÞlûÑzþSYÏ_nÉ…^]`-\ÿß3˜v$BaQ1æ½Ûpíów{튻úûƒ‰eÿn -Ã0¶hù@éÞHgNÚŠK—^èk×-¿§.õßR-Ó/qü{·cìÔ\ÝPÜ=péÔóÛoI¥üñÇôéÓç¦A¹cÇŽ|÷Ýwe“&Mˆå£>"''Çé÷«W¯NãÆÙ¿¿ý³={öкuëöÇv£xÆŒLœ8‘‡~£ÑH«V­^6±páB&OžlÏ××—öíÛkZžüü|V¯^Í¿ÿýo\]]qsscüøñ|ùå—šû9ùì³Ï=z´½ð€€ÆŒct®<ó§eùyî¹ç8uêä›o¾!''‡§žzªÂ¶¹Å‹3jÔ(¼¼¼ðõõeäÈ‘,^¼Ø^ϨQ£ìýÞ >œ;wÚ-s6¼3%¿´õ§ÓéèÛ·/¾¾¾šOË«0q ÆŽÝ0„´E1º ó¯†Û ¡(U4¶/eoŸTTÓWÑ;ð)ê{6E¯è©í~?FK™–eÇ¥oháÓFó÷½½½™7oMš4AQ‚‚‚4hýÑ´sçÎQ¯^Ñd#GŽ$22’=z0eÊÒÓÓ‡÷œÒÓÓéß¿?F£½^ODD©©©öƒyƒ xá…˜8q"‘‘‘L˜0Aó‹2þ×¹üÎ䟢SÕëÚûw!£ð"çóOóSöL¶|Úø=êxqHÑ3êþIü³ÞÄR÷qUÒö¿páBûŠððpz÷îMvv6áááö:v¶þq²½yófIõóócþüù4nÜEQ¨Zµ*QQQ¬_¿¾ÔuwöìYÍ'nšn²ÿöèуmÛ¶‘——Wl˜˜˜BBBP…ÜÜ\Ξ=[ê;RKr«×‹-X¸p!‘‘‘ìÝ»·ÔÛIë×Ùþélú•mýß‹ùõv’ü*ùUò«äWɯ•'¿jý±§¬ù¤C‡önBCC1b³gÏÖ\~«Û·Êž_K¢åüEKþ¼Ùö£õü§2Ÿ¿8Ý7Kóe·ACA5ë*æ=ßcN¾Þdžùû¨…x¼ð/0P ò0%m…_¯oM»Š‚âáUô2ŒR°;:=®}ŸBñôBÍË-ºû{ei™¾³ñ+¾Uðý{0߆åÄÑ[Réééé|óÍ7DDD8|~á®]»†Ùl&--Í¡lÁ‚´iÓwwwTUåïÿ;»víâ•W^±gîܹ¨ªJZZŸ~ú)Ÿþ¹¦á»wïÎîÝ»îðÊÍÍåСCtëÖÍa<7³víZÌf3cÇŽ¥^½zœ9s†qãÆÙßôþÁ““Ã_|‹‹ YYY|öÙgšßâ9aÂÆŽËÖ­[¢GܦOŸ®¹Î7lØ€Á``Ú´ipåÊ-Zd_æòΟ³å/‰¯¯/¯½öƒ ²6yòd>ùäÖ¬Y£é1ƒY³fŽ««+>>>öG;wîL~~>6l ((ˆ 6ØOþÜOMRRqqq,]ºwwwŽ;Ƙ1cꯤáq6~-õCdd$?ÿü3C† ©°ÇÞœ†…ó¿R°x..]ŸÀµ÷@ÔkW0ïÛ‰zåRQÛøôpôÁõQŒ.€Š¡õCXOÿLÁçó+¤}:œµ«j¡[õþTs©Á%S:kÓ–8<ŠâNSoÇ»6¦ŸŠÂds<f[®ñSöšxi»Ã#;;›Õ«WóÖ[oQ·n] ‰‰‰öGÛ~ûí7ôz=uêÔ!))©L/u2dãÇ'22‹ÅBJJнCƒÁÀþó¦L™Â¥K—¸té³gÏfÖ¬Y 4¨LÌo3VñJð›ì¾ô&µ€GzîúÛb7þö%ƒk¿ÊákIöþ嬪•tÓE¬ª¥Ô}\9Ûþ+bx‹Å©S§0™LurõêUÖ¯_Ïĉ©S§ªª’Pª>®*‚³ýwàÀ7}ÐÎ;=z´}û»xñ"#FŒ¨ùr×{ÜÒõo0øâ‹/P…?üW×¢~ óòòh×®ÓíßÙúu¶j™~eXÿ÷r~u𺺠P FpsÇcLQ—,ùLB5WìK?$¿J~•ü*ùUòkåɯÎöÏòä(êÞæ­·ÞÂ××—‹/2räH‡»>•ßÊö­²çW­ë¿<ù·¤í§"Οîåó-”:uêÜþ^¹ïQz½žíÛ·k~äCQñvíÚ%ûàmÖ¦MÆŒðaøví:Žûî»Ïá…2BÜLíÚµY²d :u’Êõ/$¿ !ùUH~’_„¬ÿr0È*ªXUªTá½÷ÞŠ^€³hÑ"©!n±¡C‡Ò¤IÍ}”ŠŠ³oß>fΜiœJ§Ó±zõj ÊB“ !ë_H~Bò«ü*$¿Yÿå$wô !„B!„B!Ä]N'U „B!„B!„w7¹Ð+„B!„B!„w9¹Ð+„B!„B!„w9¹Ð+„B!„B!„w9¹Ð+„B!„B!„w9¹Ð+„â®Ò®];zôè!!„B!$¿ !ÄŸJõå­1>ôúj5°e¤aÚ¶ ˉ#¸>9cã¨& b»œ‰éÛuXÏü€çø÷Éûxjf::ÿj¸&wòMÓöññá…^ K—.¸¹¹áPÞ³gOfÏžMAAý³?þ˜¸¸8MÃët:Þ|óMzôèN§cÏž=Œ7Žüü|<<<8~ü83fÌ`Μ9Œ=šýë_4hГÉÄO?ýDïÞ½9}ú4Mš4aÅŠ´hÑ¢Ü+IqqÅsÂû˜¾]‡iû&\ºôÂ¥sOrÞV .ºãÒ©'ªÙdNÍÏ%ïý·4 _ï¼óýúõsX6NGdd$ýúõÃf³‘@\\ªªj*ÿãàC:uÈÈÈ`þüù¬\¹ò/¯c»Gqy¼OѺ0º*ªÙ €iÓjÌÉ»Ê]ÿÎöŸŠdìÓ}Hï&Ú?Ó7«‰qP(ªÙjÿ̺#ËÖSöÿ7nÌK/½„ªª,Y²„C‡9Œ·E‹ÄÄÄмysÒÒÒX¼x1‹/Ö4Oú:õp1µ°ÀáóüÙ“±]»bÿßcx4ªÅBþüX‡ïyŽŽùÐ^L߬*ÚÞª×ÄíÙWÉ{o|…ÔY“&M;v,Í›7'//>úˆeË–P¥JvíÚå¸N€ãÇ;¾³íCÑéqéúú¾È IDAT­Qóá0}·l6<†Å|0 sÒVÇí ìa ¡íŠÕeE׳öµ,^}õUæÍ›§ùûÎÚ-óï¬ýº™¯¾úŠ/¿ü’Ï>ûÌáó§žzŠþýûÓ¿I"BÜê°{ç×€€&OžLHHYYYÌš5‹7jnŸZ¶lɘ1cìÇ”5kÖ0mÚ4¬V«äW'õ£åøä¬ý/iýH~-?]-_ô7Bè€íð̉'ÀöûñWQ0toŒ¾YMPl§31¯;ʳ•9¿:ÛþK*¯^½ú=Ÿ_ß:k¿%¿ !îú ½Æ¶àòH«—`=}õ tupøNá–¯0ïú®hÄ[âöôpr§GÃï¡¢øà®\¹B¯^½ìA­{÷îdggß¶¥æåbhþ =hš† 8^$1ÞGáêÅe^‹Ž;R¿~ýbŸ?ÿüó´lÙ’®]»¢Óéˆ'##Ã~°qVÞ¨Q#âââxíµ×Ø·oAAA<ðÀõí믬óÞm˜÷n+ ,½‚ÅBáï¬"ëÿVî?öþÕPªz/p7`=’Šyå¡›ûä“O2mÚ4 £GvÊ!!!,Y²„I“&1lØ0jÔ¨Á Aƒ0 X,Ú~H°e]-1ØêªTEµXP\\Q|üP³®:6fÍļ#57§B׿N§ãõ×_gÞ¼yìÝ»—ÐÐP-ZÄñãÇ9xð W®\¡iÓ¦üùæ›äææ’““Ã+¯¼ÂòåËY»v-[·n%!!///bcc‰ŽŽÖ<%m.=û£«DÁüXTEÁíÉ!¸víKá¦ÕX3Cçç_üÜ×Û¥ô[^?ZÚ×Ò¨Y³&õêÕc÷îÝrüÐ2ÿÎÚ¯’œ>}šZµjÝp9Μ9#)Dˆ[ìNϯ±±±8p€W^y…   –-[FZZÔÔ>uîÜ™ùóç³{÷njÕªÅòåË9sæ K—.•üª¡~œŸJjÿµ¬ɯåÌ «cÝuóéK(~î¸ mþR.Ö}çŠ.´>X]m?LqÛPU0þ­%†‡ëaùþ—JŸ_µlÿ%•?ûì³÷t~Õr~ë¬ý–ü*„¸SiëºAoÀåñ'(HX„õôÏ`6c½pÖÞh߈åÄPmèü*dF³³³Y¿~={öì¹a¹™™™e> €~ø¼¼<òóóÙ´i×—ÇbÁb±P¯^=š4iÂ¥K—Ðëõšçÿõ×_'99ÙþwòäÉ›ÎËS„ÕjEWµºÀZEa@§»}þ¾¾Lœ8‘™3g+}:G-Ó<ýyûP<½0¶~ˆÂµË°]»‚zõ2…k–bh×\ÝP/e øV)ZÍýã6øå¢ ìSÛ¥ŒÛR?ÎÚ×Òèß¿?«V­Òt7‚–ö_Ëü;k¿Jò믿ÀôéÓ‰— ,Äír‡çWWWWzè!æÎkÏ>³gÏfذašÛ§>ø€;v`µZ9wîßÿ=÷ÝwŸäWõãìøTRû¯eýH~-Ë÷¿`;• 6õr¶“é(U<®_ôótÁvæ2ªÉ f+¶ãi(>n’_5nÿ%•ßëùUËù­³ë’_…wõ…^]Õ ×—ê1CË0°Z±]θ- âëëKHHñññ,_¾œ#F`45¿nÝ:úôéÃ3Ï<ƒO>ù$+W®´—{xx°~ýzzõêÅO<ÁW_}…‡‡‡æñÇÆÆFXXƒ "//ýë_ÚÐèŠõØ~ ÍC1´Ãr슋ë힢GZ,XÀÅ‹>W…àà`Nž<É‹/¾È³Ï>ˉ'¸ÿþû5•4mÚ”Ó§O3iÒ$V®\ÉÔ©S©V­ÚSÿåUÊú¿û±w3l{Π^+~'ŒâfD©í‹qp.CÛcèXôŠÃwŽ?NTTQQQ8pàz€Õëiݺ5_}õÕ-­BCÓVXNÅrâ(†f¡ÅÃã¡0<ØÅÓë–¯Îàà`N:uò¨¨(>øàûcq‡¦W¯^4oÞ³ÙŒ——‰‰‰lÛ¶­ìuñ§íCW½&¶Ü‡»liPX€¾j lº#BT]Íû@QÐùú¡^ɼ-õã¬}-mP.ë°e™-íWIþ|GD‹-hÞ¼9Š¢P³fMΞ=+)Dˆ[rïðüªÓé0 øúúÚ?ûñÇiذa©Ž?Š¢àïïOß¾}iÛ¶-+V¬üª±~J:>•¥ýÿßõ#ùµ(Etõ!µÐûc=pÞ^d=’оE†vÁàfDÿà}XþWò«Æí¿¤òÊ’_ov~[Ñ$¿ !n'M]7(î𧾇Üú Fߨ9y³§ æ=‚äÒ©.u)j¨ÓÓÈ_ø!X­·eA6mÚÄÑ£GÙ±cÄÆÆâïïϻᆱiøôôtöîÝKŸ>}˜0a[·nµ?öEw]¬Y³†  ( C‡eÊ”)ãHLLÄf³ÙÃûúŸôöö&>>žØØXöîÝ[Š5eÀ|xnO¿‚¢(ä/ù×'þáø•6¢`ñ¬gS4_’>}úÀ’%K¨Q£†c4ÑétÒ¬Y3 Y¶lnnnö“˜’Êm6DEEñî»ï2sæL"##‰‹‹ãÿøÇQÿZVQ9ëÿVî?úA(^®˜8‹âíV¬Üv< [ê5l§2P|Ü0öÁèéŠyãONÇ]µjUŒF#ééå{ŒJçã‡ç¸÷ìÿ›¶n´ßu¥ó­‚âá…-ýbQÈ ¨†âåšsýñGÕbÂrh/Æö±I¾emMß¾}±X,Åúå…¢¾²jÖ¬ÉÖ­[ퟭX±‚—_~™§Ÿ~šþóŸøúúÒ¶m[ªU«ÆÂ… íÛ¬37Û>/ÈË-ö}57ÅÇõrÑŠ·ªÕ‚’›®j ß*¨üèÛÍêÇYûªUXXéééœ;wî¶­_g훳õwæÌ‚‚‚¨^½:f³™ÌÌLxà¹#BˆÛàNϯùùùìß¿ŸaÆGÆ yë­·¨^½z©Ž?áááÌ™3^zé%{¯’_×OIǧҶÿ7Z?’_ËOW7ãßCÁÅ€yi2jæõÌ£f`;s ]‹š¸õhŠõd:¶óW5·²ä×’¶ÿ’Ê+C~-éü¶"I~BÜ‘zmW/§wÑ£:6kŠúõñ÷ü馿?ØŠ·Ú6ž?VPuJ…†€#GŽpäHÑ‹5RRR˜>}:3fÌÐ|¡7>>žÕ«W³f͉‰‰aêÔ©}eddpåÊ®^½zÃþµ"""нLÁ!ètÄÅÅñÃ?hîäß¡ s²PórQóóN\þ`)¡--ÃßL5ˆŽŽfàÀ7|ÜÄd2‘““ƒŸŸŸ½äêÕ«“™™‰ÍfsZ™™ILL ?ÿü3óæÍc÷îݸººÞ1õïLyë¿Äý§<'ºÞn"aŠO‚›<-d»p .\+šÏÌ\,‰?cü[KÐp¡733³ÙL5Ê`JêãLß´:_?<ÆíÏŠ§†¦­0ÿ°Ã±w~‹Ç«ã°ütø–4˜Íš5#::šgŸ}ö†é±Ç+vnµZ™;w.:t 33“åË—ÉàÁƒéß¿?_~ù¥¦ißlûP³³À£x¿ËЧ7jÖUl—2P¼|Ð×kŒ-íBQ}?€âí‡íræm©-í«Ô\_5ÿZÚ¯’œ>}šjժѡCû‹KÚ´iC`` Ü!Ä-v7äב#GÅÒ¥KùñÇ™5k111¥:þìÙ³‡|   ¦M›Fhh¨ýeÄ•9¿j©Ÿ’ŽO¥iÿKZ?’_˹ÿz‰Â©›Q|Ý1ôk®¶ŸýeÁÆÁaØ_Àº*ÅÇ C·Æû¶À¼æˆäWíÃÍÊïõüêìü¶"I~BÜnšºnP¯]¬«7|ÜDsÈ»vÙÞÏ€Þ/õÚå[ºpZûWòòò¢]»v¬[·€´´4ÆOŸ>}Šõ£5a¦M›V¦ù‰ŒŒÄÏÏñãËþ&UÓ†˜×ÜÖá»wïŽÁ``ÕªU$%%±aü½½IJJ"4´h›8~ü8­[·¶æð6Vgå'Ož¤Q£Föÿ/_¾lôýNªÿò*ïú+ÓNÞ¬è\†µÇ5ª .#W#®Q]Pîó+!¹j =V«•ƒÒ«W¯[¶ †f¡ä/œCÞ{ãÉ{o<_Äß°=Rs²±Ù‡!¤M…ÏCÆ ‰gôèÑ7í¶¡mÛ¶7¼SõÑGeРAØl6l6'Nœà믿&$$¤ü'@é©è<½ŠQþcW¯ ..X3~C-ÈGÍËAß°)¶s§±?îþÀf):i»ÅõSšöµ$îîîtêÔ‰¯¿þú–lc%­_gíWI²²²¸rå ;w&99™ýû÷ŽÙlæÚµk’B„¸…î†üš––Æë¯¿N¿~ý7nÁÁÁÅÚ-Ç(êãwÁ‚<ñÄw\~ú+ò«³úÑr|ÒÒþkY?’_+bÎǶç ú–¿¿ ÊÕ€îþ¬GйW³ 0¯?†®EMÐ)’_KÑ>ܬü^ίZÎo+‚äW!Ä_AÛÛ T•Âo×âÚk úúA¯G_».J)úÀµœ8ŠKÇO¯¢Î×;vÃrâh…,„ŸŸóçϧqãÆ(ŠBÕªU‰ŠŠbýúõš†ÏÉÉ!==þýûc4ÑëõDDDššZìbãÙ³gIMM-õ<öèу'Ÿ|’aÆa.Ç[hm—3°]»r[‡_¸p!áááö¿Þ½{“Mxx¸ý¢ÖâÅ‹5j^^^øúú2räH‡»œ•ÇÇÇ3jÔ({¿¼Ã‡gçÎÞQõ_îPSÎõWÖ¤³ÎÜbÿ3ÍÝ …f gnA=Å݈qpktÞEw8y¹`èÚëQíõèja=—r}™~=‰î¾z7ìÏÌ´ó[Œ-ZWh¶hÑ‚… Yâ#“uêÔ)ÖÇWûöí=z4cÇŽ%//???t:uëÖ-÷ã‚PôFlsò.\ŸøŠ·/:ß*¸ö}ªèMÛ¦¢ýÇv)Ãý ±ž;õܯîoˆ-3ý¶ÔOiÚWgûð¶mÛÈËË«ð}ÄÙúuÖ~9ó믿ÎþýûíAù×_•"Ä-¿2tgçW€:PôâªÐÐPFŒa™§³öÉÛÛ›yóæÑ¤IE!((ˆAƒÝðÇʘ_Ֆ㓳ö_k>üZn\žjò{>U|Ýѵ®í¿¿wÍPhìBô¡µŠÞ+¡SÐ7 „kšoV¸—ó«³íßYù½ž_µœßVɯBˆ¿‚Aë-G’ÁjÅ5¢/ºª5°]Ê pÝ} •ļmJÏxŒœP4¾ŸaÚù­æ5kááḺºâããCRR;wæêÕ«¬_¿ž‰'R§NTU%!!Áá±”’†ÏÏÏgÈ!Œ?žÈÈH, )))ö·—;§¸¹ Pìâóã?NNNN…LÇÒCSÇ_XófŽ»-Ò†  bÆ |öÙglÞ¼YsyRRqqq,]ºwwwŽ;Ƙ1c¤þoÇyp¾ÛÑ‹z5Cñ÷¬‡þ‹õûSšÇqàÀž{î9¢££yçwHMMeéÒ¥œ?¾üTÓVXOŸ„?=f¤b»pC“ÌÉŽ]%¨ÙYX~:„¾qËŠi$ ¾øâ EáÃ?´w'’——G»ví¾[½zu._v¼Ó+--W_}ÕðâââX±bV«•#FTÈ<š6®Â%¢/î/Gµ¯‡À´ùú¶nËüí÷vû÷p¬7 ^¹tÛê§"Ú×òþûï—iKjÿÍf³ÓùwÖ~9súôiêׯoÇ...·´Ÿ6!ÄÝ‘_óóó©]»6o½õ¾¾¾\¼x‘‘#GÚïÊrÖ¾fgg³zõjÞzë-êÖ­‹Á` 11‘É“'K~MõãìøTRû_š| ùµ ,X]ÀøG>Õë°ÿ Ë7×ïH4-úc¦kVjf.¦eÚû¹½—ó«³íßYù½ž_+¢ý–ü*„¸S)uêÔQ¥„BÜ©j׮͒%KèÔ©“T†B!„ü*„7¡“*Bq'0` RB!„Bò«B”@îèB!„B!„Bˆ»œÜÑ+„B!„B!„w9¹Ð+„B!„B!„w9¹Ð+„B!„B!„w9¹Ð+„B!„B!„w9¹Ð+„B!„B!„w9Ã43:Ž3fØÿ?rä‹-rœá. À–­¿ÜxÊY.„¥5tèPš4i€ªªDEEÝqóx;ÚW!DÙ²nÝ:ÆObbâM¿×®];üýýÙ¸qc¥X~i_ïr!$ßݹí’o$ßTÖ|s¯?Ju¡×Т5ƇC_­¶Œ4LÛ6a9q×'‡`lÜÕdTl—31}»뙢 õÿ>yOCÍL/Úhü«á><šÜÉcìãW…öíÛÓ¡Ci…·M@@“'O&$$„¬¬,fÍšeÕ«WçÃ?D§ÓñÅ_`o¸?ΧŸ~j×®]»J5mÅÅÏ ïcúv¦í›péÒ —Î=Éy{X-¸têŽK§ž¨f“}85?—¼÷ßÒ4¼´¯â^¦Ó鈌Œ¤_¿~Øl6ˆ‹‹CUUM÷lÙ’1cÆØ÷é5kÖ0mÚ4¬V+={ödöìÙ؇ùøã‰‹‹Ó<ý>}úðÒK/Q¿~}~ùåæÌ™Ã·ß~ë0YYYlÛ¶sçΕ8¿¯¾ú*óæÍ³ÿïlþÊÓþi©gåå]þò´¯’_…¸·5iÒ„±cÇÒ¼ysòòòøè£X¶lY±‹G111Ô©S‡ŒŒ æÏŸÏÊ•+%߉{>ßøøøð /Ð¥KÜÜ܈ˆˆ¸éwßyçúõëG‹-4çƒ{=ß”Ô~Ü ù¦¤öÀsìṫöbúfUÑöT½&nϾJÞ{ã¯ocAupíÖ]ÍûP³®bþaæ¶WŽ|ãé‚Ë-Pjû¡æ›°|ÿ ¶Ó®×M †nÑÕôE5Y°ìHÁºïÜm¹>P4_è5¶}—G"(X½ëùÓè«¡«û€Ãw ·|…y×wE#nÜ·§‡“;=Ìfi©…w¬ØØX8À+¯¼BPPË–-#--ƒòì³Ï²|ùrÖ®]ËÖ­[IHHÀËË‹ØØX¢££+dúj^.†æÚƒ¼¡ijA¾Ãẇ÷Q¸zq™‡â^õüóÏÓ²eKºvíŠN§#>>žŒŒŒb'û7Ó¹sgæÏŸÏîÝ»©U«Ë—/çÌ™3,]ºÔ~¢´víZF]¦é?ýôÓŒ1‚¨¨(öïßO£Fh×®]±ñäåå9ýµ¿fÍšÔ«WÝ»w;œÈ•4åiÿ´Ô³òŠ\þ²ü*Ľ{ìõ×_gÞ¼yìÝ»—ÐÐP-ZÄñãÇííW£Fˆ‹‹ãµ×^cß¾}ñÀEû¿ä;q¯çUUIIIÁ`0”x‘·cÇŽÔ¯_¿Ôùà^Ï7%µwB¾qÖ~š?ˆyG"jnN±2}­`Üž‰iãJÌË>Aç틱õC ÓÍvÏï_.ý[a;wËçûQ|Ý1i‡9«õüUPô5IJ#Û™Ëèjûáò|;liY¨ç¯Þ–ãG¹‘š¾¥7àòø$,Âzúg0›±^8kÅ7b9qT:¿i¥…w,WWWzè!æÎ @jj*³gÏfذaT­Z•óçÏcµZÉÍÍÅÅÅ…)S¦0}útŽ=Z13a³¢Z­èªÖ@X«è`¬Óݾᅸ‹ <˜÷Þ{üü|rss‰eðàÁš‡ÿàƒرcV«•sçÎñý÷ßsß}÷9œhdff–iú...¼ñÆDFF²k×. 8|ø0Ÿ|ò‰}øeË–‘œœLrr2)))téÒå¦Óêß¿?«V­r¸›ÇÙü•§ýÓR?%•Wôò—šäW!îY6›_|‘Ý»wcµZINNfÛ¶m´jÕÊþ‘#GǾ}ûìmÜöíÛ%߉J‘o²³³Y¿~={öì¹éw|}}™8q"3gÎ,U>¨ ù¦¤öã/Ï7YŽÀ¥Ãã7,séö7LÛ6a>…Ø2£pÓêJq‘ƒ]½,ÛSP¯åcÝv ÃÃõŠÊUóÒdl§/MÅvî Ö_ÒÑÕö»}ÇrÒt¤ÐU­z½ý16Mu×2 ¬Vl—3¤•Bܱt:ƒ___ûg?þø# 6àðáÃôêÕ‹æÍ›c6›ñòò"11‘mÛ¶UÜL]±Û¡y(†aXŽ@qq½}à q—R…àà`Nž<É‹/¾È³Ï>ˉ'¸ÿþûK=úöíKÛ¶mY±b…ÃIPHHñññ,_¾œ#F`45M¿^½zF’’’n:í§žzа°0ÂÂÂøé§ŸJœÏþýû;<2èlþÊÛþi©Ÿ’Ê+zùKݾK~¢R æÔ©Söÿ›6mÊéÓ§™4i+W®dêÔ©T«VMò¨4ùÆ™wÞy‡ pñâÅRåƒÊoJj?þê|£•åÐlâéõ¿„¾N=,?¨¬;èp¿¾=Ù.^CWÝûæÛ”¿'jFÎí;~”7kªw(¼Þ7Š[¿ÁxFOÅ3z*ŠçõÊpéÔϨÉxFMÆÚžü…Ÿú8Bˆ;M~~>û÷ïgذaxzzÊÔ©S©^½:+V¬ ==§Ÿ~šþóŸøúúÒ¶m[† ‚®¢îª00Þ‡¾qK 4Ær¢ø/†6xŽßþ§®_ªá…¸Ft:………4kÖŒ¦M›RPP€››[©öÏððp6oÞÌôéÓ™8q"§OŸ¶—mÚ´‰ 0jÔ(Þ|óM"""ìe9›¾ŸŸÙÙÙöqMŸ>Ý~wG@@éî #==½Xo%Í_yÛ?-õSRyE.™r¼äW!*¾}ûb±XúB $**Š5kÖ0dÈ ìý{J¾•!ß”¤OŸ>°dÉ’RçƒÊoJj?þê|£©ýT‹ Ë¡½ÛwvÌGžÞ ×£fgUÎÌlÅvîJѼ.z”ûü0ömâ}ãÒô!µP­6l)—nßñ£œ4Í…íê%ðô¶?*R°f)¹ÓcÀ`åú÷L[7’;s¹3Ç‘¿ðClÿû§­Ì†¢Ó_ÿW§HˆBÜFŽIÕªUYºt) `Ö¬Y¤¦¦`µZ™;w.ëׯ'33“9sæ°lÙ2êÕ«Gÿþý+lÔœ,Ô¼\l™é&þ`9¼Üw#íÖ³)¥^ˆ{‘Éd"''???FÍØ±cñ÷÷'33[)=Û³g>ø ]ºtᥗ^âŸÿü§½ìÈ‘#|óÍ7äææ’’’ÂôéÓéÖ­›¦éÿ÷¿ÿ¥jÕª E¯DˆŽŽ&,, WWWE)Õ²8/¿ü²Øç%Í_yÛ?-õSRyE.YH~¢rhÖ¬ÑÑÑDFF:´ý™™™ÄÄÄpàÀ²³³™7oíÚµÃÕÕUò¨ùæfjÔ¨Att4QQQ7}¹[Iù 2ä›’Ú¿:ßhm?L;¿ÅغCQöù£]ÉÍ«·o¥ÝÇÌ+¢x¹â2¤úÐÚX¶ü‚íjñ>Еš>º6œp~ßWn×ñ£<4]èU¯]¬«š…–ý wí2Šoûÿz¿Ôk—¥BüåÒÒÒxýõ×éׯãÆ#88˜ãÇÛË}ôQ „ÍfÃf³qâÄ ¾þúkBBB*6ÔmX)qÍ_6¼w£ãÇÓºukûÿaaaûïüýýñóó+q\©©©,X°€'žx¢ä`m±hš~jj*/^¤GåZFwww:uêÄ×_­-øÿiþœ-¿³ö¯4õó¿åµüeÏž’_…¸×5lØøøxFíÐmÀÉ“'iÔ¨‘ýÿË—/cýÓ5’ïDeÉ7ÿ«{÷î V­ZERR6lÀÛÛ›¤¤$BCCæƒÊoJj?þê|Sª““åÈ> !m®h³a=ÿ+†æ¡•vÿR³ 0'Æ4o7–uÇP~”•¶ûŠU•Âo×âÚk úúA¯G_».ŠÆ>R,'ŽâÒ1ÅÓ ÅÓ cÇnòø‰âŽÐ¡Cûc6¡¡¡Œ1‚Ù³gо}{û/éyyyøùù¡Óé¨[·.ééé:¶ËØ®]ùˆân´xñbF…——¾¾¾Œ9’Å‹ß@l0ؼy3‰‰‰Ty{{3oÞ<š4i‚¢(1hÐ û™ýüü˜?>7FQªV­JTTë×ûìxç IDAT¯×4}›ÍÆŒ3˜8q"?ü0F£‘V­ZáææVªeìÑ£Û¶m#//Ïás-óWÒò;kÿœÕ³òŠZþ²§xɯBÜËZ´hÁÂ… ‰ŒŒdïÞ½ÅÊããã5j”½_ÍádzsçN %߉{:ß8³páBÂÃÃí½{÷&;;›ððpû1¼¤|p¯çgíÇ_žoJÉ´ó[Œ-Z;|V˜¸cÇnBÚ¢]ÐùWÃmÐP”*•ãe´ºúUQ<‹ºjÐÝWCǰl½þc¡.È—çÚb^yÛ™KÃÞÎãGY4Ý#É`µâÑ]ÕØ.eP¸î ÔœlMÛ·mBé9‘ŠÆ÷Ó!L;¿•\ñ—«]»6o½õ¾¾¾\¼x‘‘#GÚï IKKãÕW_µ¸¸8V¬XÕjeĈ·m!m04uü…0oæ8Yy¢ÒÛ°aAAAlذ€Ï>ûŒÍ›7;f‹…S§Na2™yÌÎÎfõêÕ¼õÖ[Ô­[ƒÁ@bb"“'OàêÕ«¬_¿ž‰'R§NTU%!!ÁÞG›–é¯]»³ÙÌØ±c©W¯gΜaܸq¥z“ôÀyÿý÷‹}®eþJZ~gퟳúqV^QË_’_…¸7 ¾øâ EáÃ?ÄÕµè„=//víÚ””D\\K—.ÅÝÝcÇŽ1fÌÉwâžÏ7³fÍ"<<WWW|||ì/ëܹ3ùùùå:?º×ó³öãNÈ7%µª©Ðá35; ËO‡Ð7niÿÌvþW ÏÅ¥ë¸öˆzí æ};Q¯\ªû—â玡gSw#êµ|Ì+^¿kW§à240 E1ýˆ š¬ÎøîŽ9~”¸|uêÔQï”ÊÖëõlß¾:Üü Þ¥ØÀ²õ—[R.„å±k×®Û°{¹}BT¼Úµk³dÉ:uê$ík%n_ïör!¤ý¹sÛ!$ßHûRYóͽº~ wÚÆT¥JÞ{ï= ¨îE‹I+(„¸£ :”&Mš”º,i_…%0` Ò¾Jû*„öGÚ!ùFÚi_dý:uGÝÑ«…Üq „wfû*„â¯É¯rÇŒ¢¬íBTÖ|s¯ºë.ô*Õ¼@UQ3soI¹BTVÒ~ !ÄÝ™_ïôr!ÄÛþ!DeÍ7÷ìz¹Û.ô !„B!„B!„p¤“*B!„B!„Bˆ»›\èB!„B!„Bˆ»œ\èB!„B!„Bˆ»œ\èB!„B!„Bˆ»œ\èB!„B!„Bˆ»œ\èB!„B!„Bˆ»œ\èB!„B!„Bˆ»œ\èB!„B!„Bˆ»œá¯˜èÙ³g¥æ…B!„·Mppð_6m9ÿB!ÄíÈ7†;eF„B!„âV¸.´ÊùB!nu¾‘®„B!„B!„â.'z…B!„B!„â.'z…B!„B!„â.'z…B!„B!„â.'z…B!„B!„â.'z…B!þ?{wnW]ß‹ÿ½öÞgÈ<‡$@2% dG&Á‚Ö¡•b[ÛÒ{ÛZA(Ôþ*Þßµ†_Õ ý)ê­JzÅRÑAIPŠ"32Èd‚ÂÈ< çœ}ö¾<Ðä„ œ•¼^Ï“ç9{¯a¯ýYk¯¬Ïû¬ý=%'è(9A/@É zJNÐ Pr‚^€’ô”\íW? ><ög–“N:)ííí9õÔS7™±R©ä¼óÎËûßÿþ4\}õÕ¹ôÒKÓl6û5½_sØQiyËÉ©ŽÛ#¥/¤ëÖRtN’¤íŒ?MËÔÃÒìêJÒLcŲtýxVzžz,I2äÂÎú¯~6ÍeKz·gô¸ ú«OdÝEç÷®¼(ÒzÒ{Òrø1i6©?tOºnù¯¤ÛW žößû³$EºïÿiêÝÓûöL’4^xΑ%²«÷?Eû ´¼ùÄT<4EKKÖù¢~o—þÊ©/èm6›Y°`AjµÚ«.r’ä#ùH¦OŸžSN9%•J%3gÎÌÒ¥Kså•Wökú–´ûö´¾ýÔlüÞ¿§ç™'R?)•}ößdžÎ›~î;Ò»áS§§ýÕuŸûDÒݽåõwB*{NÎú/ÍH*EÚ?ô—i9jmºï»c‹Ë¶¾éøÞ œ9÷eðÇÿßÞ ¶ö´ÿÎgã÷¿å(€’ÙÕûŸf3i,[œTª©M›¾UµÑÿ@9õ ݰvíÚÌž=;wÝuׯñÌ3ÏÌÅ_œ 6dݺu¹ä’Kræ™gö{úfUki}ç{³ñêKÏ¿Lº»Óóܾ‹š_§þ蜤ÙHeä˜þ]Hó¶tÿdvšÝ]ivv¦ë'³ÓrÌÛú·}C†¥¹ryÒh$Iµ–¶÷þAº~|m‹žv@ÉìêýO:7¤>÷þô<9ë‹£ÿ€Rªõg¦¢(2eʔ̟??guVºººrÍ5×dß}÷í×ô-©ŒÝ#©Vû¾†Ô¯ Ÿ~tÒÓ“ÆŠ¥ýy©Œ—ž%ϧõ-'¥ÙSO÷C÷¦2v|¿^«ñÜÂÔ}coHÜSOÑÞžžysRìGìbJßÿl#ý”S¿‚Þ–––T*•tvvæCIggg®¼òÊ´··§R©¤V«mvz£ÑØü…Ô ÁIçÆ¾Çíï?3ÕƒM’¬ÿòÿ—溵I’ÖNKë[Nê½øXòB6|óKIOO?®¤ªiER¯§2qï4ëÝ)ºïL³Ö’ÅÇéí~à®´¾íi9æíé¼êòíƒSÝgÿC‡§ûž[sÑÔËI¯ðÉyg)°Ë¹hÚLEØ ®EKßÿl£-õ?ÙŠqˆ€§_AoWWW:::2räÈœ{î¹I’ñãÇgÙ²ei4[œ¾%UË“!Ã’J%i4úÆ}òÉ‹“âeÛqËõ¿ùëLÍFŠJ5¿ºähVŠ—.‚zêIçÆƒgãÕß콸6ýz¯¸âŠœsÎ9:thFŒ‘}ìc¹âŠ+ú=}óW)ÍtþøÚ´½û÷RÝojR­¦º×>)ZZúýFêÎMë;NM1dhŠ!CÓòŽw¥þèܾéÝ÷Ü––NKÚÚS œÖ~+Ý÷ÞÖ¯uW÷=0-'žž®k¿fWWŠACzÇý3.͵kE°‹){ÿ³-ô?PN}C7|á _ÈqÇ—¶¶¶ >õCò/7>žek;“$£‡¶æ¯ßy@f|ÿI’¢(rò!ãsøäQi6“®Ì-,Ns;lw£ÙÌgg?’$ùã·í»Óë6¬½–ß;nJŠ$÷?¹".ì ™'ŒhO’¼°z£#˜Ùÿ´·Tó–ÆæÀ‰ÃÒR­äK?š¿ÛÔUÀîjÀ½Çî7&ï˜:>ßûÙ3yzùúì1¢=ûŒ²ÉeT.¿õÉ m«å±Ö¦Ñl¦«ÞHµRä½Gí™Í}!‹Vnp”À²3úŸÝÌ}fUÖw}MAoQyëcsô¾£S­y~Õ†Ì~pQÖnèN’üʼnû冹/ä˜}GçÀ‰Ã²¡«'ß½÷™MÞÃæú›-õGmµjN?bb¦NžµëY¸l]¿·OÀîj@½ã†µ¥Z)ú.rúcúä‘éi4³¼£sË)éý*Ó’5yëãRo4óÐS+2vX[¿_ï€ ÃòcöÊwîZ˜…K×eøàÖL›4¬ßË¿ûˆIio©æ ÿÕ{Gñß´wN;|bf=ðÜV¯ÿ¨}Gçè7ôŽOÕYïɳ+×çнF¤»§‘žF#í-Õ<ºhm{a­#˜Ýÿlï˜:.ï9<_¿yAÖwÖóÖÇåƒÇìoÜöDß<8j¯ÌzàÙüà¡E9íð‰ù­é3óÅ1t·Ôßl©?zÏ‘“ÒÞZÍ?ÿðÑE‘÷½W¿·OÀîj@½ƒZ«ÙØÝÓ÷øýGï•©‡'I¾ô£ùY×YO’œxðyëã’$KÖlÌå·=™žÆ–GÙ­TŠERïidâÈöÔ{šùY£™ZµHQi6·¼ŽwLŸ›~±8O½x1¶z}Wî~¼wó¶T+yã>£òù<Ú÷êëZ”s~ë üà¡Eéi4û½þÃö™“Þ#ÿò“Dz¡«·f<¹2o;h\Ž}Øüç=Ϥ½µš)c‡dh{-w?¾¼_ïo{»hÚÌR0>9ï,gJÙÿlo9`l®º÷™¬q[~:iNxìÞùÊëûmú†åˆ)#óìŠ i6{ßïÃϬʡ{ÌO9±À@±3úŸm±±»'ºzò­Ÿ>µU=Sû§-õGí-Õ´Ö*ioÙôÎç­Ù>ý»£Ê@؈f³™Í}!ï9rRöÛchª•"{œ–jÿ7ïÑEkrüÔqÒV˶ZŽŸ:®/ÔM’{,ωO[­’A­Õœ0mܳ`y¿×÷ãËsÒÁ{d¯Ñƒ“$CÚjyç¡{¤úŠTwEGWœ8<•¢wž$éîiä¡§Wå´#&¦V-ÒR­ä´#&æ§VöýÖ½?ë¿wÁò,[Û™Ç^X›'—®Ëi‡OL’ì;nHN:x\{ÿséª÷dPk5EQd̰¶M~Kìý϶ºgÁò¼÷{fØ –$½ÃMì;nÈv韶Ô­ë¬ç©¥ërÊaR©1¸%Çí?¦ßÛ§?`wU(2çéUéi4ó®Ã&fì°¶,ïè̬žëû ï–Ü:oI†1)g¿ëÀ$É#Ï­Îí¿\Ú7}î3«2bPKþê¼xá±l«.„æ>³*•¢wü¬!mµ¬ï¬çžËÓxÅ×£îøå’üÁ›§äï~ûà,[³1ßxq­ëX”SÛ#çþÖÔ¾íûÑܶjý/eâ‡-ÊÙï:(M\“e]ù»öÝÝ{ó#‹sÖ oH£™|ç®…Žr`vtÿsƱ“³Ï¸!©U‹´·TsÁ»§%I¾ð_¿ìwsnzdqÞrÀØüùñoH­ZdCW#w?¾´ß@nKýÍ–ú£ïÞûtÞô^ùÄ{¦eÉšyà©•9bʨ~mßšuý»¥Ú@Ú˜_<»:¿xvõ¯öŸ÷<½Ùe»{ùþýÏæû÷ÿæy4wÌ_úš·ïçO¯ÊÏŸÞüW«V­ïÎWòø«žï¬÷döƒ‹2ûÁE¯iý¿ú볿ÒUoäâÌûµó>ðÔÊ<ðÔJG7 `;²ÿ¹êÞ§·iÛfîøåÒÜñË_ß?]vó‚M¯èèÊg¾÷‹~÷7[êV­ïÎå·=¹És÷?¹¢_Û·|m§þ€ÝRE ÊMÐ Pr‚^€’ô”œ  ä½%'è(¹š”_¥¨äûÿ¯$É êÐ|ÿùoæÕ?Ý®¯ñÞ NG}MnZ6KÁ`€PAïôáÇä­£O͸¶‰YÒ¹(·.ÿaæ­}(Iòû“þ[¦›ž®fWÒlfE÷²ühÉ5yrý/“$ÿã /ç?ù™,ëZœ$Ý:>ÝçÂ|fþÙI’"EN÷¾1â¸4›<°ú®Ü²ìº4Ó,ýNl4ù§Çþ6Iò'{Ÿ³Ó_XmD~Ïÿ–"Eî[uG|1džÐ¶W’ä…Îg}Ò`0Aï±£NÈñcNË5Ï_ž§×/Èí{fŸAn2ÏKgåÎ?J’LvDþhïåŸæŸ—îf××ÿæÑ'g¯ö}òÅ'þG*©äÃ{ÿM:ê«ó³U·9 ¶Ñq£NÊ}«îÈœ5÷äÜý.ʃ«š¶J{>8éÏò½ç¿©@°ƒ ˆ ·ZÔrê¸ßÉ·žýJߺÏnx2Ïnxò7.3oíCi¦™Q­c³¤sÑ_ãØQÇçªçþ5ÝÞPøÆ%ßÏ{&üa¿‚Þ)ƒöÏ ãÞ“F³'ÚöÎ÷ž¿<§ïñûIŠ\¶ð³Ùг>EмmÌ©9jäÛS+jy~ã3™ý·²¦¾ª_Ë÷ÇÔ¡ÓsÂØßΨÖ1YW_›»WÞ”{WÞÚ¯e[+m9uüïdÚÐ#SÉÃkîÏ—|o“|kÖÿæQ'çðoÊ7žþç © Ëüu§Ñl¤«Ñ™jQËû&üQnXzMžÛ¸Ð§ v°ñÇØÆµMHµ¨ö…¼ý1}ø±éiÖ³üÅ¡6§H‘Ñ-㳤sQÞ:ú”7úļÐùlƶîÑï×Ûoð´Ü²ì‡™×ñ`Þ7áÃùÆÓÿœf³‘‡–$yÇØÓrذcòõ§>›‹ÿû,ÜðX>8éÏú½ü–8äÐ|`ÒGrÃ’«òÙù›o>óÅT·"§Ï˜aµ‘ùÂæ‹ þGF·ŒËi{üÞkZÿQ#ß–£G½=ß|æ éllÌsžÊaÎΤöÉéiÔÓ^”y屎‡}Â`'wôª ÉÆÆ†¾Ç˜ø'™:tz’äÒ'ÿgÖÕ×&IN÷ÛyÛèS’$KºžÏ7žþÿÓÓìÙâú+E5EŠÔ›Ý™Ô>9ÝÍîÔ›·¥V´¦HѯqzWw/Ï3dbûÞ©¦–µõÕYÞ½8íÕÁI’·Ž:%W-š™õ=I’;—ÿ8'ŽyOZ+mýZ~KÞ>ö´üdé¬<¹~þ‹ë[‘»Vþ¤_˶­y㈷æó_ÐwGóÿG>¾ßŒü`ñ·ÓÓìé÷ú~LNû¾üï§>Ów'òý«ïÈÛG¿+ÇŽ:!ÿ¹è² ª Î>ƒÈÐÚðܽâ¦]bdØÙfœ1]vó}xáUsvëã§ìïagoÿ€zWv/ËÐêðTRM#=}ãº~êÀKS4‹¾ùnZ:»oŒÞWj¦™JQí{\IÑ÷4ëéllÌ ê\µè_“ôþ±Žž5ý!››¼Rs“çÚ+ƒ3¤6,ïpæ&k[×Ó‘AÕ![\¾?ƶŒÏ ŸyMõÙ2&ÝÍ®¬©¯Ú¤æ¿š¶¼kI¿Ö¿ÿiyãÈ·$E3£ZÆ¥£¾&IuùõÙoÈ´tÔ×ä¬)ä»ÏÿŸ;òø9ò-y`ÕÎìðlKÐG¹÷Ýö Ë|ü”ýØ=¶@½«»WdM}eþÆÌYó³×´ŽU]Ë3²6ºo¼ÞQ-c³ª¾¢oú Ïdò ýòhÇÏ“ôŽ»ûBç³Ûeû76ÖgCÏúüû³_ÉâÎç^5}dmô6¿ÆÊîeÙ£mÏ<½aÁç-ŠMGäXU_ž–¢5C«ÃÓÑÓÎŽh"EVu¯è÷úǶNÈe ?—Q-csƤ?Ï—ŸütºI’†š#‡¿9Ïnx24óÂÆgóðšûrèð£ó@½°# ˆ1z›iæGK®É{&|(û 98Õ¢š½í›–Jk¿×ñhÇÏ󎱧gHmX†Ô†åø1§çѵ?ï›~ÏÊ[rÒØßN[¥=ƒªƒs¸÷äž7o·÷p÷Ê›ò¾ ÎðÚÈ$É êà¼aðAÛmýw­¼)'{oö´o’dHuXÞ9îý©¾ì.æ$Yѽ4 =,•T3¤:,IÒÝèÊCkîÊé{ü~jEKZŠÖœ¾ÇïåÕw¦§Yï÷úïYuK–v½ùëΓë™ÓÆ÷Žñû†Áåä±ïÍ÷_ø·t5:3¸:$EŠŒiÝ#kë«}Ê`« ” ùùš{ÒÓ¬ç]ã7ãZ÷Èò®%¹ö…ï»uKnYþƒ¼»ö9gßL’übí¹}ùõMŸ»ægQ¿Þ÷SI’»WÜÔwwïöpó²Ùé½!>å‚ÔŠZ64Öç®?I¶âÌmÎÜ5?K%•|`âŸdHuXÖ÷täî•7§Ñll2ßíËoÈìù—ùÄÿ+K;_È7žþçô4ë™ý•9uÜïæ¼ý/J’<²æÁܰôê­Z³ùÒ`?Xüœó†ÌAC§gy×â|繯õÝÝ{óÒÙù‹)—Fùö³_õ)€¬˜}z:::rúé§çË_þr6nÜØ7ÏW¿úÕ\z饪 ”†þ(£~½+W®ÌÁ¼ÉsÿðÿuëÖ¥££#I2|øð\{íµ9÷ÜsU(-ýPFµ×²Ð‘G™cŽ9&üàûž>|x–-[¦¢À.Eÿ”Ák z/¸à‚|ñ‹_LOOOßs#FŒÈᇞ™3gfذa¹õÖ[sÙe—¥»»[•€ÒÒÿe°ÕAï´iÓ2qâÄÜrË-›<à 7dîܹ¹ýöÛ3a„\rÉ%=ztf̘±ÅuÎ8cº=Q2^5G€]Î+ÿ?*>ûUó\4mfßÏÍCð«_«îˆþ`GØê ÷ä“O~Õ&H’9sædÎœÞ ª äsŸû\>ÿùÏ÷ëBGhX.‚y`÷ ÎÚdÚEÓfæ“ó^öÜ<õØÕíˆþ`G¨líÇ{l|ðÁ~Í[¯×U(-ýP[ôNž<9Ï?ÿü&Ï92—]vY¦Nš¢(2vìØ\pÁ™={¶ ¥¥ÿÊb«‡n?~|V¬X±És«V­ÊìÙ³óéO:“'ON³ÙÌÕW_K/5v!P^ú ,¶:è=øàƒíó³fÍʬY³TØe耲¨(@¹ zJNÐ Pr‚^€’ô×À"ü IDAT”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  äjJÀîbèg¾²É㿟óµWÍ3ãŒé}?ŸýªéM›Ù÷ó?}¨óUÓ;>õQ…`§ô°[yy{á+¦Í8cz.¼jÎËž9k“éM›™OÎ{ÙsŸÚtùWɰ³º ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ PrýzO?ýô<ñÄyä‘Gúþ}öÙ/­¨RÉù矟;î¸#·Ýv[Î9çœE¡Â@é耲©õwÆáÇçÚk¯Í¹çžûk§ä#ÉôéÓsÊ)§¤R©dæÌ™Yºti®¼òJUJEÿ”M¿ïè>|x–-[ö§Ÿy晹øâ‹³aƬ[·.—\rIÎ<óLJGÿ”M¿ïè1bD?üðÌœ93Æ Ë­·ÞšË.»,ÝÝÝ)Š"S¦LÉüùósÖYg¥««+×\sMöÝw_JGÿ”M¿ƒÞn¸!sçÎÍí·ßž &ä’K.ÉèÑ£3cÆŒ´´´¤R©¤³³3‡rH:;;så•W¦½½=•J%FC¥w13Θ^êí¿ðª9v"ú`—Ñï wΜ9™3§7[°`A>÷¹ÏåóŸÿ|f̘‘®®®tttdäÈ‘}cX?>Ë–-s‘³ *{HZö€Oÿ”Me[®×ë}?Ï›7/GuTßã£>:óæÍSa`— ÿ²~½#GŽÌe—]–©S§¦(ŠŒ;6\pAfÏžÝ7ÏW\‘sÎ9'C‡͈#ò±},W\q… ¥¢ÿʨ_C7¬Zµ*³gÏΧ?ýéLž<9Íf3W_}u.½ôÒ¾y®»îºLš4)×]w]’äòË/Ï7Þ¨Â@©è€2ê÷½³fÍʬY³6;Ï׿þõ|ýë_WU Ôô?@ÙT” Ü½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ Pr5%`w4ãŒé}?ŸýªéM›Ù÷sóÐKÜö_xÕ;€>‚^v;¯IÏÚäÑEÓfæ“ó^öܼµý/© 1t@é zJNÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(¹š¼dèg¾²Ã_£ãSUè×±þ°+ô¼ÂŽ b™¯oý`We耒ô”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%×ï wÚ´iùæ7¿™ûï¿?·ß~{>ô¡m2ýôÓOÏO<‘Gy¤ïßÙgŸ­Â@é耲©õg¦J¥’¿ýÛ¿Í×¾öµÜsÏ=9òÈ#óoÿöo™7o^|ðÁ$ÉðáÃsíµ×æÜsÏUU ´ô?@õ+èm49묳úßwß}¹õÖ[sÄGlr¡³lÙ2JMÿ”Ñk£wÊ”)yüñÇû1"‡~xfΜ™ÿøÿÈ_ÿõ_§¥¥E…€ÒÓÿ]íµ,ô¾÷½/õz=wÞygßs7ÜpCæÎ›Ûo¿=&LÈ%—\’Ñ£GgÆŒª [aèg¾²É㿟óµWÍ3ãŒéý^ßg§ÿ÷ÍNÿuëß}ý[Z~ ìc`ë]|ñÅ9ãŒ3’$+W®Ì¨Q£’$wÞyç«ÆÓÝVú`{õo±?Ê¡ãSÝâ<[ôrÈ!ùÄ'>‘?þã?N£Ñè{~Μ9™3gN’dÁ‚ùÜç>—Ïþó.t`?¼nëÊ®Úü‰`W[ÿŒ3¦ç«æô{ùxb¶ìÔSOͨQ£²zõêüéŸþi¾õ­o¥³³3+W®Lkkkººº¶Ëëè€méßzìZ¶*è=ðÀ3sæÌ|üãßäkK¿I½^Wa`»»þúë³råÊ$IQi6›I’Ûn»-«W¯Î Aƒ¶ù5ô?@™ô{ŒÞÃ;,ßüæ7sÞyçåž{îÙdÚÈ‘#sÙe—eêÔ©)Š"cÇŽÍ\Ù³g«0°Ýþù3fÌ&Ï1"øÀ¶ËX¹ú lúuGo­VËw¾óE‘/}éKikkK’¬_¿>ozÓ›²jժ̞=;Ÿþô§3yòä4›Í\}õÕ¹ôÒKUØîªÕj¼És­­­iooO¥RÙ¦uë€2êWÐ[¯×sÈ!‡lvžY³feÖ¬Y* ìEQ¼êñ+Ÿ{-ô?@U” Ü½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½@é\|ñÅyúé§7ynÉ’%ùö·¿­8Àn©¦@Ùœzê©5jTV­Z•·¿ýí©ÕjéééÉÊ•+ÓÚÚš®®.Ev+‚^ t®¿þú¬\¹2I²jÕªŒ92IrÛm·eõêÕ4h"»A/»œ¡ŸùÊVÍÿÿ\Ùöªç.š6³ïçúPçV/¿5~Ýú_þ^Ëú?9ï¬Ýú˜qÆt„×Ñ…WÍQ¶ËùùµèøÔGv“Ïïù矟¿ù›¿I£ÑØäù¢(ÒÞÞn§»A/»¤­i>¹¥>µËïäõ¿<¤Þ __Bv¶çùykíŒ |~Îç·Z­fðàÁ¿vZQv°Ûô¥$ÐxIE ÊMÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(¹š”ÏÐÏ|Eج‹¦ÍTvŠæ¡—¾ê¹gLïû¹xøìí¾þ—ÛëßÖíwŽÞµÿìøÔGýÿþ:Ú‘õwý@Ù z5:ìb>9ï,E`ç™·¥ÎÚ­Öïܼkÿ߸3‚:ÇÐë[û€23t@É zJNÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(¹Ú@؈¡ŸùŠ= x®YÔŸrìߎO}TA€Ý΀z]ˆëõÇþÈ ÝPr‚^€’ô”œ  ä½%'è(9A/@É zJNÐ Pr‚^€’ô”œ  ä¶[Ð[©TrþùççŽ;îÈm·Ý–sÎ9'EQ¨0°ë5Rú`€©m¯}ä#ÉôéÓsÊ)§¤R©dæÌ™Yºti®¼òJUv)ú` Ùnwôžy晹øâ‹³aƬ[·.—\rIÎ<óLv9ú` Ù.wôE‘)S¦dþüù9묳ÒÕÕ•k®¹&û »ý0m— ·¥¥%•J%9äCÒÙÙ™+¯¼2ííí©T*i4* ì¶µÿú™¯lvúßÏùÚf§vú·¼å-?€–ùgzKËìHÅäÉ“›ÛcEsæÌÉñÇŸ•+W&IÆŸë®».Ç{ì«æ]¸pa¦L™¢úÀ·#úý0Юo¶Û½óæÍËQGÕ÷øè£Î¼yóTØåè€f»½W\qEÎ9çœ :4#FŒÈÇ>ö±\qÅ* ìrô?À@SÛ^+ºîºë2iÒ¤\wÝuI’Ë/¿<7Þx£ »ý0Ðl·1z·†1ª€Ý¥ÿÐÿ;ãú¢¢,å&è(9A/@É zJNÐ Pr‚^€’ô”œ  ä½%'è(9A/@É zJ®öz½ðÂ… UØ-耭˜yñ_·ÙÕ™uŸ9/­§¼7­ïxWïù覤ëæfèÿübR­¥ë–ÿJ×-?LÑÒúÒþ4$ƒÏûô–— gáͯ÷çë•ëo<¿&]ÿzwßú›=ÔüË4æ>Ÿfš©±Wj'˜TŠM§ÏY”Ô)ö™Ú)¥2aøÏ[ú¤ÙUOç?ÞÚ)¥vüþ½ÇêMóS¿é±´ú´¤ZÙìù¡?Ëoëþ`÷PHÓròA©¾uß$Iϼũë¾TÿþIK5­tLo~ÝÃI­š–ßšöêå?tT*ûŒIóùÕéúîÏÓ\Ó™ÚIôÿõ·°|õð½Òò;Ó_µ\u¿qé^ß•æ’Þ2IË:’ Ý)&zÝëZ=nJªÇMÙlýŠÑƒÓóÀ3©Ójô<ô\*㇦ò²íßÜþÙ\}¶‡ž{¦~Û‚Þà|ò¨4¯Mó©ý>~vJ·ðþ{~>µwì— i}մƳ«Òuù½i9}Zª:*͵©ß÷tÒhö…U»³î{oO×í?Jû>œêÞoHÏ’Ei<õø&ó´ôî´¼õä$IýÑ9éüÖWSûÄç’––m~ýbðÔ~ /¨­?òó¤mЦÇßáǤíôš—=õçø{½?_›S¿þ‘4w¤õ¿½9iöÓÝ?z´ï<×sç“i<¾4­v\Š¡méylI –¥2ax¿Î[>>Z{?ß/µG'íµ~Ÿú³ü¶î?v}µºaÕi{¤»Hš+7ô…§ý븓bÒˆ´~ððtͼ;µ·ì»U ókZ¾Z¤zàø4æ/IõWAïü¥©4>Eµ£cÔN>0Ýß}(•7î•¢R¤~ÛãiùÝ÷ÿþy-^¼¯ö‡G¥òâ„•½F&{Û×ßcúЉ©ßñDjïšúªiõMíøýR}ãÞ½‡a[m«Ã¦]VO=]7ÎJÛþEª/Þ¡[ÝsJª{þæ»kS§gc*i¬\žÊø Û¾ •jŠJ5e‹ÓìîN1dhŠ•ËvÞò;ØÖéóÕ\וžûžIëß¼#ňÞð¼åýÓÓù/w¤åÄ’¶Zš‹×¤²×¨¾;‚«‡MÚ¾Q)RT+½¿àën$CZS¬X¿Ó–ßÒþkvÕSÿÑ/Ó˜·¸÷ŽçC'¥öΓ–jO¯ì½Û¸ZIóù5iùÀôÞ༙´þÅ›Ó\Ú±ÙéÅ –4–­KÏí ÒX¸"ÙPOeò¨ÔÞhŠ!mI’®ËîJí]SÓó³§Ó˜¿4TKËè='ivÖSÿá#i<º$֚ʔÑÎ{¯¥=¨Ö3gQR­¤3ä5-_L‘´UÓ\Ú±S–¯L›ž_.î{ܘ¿4ÕiÊs ì3:Ř!iÌY”ž‡_H1zp*{Úaûgk4–v$=;¯‰ïŒãgG¨¹gê<“溮W¼ÁfO¯HõЉÎH¿nÿ/[œôôô ÃÐõ9÷¥¨US3nûlDwgª‡•úæçáûS;ôivuî¼åwh·þøHŸ¯æ’µ)†´¥2ö¥m)ÆMÑVë=w$©±Ws¥~ý¼4×lÜþÑÝ“ÊaÓxøù4æ.JõЉivÕwÎòýØõ<’¬íLÛÇOÛÙǧ¹b]º¯Ÿ÷R ŸXž–ã÷OeÚéž57-ySŠJ‘æcKû5=Ë×¥ºßØ´}ôíiû»謹qþ¦oñ{sR9r¯´{|*SF§þ_/½~ýº_$ë»ÒvÞ i;ëÍÉ+Ï‘ôË€º£·ûæù©ßùD_£Þö‘7½4fìk1¤5͵Sl§å?.¿x¾orËÓwçQõ qéþþœdc=©i<³2ž±\ÃɦûšŸ'µJZÞ?}«÷Ïæê³-šë»7¹«ºûûszïüJÒú±·÷Ý5¶ÝŸ­´Å÷_«¦zÄžé¹ëÉT§¿tGa³£3éi¦ÖîŒôëêº~]ÒöRm6~ÿ[éùåÃI’Áó)† K’tÞ|}º~zS’¤2~BýÉÇ’êvV ^OËáÇdã¿5Íf3ƒ>ü—éœõíMgùùÏRÿŃ}Ûÿ裩NÙ¯ßË¿^ú{ü½ÞŸ¯Î/Ýš/¾^³Ù7Þm³£3üêá9ŠÏßIR=`\*ý¶tß0/õKnNõȽR{×ÔƒZ¶ÓñÑHõð=Ó}ÅÏ’fÒò᣷îüÐå_óþëîIÏÏöŽÞRM‘¤vÚÁéúâ­É»égD{нG¦òüꤧ‘bX[2fpšºSŒ´ÙéIR9h|ßûh,]›bìô<¶dÓÿ_NØ¿ï—uÕ£öN÷·î{iûz.m矘´õîÓÊ!ÒsïB'?€­4°Æè=ñÀ¾1 ·[€1¬m»-_9|Ïß<k{K*{Lã‰eIµ’ÊäQ)Új¥:*“G¥ÞžÔ*}_©Ýšý³ÙúlËvÜ»/^oòW!ôÆ?JÑ,úµ}Í"I£ñÒfŠíRõçý·¼}ÿlüò­©üÒÝÞÅж¤Z¤¹fcŠÑƒ•^¡:jlšëÖ&ž¤RMûûÏL’¬»èü¤ùÒ|m'žÖ7Fï«ö*i6zú~iS4š[C‡§üÙ;ï𨪼¿wzz ô:$D‘* ?ƒ€ ažTED`WTQQaWw©+º ¤&(B -Ô€t6õ~Œ Œ!so˜I&Áó>ÏÀ¶t?Ú:å0 n®kC´ ± MÁ¹MEžU8;@ @ ðvŠ?vÊq)ëûѵ«ãz´8Ž×DUÄqâ*òÉ´Û² ¼G’Ðwmˆuåa)i`— ñV»ú±iXÛ¦äl r¶Û¦4 +ú¥;Ú¶u°¼èöþ±(l›Ob߬väë9X¿Û‹œž#Æ_’0vé‹yÕbì)GÁnÇ~þ7d«ú…!]Ã&X6' gg!ggaÝ®a“Â;̲åÑ„•¹w‡ëåñE…·úçOû’ h[ÖÀ¶ürfrF.ÖeÑÆF:Ÿªe,³¶cßy9Ëì|yÛ¾óÎ=}ƒ ¾mKÙ@¯¸ïõxã§wncY}Øy­ÕŽuM2ÚÕÀG/ u¤ç8Ÿ¸Ày±mÓIõ}2 ©YëºcÈvrF.öbÛ@ @ ¸JÍÞ–ovã8“V aO:‡¦N†§týÆúÝ>dIF @÷p-´15 U‡Òñöýç±'_vûÎøV'$ƒSŒRx˜ô Ó¸=&ûgAI>Þ iZ½VÂGZRDú>U/ÔèÚ×Åš•ŒeÆ&çù¢+¡k[Û/ý—BŒh¢+â8r{K©z8†A­°%úâš°´-#]XÿéUÓÐj1',Ç‘vMDyŒ}"«»û\ßþ1äÕKÉùçûÎóE7ÃðHŸ¶Ñº7¶äýnߎ™\*äë­þ‡}y¬¿[¶uǰÌÜ€¶YUtyŸ$¡â¬ëŽbÛœR2èžmY"ücqŒŸ®W#lñGÉûlƒS>Ñ•Ðwmè;ù÷l„}à l[RÐT A÷PM¬+«>^߯Öe0ô š !h[TÃþëyáø@  °óÃ5jȦz I¥ÜC¡c“V !@ @ ðŠ¼ «îß=z@ @ àÏ‚Xè@ @ ‚RŽXè@ @ ‚RŽÄŸ@à7',ü¯@ @ ¯{ô @ @ A©G,ô @ @ A)G,ô @ @ A)Gö®¡SO!‰?9¹s>E2 )_ÉãïäÌäLMÙòhÊW‚+BÿB•±ÿvÇÅsŠþ¼Xêw8Èþè¬Û~ÁòóOHaeÐV®V(ù¨O%Ë¿h”WF¶˜‘t:¿7Åvpæ•‹Ñ·ˆ-zû*„þz-âœlò–|…eÕb¬{¶#I´Õ"U÷ÿ~Õ/_Û‰òÂ{û¼µ¿È§íãžò—ŠÊ¿{_ü-Ÿ<>E­¿æßá¸xm­z÷E¨¼/ãÿ}?ù+:ûó¤ß– «)6‹·ÞGÞâyHz½ë;ý#]0t莜“MΧÝeâp€ÝNð;ƒÑäÞ©•‹°íßMÐøOò_sü2äôkHÁ¡èÛtBß<¶ØѲ~%Öý»‘$ ºf­1tè’T(ãµnû{Ú4å+ahÿº†MK–²šÐÕ‹FS6¢xm$/kâìÇ!Û¬þu¼jùË73È[ü_@FÿàÃèšµvêË¥óE6i+UíóBþjí· û”-f²ß¡K ís:§õ«°lXMð»ÓA«SÔ¿¼oga;‘ ’I§C[«>ÆÞ‘‚‚‹gâqá Ö_V0ƒÌH IDATb¿|]ÓŒ]¦TŒ¯ýò, Ëp\:‡¤7¢o×}Ì#÷Mÿ”ü‡§ø¤Øÿ¨¿ÖÍ èéì7y»Õ¯Ñ4vŠ3¡ŸÿE‰Œ/EÚY&÷Ë)èÛ<ê² ÛÁ=X6'øÚÛ…Êü:ÎH'ïÿÎ{ì£Ôç'…Ñ_/±lX„Làˆ¿!ŒÈK‘ǧҠ_EjŸþö%Ýy™û¤¼$_1ù÷â´{ñ¯%¢}Eíß½ˆ/þ–O©à>ÀŸöW|—vòrÑ5Á÷|¾")0ˆ  Ÿº}gŽÿÉ`Ê·Èk;yÇÕ+ù…xå"yK¾ÂÔÿ/h#ëàÈHÇqõrñþq\8Kà° àÉ[ø¬{BÜK<¿k –- ˜þïY´ÕkcO½ˆã·“%NY%ƒãÿ=[üõJ )WvlGJþ–› PMcÈù|’33çaþñL?ãwý( íóFþjìWÉ>¥À l‡öºÊlÉûÁP(ý3>öúÖío\Çÿ#–ŸÂØ÷éb‘ýx2ú‡ÅT»>ŽŒëäÎýMDô-KÁøÊ2Ö_Vbx¤ Úšu±ŸÿÜùÿB[©šj5KÿTøOñI©ÿ%MéØÓ®`ªUßo ͽÖï¯øR¤ý—$ =AÞòèšÄ€$a^¿Sï¥f‘@Î͹'ÿ÷gÈO|¦;—Ρí€äìO€oRô’2>÷ª_%Å?ÝõßKû¼É¿}Q^¢Ç¯˜ü{qÙǽúגо’_ü-Ÿ?Ãø¥1.jŠm¡WÎËE QHÏÿ†ýL CGç”eÕŒO—ívr>OàËoÁHîìiÎD5/‡ì©ã\Ç™ ²}x›?šÍXV/ÁvìRH¨+ލÕ%ýV•y’¡‡üKNK%gΧùàöÝý²Lö§#`ðp4å1',ÃvprfŽ+ 1¯Zâ&_¥þ{Ÿ|±ø¥zò?rN¶¢~)å§ÞúG%ûRòŸ¹s>ÅÐõqlIÛ°÷ܾ"ñÏJþË[ÿíMþíƒrÅö)ø?Oöc?{ ËÆ5HZ-ŽKç1>þ,æµßƒ,0t4R@ ×þÝßöám|ñä_•Ú'_OSôÞ¢dŠý÷2?ñdŸªÆOÁ~ ã_òÅN•úã)¿ñ6>ªŠñò;%û)ìúƒuÇF¬ûw0x8’Ѩœ?)؇’~y?¼ÿÞÚ‡¢þ©ÈŸýjßJñO¡ýÞÄ_ÕþÛ—ëMwèwñ.ôææà¸p–¼3‘órÑÖ‹ÆÐæQÐjóýÖ¼î'Œ{ä€yÅwèêp×\Ç¥óè[>‚yåb—£0<Ú)8´:'ã¸~m…*X¶¯GÒêÐ7k…#-U]’œvìvt W¨åÜlòÍCÕ„ÀN=‘Íy®ÄÈ‘–Š®vC´=û#i´ä-šƒå—•ûÖÃûÜâ—ùû¯ xñ gû·$`OÞOÀ‹o aÙö yßMÀàaÎuŠžO’û¯ÉØ·@2™°ÚKàëïÜî¿Âñ…‰oõߨ-ŽÜÿ~Žd ÄôÔ‹îò_µÙœGÀˆ¿CƼô+Ìk¿ÇØ{ *ù[vlÂqõ2AÃÿ†œ—CÎŒ÷ xa¤ó.<4eË£©TÛуè5wõWS±ªkb8âoØOüziÁžy²/±¬ZŒœ›CШw‘eóò……Ò5ú­”yÎá ο¤rÐT®Žíð¯èšÆ8uä·hBÃ]ec×Ç1v}œœ™cìØ=ßE¥þ{Ÿ|/TäŸ^g R¥_žòS_øGµþ­À¼gÙ ½`èá¹}E៕üW‘úo¥ù·å*Ú§äÿ”ìÇqê/ŒÂz óŠï:ŠÜù_`?‘ì²Yoü»¿íÃÛøâÉ¿*µOÿóɼÃý©é¿7ù‰'ûT3~jìW­¹ýQ“ßxU-NyÈï”ì§0ù™uo"Ö=Û øËHç"¯ÊüÉcþå¥~)ë¯÷ñß[ûðx¼ ýõ·}{?…ö{ÕúoŸÙÑ]ô»Ø6èÒF5EÿPŒýžÇØ÷)lGöc^·<¿Ã¹t9óÚ?,ØîAÎÉFß²íÝs›7°ü¼ý- xîUÐëÉ[òßbZ±ƒ,ƒN‡ãÒ9—Ï#ëô`³:¿W:<'Ûm‹Š¼e Èž:Žì©ã³oÞîc^.úf­ÐÇ<‚rûn&@× 1º¦1H’„#í2R¹ŠØÏv«Çж šˆ HZ-ú–à8w97ÛU®ïØ]­úH¦ô-.ÔÖ–-ë0t쉶f=$4aeÐÇv(ò×·x)$ ëî-ŸŒœ—ƒý·“XwlT5>÷}û|HAö«hŸ6úZb?zÛÉ£è6)| ˆÿ¬ÉcÈþì EÞ÷ßNóϰ,[€±û“Hå*8íª”¯õ@’F‹¶Nƒû²÷Ÿ êIÒ_ûÙSH!¡hÊ”+Ôqš0çÃñÛ °ÛÐÖª¦bwö¼­_ Œ_ö³§\ñ˺}úν‘¼î„ãÂdsžs²c ÀÐ÷)ò–/ où·˜z@2ÝÞZCéxµñÍSÿ5*!…‚Á€¦Bå; Ίuߌ=Ÿt^,11ôˆÃ¶g;Øíªäï¸rmÝ(Ðë‘BÂÐT©~û$ècÚ`ûuç‹…¿ÐàÑ>ÈýæKr¾˜âöÉ[ðŸÛòùu'†^ýÁhB2 ‹næsýVÊ<¡”ê€u÷V·Å"Ú÷Gø ÿE:>*óOoñ&?UcŸjü›Çöuè®Ø¾¢òÏJþ«Hý·ÒüÇÛríóèÿTØVMõZhÊWB[§óåó=n{OþÝßöáƒøâuìöÆÿ©ð?íOeÿ½AM|ñèâUدÿrÏRUä7ÞÄG5ãç)¿S²µù™íÐ^¬ëWðü_ÝîÔW“?h>Ò/úëƒøï­}xÒ?5úëoûöäß”Úï‹øë jäãI¿‹íŽ^mÕHø}+ÉhÂØµ/æ@·'ÜéñCn¼8‰20¯[î\½/àqP)(cŸ§\Â7<Ò™ìiÉ‚N_ÄÓ!Mȹ9®=å›ÎÇ T<¾ª-Sι ë°ƒFëÚ×2{ò›ð‡u]ôw_èξ‰yõRäœ,´•k€ÃÖ‚_ä¡)_ÉùH`Nöíýàîx â”Ú\ïZ*šJUý´J£ IÂЮ+öSÇЇ3÷sLqƒ°îÞŠuß΢seIoŸ/;ïb¿ŠöéÒ¹P¤À §ƒúÃÞÜj¸µÇ)²Œýèr¦¿ç|©) xÔ°V}‚ÞþGF:–å ±Ÿ?í|™—FSjÆ×qé<–uË ôz>ßu?ôÏ›øT`ÿKþZ÷n/ÔÊ•DµyLX6­Å~ñ<ºÚõ0<Ú MŪªâ·õzbuGüBÒ gßIJbéNŸìÜ’ã÷±ÐÕÆ"Ë`³¹?v™—«x¼Úøæ©ÿ¶äýH!!È7Ò±<‚®n”Óæn\s&¨w<æ¦ ø½ìºÛ]OÉ_W§!–MkÑE=€|3Çå h«×R-O]ô˜W/AÎÎû™Lýž÷ÿSAÀsßAèHwÊÇ›­¸Ôê·§üÈJù—¶^4òê¥8R/£)ýø!L=âÔùdô¿(Çç^òÏ{Á›üT­RòoÞ¶¯(ü³ÿU¤þ[)¿õ¶\Eû<ù?Uös«šßóq×ß>ðïþ¶_įó+/üŸÿã«þW|ùã¢ûõ…ÿóÕü½°ñQÍøy:¿’ý¨i¿=å(Ö};œ2ÿý…à…ÍŸîf¾Ò¯õ×Gñß[û(èøÂÄÛ÷ÝÆOMû}ï5òñ¨ßþœ\ËÚü7;ΤäT&ùW$‡ƒ¼ÙÓœÇÙíÈæ™€iàP4Õj¢©PÇ•‹®…$)(¤â{£°¦bUìgO¹î䲟=¥ÚqJaeBö4yðžê7ÿ5ºF-Ð=ø«~ûÑ&ináuÿËDàH½„¶Fm¿è’’üm'’±íÛ¦jM4h*VEר¹óQëbXˆ*éíóYÂpûTÛ§¡Wÿ|Ô>¢Ih£€5ßûE'5aeÐ=ÔËÚ\éÒ0¾ŽÔKä.ø¦~Ï;­û¬¾ˆOõ¿$è¯lµ`?žŒ±Ç“wŒ;²o¢ýýQ|ì¶|uêcÚ iƒl6cݶŽÜÿý‡ 7ÞW//Oõ»„'!9¼¿ËÛqãÚíø¥Õ"bzú%wÑX·¯GS¥ŽkW±Ø®iKg×MŠÇ«‰oûï°cIX†©ßó82o`Yó=º×ß)¼,²Õ‚œuÓ™ÀrF:²,£ W—ÜkÊU@ Á²q h4˜½^¸ýÑtztMb°LBÒÐ5j–ÿ¹Nï\¾ÿç•9#[ÌΤù^/ÚR¿ Ì Ð_ÅüK’ÐǶǺgÚÈ:Îw1НÿE8>ªú¯ä ¡_÷ìÏÕø'‹™Ší÷“V㿊Z>Jù­·åJíóäÿ|e?÷êßým¾ˆ/jcHíóÂÿy? Óÿ{ÍOÔÄ—äã+ûõf| ;÷õúÇüN…ý¨i¿#-•€¡£Ó¯‘÷ý|^‡d0z?©Ò//⇯㿯ýC±é¯?Ûï‹ø[ÄùGý.– sn6y gâ¸rÁ¹OXÖMçcÜwYÔt\OC u}ëö¾ùÁíÏ«c‘Œ&ßüÀõ² ýðl\ƒœ• €eó:´uýݼ®6¶Ãºq ˜óœ/Û¸}«vªƒ„±K_Ì«cO9 v;öó¿![Õ_±³§§!;ì¿;ÉëX6ÅçûíÐ^çÕ«Kü蛵¾ëÉ÷ÔÿØXÖ¯Â~þ7ç˜ggaùe…ÏñFþöÓDZ¬_…ññg çã ²ŒãÚU¤PÑ>_:›»ØoaìSS¶¼÷/Q”e¬’ 7'ß#tE‚9—¼ogc¿tÞ9néØö$¢©V«ÔŒ¯ãâYr¿þSÜ çãO÷Yÿ¼ŠO ý/)úk?ü+ÚzÑ®àîbÊUĶo²ÙŒýô ,Û~qâ„eØ/œYF25òážê¿—Ãvü8ì…NznÅ/¬V,kÝã—¾u{Ì+¾C¾™ñû˜æ`?}ü¶~§^Æš¸cÏ'1мæ{ä×Ýr OÇ«‰ožúoݱ MùJhªÕt>vg4aMr>Ê*é èh…yõç] V+æ5ß;ïSyÑÀ²g;º†M0=9SÜóî/rU;|ða¬ûwc=¸}‹‡ó]DyäÜlìgO9e•é¼³¦öq¯ ½Úšu±üü²ÝŽ##ëÎM…sÑ*ô[M~TþªÉ¿ôÍc±%ÿêÜ»wMzÝÿ"5ýWò?õËWmT០í÷§Vò_E-¥ù·åJíóäÿ|á?¼ñïþ¶_ÄU‹ý í»Wÿçuü(Dÿï5?Q_<ÉÇöëÍø¨ÉoŠrý@)¿S²5í×·zM¹ŠhëE£©YËÚ|’?©Ñ/o⇯üWQú‡âÐ_¶ßñ·¨óOú],wôJAè?ˆyÕäëiÈ’„¾YkôíóßM ge ºm­zè;t'÷«‚Å‚¦JuLOŽ‚‚¡}7çUᅩt^­÷p¼ÚøVPÿåÜ,›ãuÝnO·púZ‚1c¯˜~$ûóIÎú¢Àе¯ú$¯ÉƒäÎýËÆµHètHª8÷"VygжRU$@ÎÉBS¥ú]&!˜ú<åÚ[]ޱÿ_œwˆ±}˜âž'oùr>~M…ÊèZ<„mßNõñW…~«É Ò_5ùFºM°%ÿŠ©Î‹Å×ÿbð_JýWò?Júå Ôø§û§¢ýþôÏJþËÛöy“«™©™?yjŸ’ÿóÖxíßýlÞÆu R íóÂÿyíŸTöÿ^óUñŃ||a¿ÞŒšü¦(×”ò;%ûQµþpǤÆîqäük2ºã‡ÐÖoìuþ¤¤_ÞÆ_ø¯¢ôÅ¡¿þl¿/âoQç7é7€T£F 9øý/ÜßäÎùýÃîio@ ”\ä×Éý꟎üûŸ²þ?»üsÿ;ãc£©RÃÙžì,òÍE[/ CÛ®Â@JH~dþy`èÜ[]øG!µ¯¨ýߟ=¾ ÿ'âãý¼~ ò'ÁýJÖÄ×Ñ1@Pz±îÛ®Yë?mýjùË2Ž´+ÎGM­Vd‹Ç¥ó8nÞ@[7ZG Áqþ7lûwahÛYCøG!_µ¯üߟ=¾ ÿ'¸où“à>GÜÑû'AÜÑ+Á}8‰¾rëöõ8Ò®€F‹¦RUô­Û¡)WQÇßù‘ÝNÎg½cÏþhë6„ÿûs üŸˆÂ~!kâëb¡W @ @ J3®…^! @ @ @ (½ˆ=z@ @  ”#z@ @  ”#z@ @  ”#zª‘0hŒB¿Q©R%víÚE×®]…0Bÿ@™2e˜5kûöícÆ 4¨PåB¾¾9ïÞ½Y´h‘PøÂÒ¥KéÞ½»„ àüV’ òùyµZ-III$%%qòäIúõë'ìCà—ññ6þ‹üûÏ’þÜM?î'ÿw¯ú_ÔþUíùKjþ_RâOI‘¯ç>[è eäÈ‘üôÓO$$$xüíûï¿ÏÁƒ}v|™2eHNNvû;vŒS§N\,S˜öDUS$©ñêÏ`xíI´.Ó±D9ÃP]^©ùŽ_ꎊŠbþüùìÙ³‡-[¶ðôÓO»•÷èуS§N¹éÀðáèP¡‹-bÉ’%ÄÅŹ3**Ê7†¤Ñ0a¶mÛFbb"Ÿ~ú)ªÊ‹£}þ¶oOý äÌ™3¼þúë®ß5Š3gÎ`0ÜΓ™™É¦M›8{ö¬Û÷³fÍâØ±c$''ó믿òïÿ›²eË–ý, ãëÉ>ÔŒ¯§òÒ ¿M›6å믿f÷îÝìÞ½›ñãÇ£ÕjUË uëÖ,[¶Œ½{÷ïJXK’þŽ9I’èØ±#=öË—//Tyi§ ùz¢C‡lß¾=ß÷[¶l!66Öëó—6îæ¿ïw”ò Oö/äwP¹re~üñGŸŸ×n·CLL Û¶m‚¾ÇüÒ“ýi4Þ|óM¶nÝÊæÍ›1b’$•˜ò’‚·ñß_ñO)SòßB?ŠGî¦÷“ÿ+íùß½Ú¿’ýÝ/ܯó#Ÿ-ôʲLJJ ›7oöø»víÚQ§NŸŸžžNtt´ÛgþüùLŸ>¬¬¬b¤ÚöDµ€Zü¥Æüš¹ƒO¾Å·çÿM}94”c ÐúGI5Þxã fΜI«V­5j&L yóæn‰âòåËÝt`ÆŒ 4ˆE‹1pà@FŽ @pp0Ó¦MC§Óù¤ýúõ£Y³ftéÒ…N:¡×ëy饗T•GûümßJòIOO§gÏž®ÿ»uëÆÍ›7ó'''‡1cÆpôèÑ|e“'O&::šž={"Ë2o½õV‰ÐÏ’0¾žìCÍøz*/ úÛ±cGfÏžMll,qqqôêÕ‹ª–Oƒ ˜1c“'O¦E‹ 2„ÔÔÔ§¿5bÙ²eܸq‹ÅBFFF¡ÊK;žä[Û¶m#<<œzõê¹¾«]»6¡¡¡$%%y}þÒDAþû~FM~¡dÿfùÝ/„…… !”ÐüRÉþLÓ¦MéÒ¥ Ý»w'66–§žzªÄ”—¼ÿþŠžò75þ[èGñèÏýž•öþÝ«ý+ÍŸîî×ù‘Ïzo޼Ɋ+HLLô˜HMš4‰?þØçÇßIóæÍiÙ²%ÿú׿ŠMjÚï‰nåû±ñÚjöÞØ†Ù‘ÇUËeÖ¦.ÁƒÆH¯JO1¦îG¼Uï#zT€^rÞ-P—çkŒä¹êÃS÷#êE3¼ö$†×~ϵ8ûRäXš‡=Ì_j¼Á;õ>ãÅÈ·ˆ0TpÕÿ^Ù„ë#\ÿ·{˜ç« P̨Úð—oPÎP‰qõ¦¹>É©Bm#cdx³î‡‘­Ãá`èСlß¾»ÝNRR›6m¢Y³fn 5iiiw=¾\¹rœ;w»ÝNvv6ƒüãL:ÕgwÞDDD°k×.rrrÈÍÍ%>>žJ•*©*/ŽöùÛ¾•äc³Ù°ÙlÔ®]›¨¨(®]»ævÅpáÂ…®ÇRRRèÔ©Sí¸pá ”/_¾Xd£¤Ÿ%a|=Ù‡šñõT^ôwúôélÙ²»ÝÎÙ³gÙ°aÕ«WW-ŸaÆ1cÆ vïÞ ÀÅ‹Ý&¥þÖßqãÆ±mÛ6š7o·~èªëV<•ÇÄÄ0þ|æÎKbb"mÛ¶%!!uëÖ¹?–.]J\\ .dß¾},Y²„š5kº-–½üòˬ_¿ž­[·2kÖ,*V¬è*×étLž<™mÛ¶‘’’©S§HJJâÅ_ôÉøF¾Äjµ²qãF·c:vìÈúõë±ÙlªÎÄÇÌÞ½{Y»v-­ZµÊ·˜èI>Lš4‰ÄÄD™8q"&“IUû}1~…ɯî•G}”åË—³gÏxæ™gòýfÑ¢EÌŸ?ßí»ÈÈHöïßïvw¼N§cÏž=T«VMuý:ŽO>ù„½{÷²~ýz—V“_(Ù¿·ò[ºt)111L›6-_ûÔô_I¿<¿0ãs¯(é_HH[¶l!00É“'³sçN6nÜèzêG©eË–eÖ¬Y$&&²eËæÎK“&MTÙ_™2eذa , N:.;¿Ó*¡T¿žìõêÕ´k×£Ñèú¾eË–üðÃ>£5j°`ÁöíÛÇâÅ‹‰ŒŒ,6ûTÊ?”ìï™gžá“O>!77—ììl¦M›æ¦¿þ./êñIII¡jÕª®ÿûõëç6NJù’þ*Å¿7ÞxÃÍnŽ?î6–JöëMþ¦Æßïúá­UÊ?”ôÇ›ü«0úáü@MÿÔä·žÎ_ÔþAiü¼?Wü)oóoä£&ÿV²/oçŶЫ†÷ߟyóæqéÒ¥"=~̘1LŸ>»Ý^:VÛ% 5ër(3©Àßôªø!ºp>?5é)£¬¾<Ý+öw•× ŒbcÚjŽdí£o¥gùïÙO‘eõƒnëÖe:ðÓå¶=)^ IDATÿ1õä›\Ê;Ç“U^PwËžÅg§&°èâ,Ò,—™râ ×Ç!;hW®;MBZ2ë·ùääÛœÉ=A¿*)2™EFFròäI·IÖ<Àœ9sX´h¯½öz½€ýû÷Ó³gO7nŒÕj%88˜„„6mÚä³öüôÓOôîÝ›çž{ŽÐÐPž|òI–.]ªª¼8ÚçoûV’O`` +V¬ gÏžôéÓ‡U«Vxûò§Ÿ~ÚõøOrrrm$‰jÕªDzeËü&‹;õ³$Œ¯'ûð–Ò¢¿’$Q¶lYúöíK«V­X¼x±jùDGGsêÔ)Þ{ï=–.]Ê”)SÜbý­¿S¦L¡M›6û,‡ƒ:¸êxî¹ç?~<-[¶äðáÃ|öÙg®²W_}•^½zÇ#<ÂîÝ»ùôÓO]僦nݺ<úè£<üðÃdgg3`ÀfϞ퓱U+ß‚HHHpKÞ;tèàö±Òùß{ï=Ê”)C»víèß¿?nåJò™4i*T S§NtîÜ™ÈÈH&Nœ¨ºýÞŽŸ/ò3OtèÐ>úˆüãÄÄÄ0xðà|þG§ÓÑ A5j„Fs;5=sæ GŽ¡sçÎnç;zô(çÏŸW݆Q£F±téR:tè@RRãÇW_(Ù¿/ä7uêT–,Y’¯}jú¯¤_žÎ¯v|¼EIÿÂÃÃùâ‹/8|ø0=zôàùçŸ'77WUÿþú׿’““CÛ¶mi×®sæÌÁb±¨²¿ôôt:vìȰaÃHIIqÙùþQ ¥ú•ðdÿpmôñÇóŸÿüp>®~èÐ!ŸO÷îÝ™0a-[¶$999ßøµ}z“ýI’Ddd$ÇgèС 4ˆ£GR«V­Q^\ããM~ ¤¿JñoÚ´i®ò““ãzºK­ò&óä¿ÿ,úáUÊ?”ôÇÛüK~ø3?PꟚü¶0ù‡¯ýƒÒøùÚþŠÛ¿y›?x+¥ü[ɾ¼?”˜…ÞÞ½{Áÿþ÷¿"=>**ŠÊ•+³qãÆR³@¬ E+i¹i»ûmâzÉ@‹°6¬ºü-V‡³#ÕWÞ­ä¼âa½Æ¹ÜRÍ—8™}„›¶ ®Y¯`ºc»…-×âI³\Á.ÛÙucÕê õÍË'ڔ麫?’cwn•±íÚ:ªšjÉËÛúöí‹ÍfsÛï'>>žyóæ1bÄÞyçºvíÊØ±cX¼x1©©©<ûì³ >œ°°0ZµjÅ!C܆7¤¦¦²sçNz÷îMRRf³™}ûö©*/ŽöùÛ¾•äc4Y¶l]»v¥mÛ¶üüóÏ…nÃøñã9xð ›7o&##Ão ÔÏ’0¾žìÃ[J‹þÆÆÆòóÏ?3uêT&MšÄ©S§T˧R¥JŒ3†eË–1dÈòòòܶv(íú{áÂöîÝˉ'غu+©©©œ>}Úíqæ™3grúôil6 .¤E‹„‡;ŸÚxá…øøãIOO`Μ94mÚÔõr£ °yófòòò¸rå ‡rÛ*A‰¯¾úŠ5kÖ¸}æÎë³þߺÃ"$$„€€Z´h¡z&“ÉÄO<ÁĉÉÊÊ"33“5kÖ¸ýÆ“|L&ýúõãÝwßuÝñóÞ{ï1pà@Õ‹mÞŽŸ·ù™Òø¼òÊ+|öÙgìܹY–¹xñ"_}õ•Û9l6;wæ±ÇÃáp¸•}ûí·nûÇÅÅz¢1}útvìØAff&‹/¦nݺªó %û÷V~3fÌ(°}JýW²?¥ó«oíÓ“þó©Š~ø… ríÚ5Μ9£ºW®\¡Y³fÄÆÆb0HLL䨱c…’7(Õ¯ä?<Ùÿ ½5jÔ V­Zh45j¤z¡÷^ÆçÁtŸ¢¶OOx²?½^F£Ál6Ó¨Q#¢££ÉËËÃd2¡Ñhü^^\ãã/ý½“æÌ™Ã´iÓØ¹s§OíÏSþæÉÿYõC­õEþá-jô£¤äwCM~ëÍùýí cþj¿7ùCQΟ”ìËÛùƒŠeÅŠ+2vìXú÷ï,ËEzü£>Zê6üβgb—í„ê¹n½šÿJ…>«l!ÓvÃõ]º5ÍUp[*2òïÿy’ÔUó%²ƒ m0¹öl¯ÚoÒ¤ ¡O¥gÜê̶g  Ââ0ûLV5bìØ± 4ÈÍÙ8p€Îǘ¦NÊG}Ä|€ÝnçË/¿¤M›6¤¥¥±hÑ"FÍ3ÏW¯^%==7nÜuS%&OžÌ×_F£¡K—.¬_¿žN:‘™™Yl²¸›~–„ñõdÞRZô711‘-ZP¥J>üðCš7oîš,*É'--qãÆ¹&?3gÎdûöíÆûBoÙ­,ËnÄÉ“'±Ûí”)S‡ÃADD|ðÛ1ׯ_',,Œììl¶lÙ°aȧbÅŠDEE¹]èQbðàÁEÚÿÌÌLöîÝK›6m°X,$%%‘­..V¯^¼¼¼ïä õ(ŸÀÀ@×áçΠjÕªüöÛoE:~F£Ñ«üLÍøÔªU‹#GŽ(ž§ íSÖ®]Ëßÿþw"""°Ùl´lÙÒíŽ15Üy‡ÚÕ«WÝlW)¿ðdÿááá^ËO©}žú¯¤_·ôØÓùÕŽ¯ìóNý»qã†Û·ÂÚOvv6³gÏ&33“aÆѨQ#™6mGU-oðT¿ÕªUóhÿàù矧jÕª\»v ³ÙLÆ ‰ŠŠR½ï«ñ)JûTò ÙŸÙl&++‹ððpF8_›––†ÃáÀb±øµ¼8ÇÇú{ FÃŒ3صkß|óM¡ì×ÛüÍ“ÿö÷ø—$ý¸›Uò?jòo(Œ~ø;?(5ù­7ç÷·Pkþnÿ½æE9R²/½^ïÕüAMû‹e¡·[·nèt:×~R:ŽvìØÁ«¯¾ª8á+Ìñ­Zµ*uoÊsÈÎå¦Ð84†Í×Öä+¿a»†^2¬ %Ëîœô‡éË"!qÃz`mh¡ë,c(ï¶`l—mëB¹a½€Vʯ6‡• mp¾ïó9äÚsøßù/¸b¾Pdrª_¿>sæÌaäÈ‘nUÄ­ýÚ·oO\\¿þú+‡ƒ£G²zõjzöìéõBTpp0­[·fÈ!\¾|™ &°sçNÞyç<–Ûíö"mŸ¿íûĉû''NÄjµzgOñññLœ8‘zõê±gÏžb‘ƒ'ý,‰ã{§}xKiÒß‹/2oÞ<&L˜à1Q¹S>ǧAƒ®‰æõë×ïúXOiÖßÂpk®óçÏcµZÉÈÈàÅ_,ð. Ó§OsíÚ5FŒÍfcРAn‰OI !!öíÛc±X |óûݸv턆†ÞuQ>33Ó£|0™L”+WÎ5‘©Zµ*’$qñâE·ß–-[‡Ãáuò~çø=ýôÓ^ågj8wîõë×WÔå‚úg6›Y±b}úô!77—5kÖ`6›}:þžü·'û÷6¿Uƒ§þ+é—/ǧ(ü‡júçp8øöÛoùöÛo âå—_fÞ¼y<üðêåc6›)[¶ì=ûì‚êÿã„ðûþ]¸pÁ£ý;ªW¯ÎC=DRR’뉙ÈÈHNœ8Q$ãskoË?Ž¿ìS)þ9r„|Ðõ$MLLŒÛ… —õøX,Ê•+Ç… Îù×û•úR=1zôhÂÃÃÝ^²ì+ÿ¤&óä¿ÿlúQÿªä|ÉÝü_aôßù'JZ~[ÿ.ÎùSIi¿¯ýOaQ²¯àà`¯æj(–çjçÏŸOll¬ëÓ«W/nÞ¼Ill¬ª$¸0ÇרQ£Hö˜+jÖ¦~Oûr=h‹^c ¬¡OU}…2úrX~ÍL¤GÅè$=zÉ@ŠýÙ›± »¬~±¦qh &M zîžd_Ævì²3Yºj¹L‹°‡1jLÔ lÀ#å;>Íz…m05œo•Ö…º^ƶ#}=}+=ëz[€6Ú |&Ÿ&Mš0þ|FíöH8÷f™={6 6D’$Ê•+ǘ1cX±b=ô£Fâí·ß&''‡ððp4 5kּ뛳 KVV©©©ÄÅÅ¡×ëÑjµtíÚ•‹/b·ÛË‹º}þ¶o¥þßÉ™3g¼N.4 }ûö%,,¬È&B…ÑO¯’}xKI×ßfΜITT’$Q¥J àŠjä3gÎFŒáÚðÕW_eëÖ­ù’ÉÒª¿jèÙ³'¡¡¡0~üx¾ÿþ{×¢öüùó™Mxx8>ø åË—Wý²¥úoqöìY:vìˆN§síçdÿ6›“'OÒ§OöíÛÇŽ;èÖ­gΜñéÅÚîÝ»ŠÉdºëøøÓ>•âï7ß|È#&,,ŒaƹÝUêïò¢Ÿ””úõëGPP±±±…~É©ZýõÔ¶'Ÿ|’—^zé®6íRÊßÔøï?ƒ~Ü«U›ø‚»ù?µúáOÿ£DIÈo•üwQÍŸJzû}‘yƒ’}y;PƒÏîèýüóωÅh4ÊŽ;çÛ«omˆ\”ÇߢB… \¿~½ØÌÛöŸËMaþÙÏéZ!ŽÞ•ž!Ãz]é›\wÜ®¸¼®åã]w2É™ûˆ¿ú}¡ÚxÓvƒ¡5Ç¢ ãØÍ¬¼ò­«lÍ•Eü_åÁ4®ÃÑ›ûY~ékÚFts;>Ûv“å—¾f@UçÛ [:‹.Ì"Ãz i+0—Íå…È1è$¹Ž¯ÿ9Þ_AÑét|÷ÝwH’Ä?ÿùO×#999´nÝš7n°bÅ &MšD5e™ï¿ÿÞuµéòå˼þúëäääνê/^ŒÝnçµ×^óÉø2„ &0zôhl6)))nW¶=•Gûü­ßJòñãÆcôèÑ;vŒ!C†ËcïJúéïñU²5ã멼¤ëïÍ›7ùñÇùûßÿNÍš5Ñét®MóÕÊgÇŽ̘1ƒ À¡C‡xóÍ7ï ýUKjj*‹-¢B… ¬_¿žwß}×U6}út²²²øî»ï0 dffòÕW_¹Þ¼½råJ/^ÌðáÃÉÍÍÅl6sìØ1&NœXbîì½páX­V._¾\¨cGŽÉÔ©SÙµk'Nœ`ñâÅn{Æ)Égâĉ¼ýöÛ®w ÄÇÇ3uêT·:n-øX,–BMÂÕŒ_Q³råJt:~ø!¤§§óõ×_»-T)õïÈ‘#H’D™2e|ú*%ÿ]\ö¯„§þ+é—/Ƨ(ý‡JýÛºu+£Frù÷K—.¹Å5ò¹víï¼óÿüç?¸téÆ SuáN©þ[Ìœ9“/¿ü’;w’’’³Ï>‹ÅbQ´ÿðÔSOñÊ+¯ ÑhhÙ²¥Ï38À·ß~K¥J•ذaC¾ñ)JûTÊ?”ìoåÊ•T©R…•+Wº.\ܹO¾¿Ë‹z|Þÿ}>úè#zöìÉ/¿üÂ;ï¼Ã+¯¼¢úÜjõ÷n˜L&¦M›æœ§þáæÎ;“••å•RÊßÔøï?ƒ~xã_Õä¾  ÿ§F?ü•¨ŸþÎo•üwQÍŸJzû}‘y‹’}y;PBªQ£†Œà¾ç¥È±l½¾Žä›{…0@ š¥K—2gÎÖ®]{OÇ/\¸)S¦pðàAÀùÞ—_~ɦM›ø÷¿ÿ-\ÂÇO ú'¿ D~+(=è„þ®N:DDD¸Þ4ݨQ#*V¬èºÂ-(¹ã'ðŽF¸OùO|˜èèh!@ D~+(%ùÓý¿‰­@ @  ”£"@ @ ‚ÒXè@ @ ‚RŽXè@ @ ‚RŽXè@ @ ‚RŽXèðbÇ:4ª¦ø»Ð=oõŠ"JÅo_S©R%víÚE×®]…0B  uëÖtïÞÝoýücýK—.UÕ_ÉÇßý/nÔÊ÷nhµZ’’’HJJâäÉ“ôëׯPå@  dQl ½=zôàÔ©S$''»>ǿ݆ &°mÛ6ùôÓO p•GDDðŸÿü‡ÄÄDâããóMj¢¢¢˜?>{öìaË–-<ýôÓÅ+H†7ß|“­[·²yófFŒ$I…:G“êá¼òh]&þ_c^~´. «„–8…ɳÚ9qù&éYæ’¥Èä_¡B-ZÄ’%Kˆ‹‹sÓ™¨¨(Ñ>„††2räH~úé'<þöý÷ßçàÁƒnß5mÚ”¯¿þšÝ»w³{÷nÆV« 003gÎðú믻~?jÔ(Μ9ƒÁ`p;Off&›6mâìÙ³nßÏš5‹cÇŽ‘œœÌ¯¿þÊ¿ÿýoÊ–-[lòñäJÃøª¡uëÖ,[¶Œ½{÷ïZð) ýó¤jâ‹§øTõ÷õ×_'33Óoò¾×ú ’OiëiÂn·CLL Û¶m+t¹@ @ (YÛBohh(Ë—/'::Úõ™1c†«¼_¿~4kÖŒ.]ºÐ©S'ôz=/½ô’«|Ú´i$''óÐC1dÈÆŽKóæÍ]“ð7Þxƒ™3gÒªU+FÅ„ \åÅÁàÁƒiÚ´)]ºt¡{÷îÄÆÆòÔSO©>¾UkZ™u/óáOɬÚw‘rÁƧ0›ƒ“Îs9#¯DµË“ü Ä¢E‹8p #GŽ 88˜iÓ¦¡ÓéDûT Ë2)))lÞ¼ÙãïÚµkG:uò}ß±cGfÏžMll,qqqôêÕ‹ºÊÓÓÓéÙ³§ëÿnݺqóæÍ|çÉÉÉa̘1=z4_ÙäÉ“‰ŽŽ¦gϞȲÌ[o½Uù„ÜÜ\²³³™6mÏ<óŒªcµ‰.+ñý®³¤¤faµ;8=‡­Ç¯º~cÒkÝ£!†>-ªòV¯(Fvk€^ëˆ#ÿS‘Ý0®O4Ï<Iñö"Ë‹ëÐ<² CÚ×f\Ÿh†v¨CÄ’5‰'ZVc\ŸhFvk@µ²®²!íkóvïhÞîͤ¸&4¨’¯ *‡òÊ£uy»O4ú֧eíˆ!ÿråÊqîÜ9ìv;ÙÙÙ þñ0uêÔ|wžþYÛ§ÄÍ›7Y±b‰‰‰þ&,,ŒI“&ññÇç+›>}:[¶lÁn·söìY6lØ@õêÕ]å6› ›ÍFíÚµ‰ŠŠâÚµknw\.\¸ÐõøpJJ :u*°.\ !!òåË‹l”üOi_%† ÆŒ3ؽ{·ËßZô/ ýó¤JñE)>•4ý‹‹ã‡~@–e×w)))T­ZÕõ¿~ý˜?¾ëÿ²eË2kÖ,Ù²e sçÎ¥I“&®ò¶lÙB`` “'OfçÎlܸÑí©OõÔ¨Qƒ °oß>/^Ldd¤jù,]º”˜˜¦M›ÆÞ½{Y¿~}ñýnõët:&OžÌ¶mÛHIIáÔ©S$%%ñâ‹/ª:`` “&M"11‘ÄÄD&NœˆÉd &&†ùóç3wî\iÛ¶- ¬[·Ž°°°ßc«†—_~™õë׳uëVfÍšEÅŠU©ÒøÜêã'Ÿ|r×ö{[¿@ @ (=ÛBoXX<ðsæÌaÑ¢E¼öÚkèõzWùO?ýDïÞ½yî¹ç åÉ'ŸdéÒ¥®IŠN§sMš>Lýúõ ¬/22’“'OKß$I"22’ãÇ3tèP ÄÑ£G©U«–ªãˇÑj$N_Íöø»@ƒ–±‘\º‘ËëNðõÖÓXíçbK°‘”Ô,¾Xw‚V sc÷‰\«:ü´÷SWáÒ\úµªîVþh£Šìû-ÏÖãLZ6ÝšVv•ýwÓ)>\‘̇+’¹œ‘›¯mõ*…ð-«±öÀ%¦þ”Ì×[C[LÚ¥$ÿýû÷Ó³gO7nŒÕj%88˜„„6mÚ$ÚçCÞÿ}æÍ›Ç¥K— ”CÙ²eéÛ·/­ZµbñâÅn )+V¬ gÏžôéÓ‡U«VxûBÃÓO?íz|899Ù£¬«U«F\\Ë–-ó›,îô?÷ÃøFGGsêÔ)Þ{ï=–.]Ê”)S\ ‘¥¥韚øâ)>•4ý‹‹sk›þú׿’““CÛ¶mi×®sæÌÁb±¸ý&<<œ/¾ø‚ÇÓ£GžþyrssU×ß½{w&L˜@Ë–-INNæ³Ï>+”|¦NÊ’%KèСIIIŒ?^uÿLݺuyôÑGyøá‡ÉÎÎfÀ€Ìž=[Õù'MšD… èÔ©;w&22’‰'ºÊyä¾øâ ˜û,‡ƒ:ðꫯҫW/âââxä‘Gؽ{7Ÿ~ú©OÇgÔ¨Q,]ºô®í÷¶~@ @Pz(¶…ÞøøxæÍ›Çˆ#xçwèÚµ+cÇŽu•§¦¦²sçNz÷îMRRf³™}ûö››Ëž={x饗 ¢yóæL™2… *ܵ®¾}ûb³ÙŠm?9½^F£Ál6Ó¨Q#¢££ÉËËÃd2¡Ñ(‹8À %ÏjwýÿxL5×ݳwÞ•kÒkùõL:»O]'ÛlãzÖí‰Þ±K™8{™ò!FÒ²,Tr«g뱫\»iÆáÙ}ê:Õ# 0ܾëlCr*§¯f“gµ³ç·tʇªß:¢]à ¬?|…ß®f#9vœ¼V"ä¿xñbRSSyöÙg>|8aaa´jÕŠ!C†¨Ÿû½}¾ wïÞDDDð¿ÿý¯ÀßÄÆÆòóÏ?3uêT&MšÄ©S§\eF£‘e˖ѵkWÚ¶mËÏ?ÿ\è6Œ?žƒ²yóf222ü¶ÐøGÿs?Œo¥J•3f Ë–-cÈ!äåå¹¶Þ)-ý+HÿÔÄOñ©$éoLL ©©©…ÞãöÊ•+4kÖŒØØX ‰‰‰;vÌí7¡¡¡üðÃ,\¸k×®qæÌ™BÕ?sæLNŸ>ÍfcáÂ…<øàƒ„‡‡«nãŒ3رc™™™,^¼˜ºu몮¿AƒlÞ¼™¼¼<®\¹Â¡C‡¨W¯žªó›L&úõëÇ»ï¾ëz"ã½÷ÞcàÀ®‹Õ.\`ïÞ½œ8q‚­[·’ššÊéÓ§]^xá>þøcÒÓÓ˜3gM›6%(È£¿úê+Ö¬Yãö™;wn¡ÆgúôéÊG©~@ @pÿPl³ð°víZ²³³IIIaêÔ©<öØc®ò9sæ°uëVú÷ïO»víÈÍÍeÊ”)®òaÆQ®\9,X@¿~ýøüóϹxñb¾z5jÄØ±c=z4‡£Xúf±XÈÊÊ"<<œQ£FñöÛoS¶lYÒÒÒTµ!=ÛJ°I‡æ÷w·-K:χ+’Ñi%þø:·ä w=GQGÿÖ5x¶MMšÖ(ƒF’Ðk ~ÜÕ›f²Là É6ûí¶fåYÑiÕ¿L."ØÀå¹~Qb%ùÛív¾üòKV¬XAZZ_|ñ .¤víÚn/ú³¶Ï[*V¬Èرc3fL¾Çµï$11‘-ZЩS'^|ñE·—1\½z•ôôtN:u×ýM•˜`Ó¦MlÚ´‰7rýúu×BðàÁƒéÞ½»Ûç…^(ÔøÔ~5õ @ ‚û¿Þne³Ùç‹{Z·nÍO?ýÀåË—™0a½{÷vísxùòeÞxã üqÆõ\cž IDATOdd$GŽq;_ýúõ™3g£F*¶mnqäÈ|ðA×ÿ111ùÚW¹V2s­4ª~Ïõ÷kU”Ô›|µù4 /q¸€á[” rÞ‰t#Ûâ“þ§g[¨fò›.)É¿}ûö 0‡ÃÃáàèÑ£¬^½šx@´ÏKºuë†N§ã‡~`ÇŽ¬\¹’vìØq×"^¼x‘yóæÑ§OŸ|e'NäÃ?ôª=‡ƒøøxòòòòݵW”xò?¥y|Ž?Nƒ \ÿ_¿~»Ý^*ûw7ýó_Ôħ’ ¿tèÐÕ«Wç+³X,”+WÎõ¿Á`ÈWç·ß~Ë€hݺ5GŽaÞ¼y…j·§úÿHµjÕ8þ¼ÏÆÕSý§OŸæÚµkŒ1‚~ýú1hÐ ·…[O\¸p“Éä&¿ªU«"IÒ]/6ÿ‘ÌÌL222xñÅiß¾½ÛGÍñÞŽOaê—e9ŸN¦\ @ øŸbYè wÝ"IåÊ•c̘1¬X±€¬¬,RSS‰‹‹C¯×£ÕjéÚµ+/^t-&´iÓ†ˆç˽š7oÎk¯½Æ¿þõ/WMš4aþüùŒ=š;w» ¿ùæFŒApp0aaa 6Œo¾ùFÕ±²,“pð2½šW¡NÅ`´‰je]/ZSC™ Éùû°@=íæßÖ¢qõ0Lz-z­†nM+³ï·tìÙ'ýßqò¢+º^àdÔѹqE´Éïò衇\wÒæääŽF£¡fÍš¤¦¦ŠöyÉüùó‰u}zõêÅÍ›7‰eß¾}„„„0sæL¢¢¢$‰*Uª0`À€|wÔœ9sFõâGNM£¡oß¾„…ý{wU¹ÿüsfa†A÷\L)ÒJ±2ÍÔºpõW.éMÍ%T\n’š™™Ûµ”Ê®Iæ’\7Ô”­ÜQÉ­Â MM@EQ¶aöß““0çàŒÈàçýzõz%gÎ9Ïó=ÏóÌs¾s_œ9s¦Jb`oüqõã X®h3fŒõ¹¼#FŒÀÞ½{¡Õj«}ý¤´?{ß/R¾ŸªCûíÞ½;víÚ…’’’2˲²² OOODEEY_Bv[BBÚ¶m AP\\Œ .TúŽ{û¿½ÜÇÇjµ“'OFJJ ôz½Ó޳½ý÷éÓ?üðâââß~ûMòv5 6n܈wÞy*• jµS¦LÁºuëÊ<'×Þ9sæLë Ð|}}ñÄOH.ƒ£ÇGêþ/^¼ˆèèh( k¨Ìr"""""ºÿU±“›7obË–-˜>}:6l³ÙŒ””ë3`ðàÁ˜2e ƃÁ€¬¬,›·ž‡„„`Ú´iðõõENNâââ¬WÍ) ¬^½‚ àã?¶Þ²XRR‚ÈÈÈ* djj*‚ƒƒ‘šš Àò̽Ê<§ñ·‹7a4™ñ|›z¨í­Âõ"-6¹Œ"­AÒúßü’èÐ@<Õª®Ü*Åþ³yèló™B¯wnow2³ ðÍ/ÙN«Æ¥› –ç {ª(Ñžu&'%’‰nn.FeM$&&bíÚµ09r$Ë'Á‚ •J8p]î ™lÚ]a!6n܈iÓ¦¡qãÆP(Ö—9SBBÆÈÌÌÄàÁƒQPPpïQ‘ñÇޝ˜ 11«V­‚»»;Ž;† &¸Dû•Òþì}¿Hù~ªí·OŸ>¾`kÆŒ˜;w.zôèŸ~ú o¿ý6†n]¾wï^ÄÇÇ[ã“““Sécgoÿ€åñMÿûßÿ„;vàÝwßujüìí?55k×®ÅèÑ£¡Ñh Õj‘™™‰©S§Jº²wêÔ©˜4ivîÜ Àò‹9sæH.ÛÂ… QTT„Õ«WÃÍÍ X¶löïß/i}GÔý/^¼‹-Bzz:²²²Ð¿›d¶Ør"""""ºÿ„† š†šoht3¤¾†—  "¢$$$_}õ:wîÌý—#99³fÍBFFÀßß‹-®]»ðÙgŸ±Q¡`e_íFDD®.66)))Üyß{‚€fÍš! jµ2™ aaa¨[·®õ ]"""""¢š‚Wô> †F7þÓy¢/i#""ªIZ¶l‰!C† Y³fÐëõ8uêV¬X¬¬,‡ˆˆˆˆˆj&z‰ˆˆˆˆˆˆˆˆˆ\œŒ! """""""""rmLô¹8&z‰ˆˆˆˆˆˆˆˆˆ\½DDDDDDDDDD.މ^ n†°ú¾¢ŸóqWâß/†"TÂg‰œ-((?ÿü3ºvíÊ`Ûo"##ѽ{÷ûVÏÊîýúõ÷µ¼U¿ž={bÍš55¶|÷‚ ðôôä B÷L­ZµðùçŸãèѣرcèðø-—ËqèÐ!:tgÏžEllì=éÎèUU¿û=þß_g”Ÿˆˆ¨:rZ¢×ÇÇcÇŽÅæÍ›±mÛ¶²;’É0aÂìÝ»»wïÆ˜1c ‚uù#<‚+VààÁƒ8xð &Ož ¹\^î¾f̘ŒŒŒ2ÛŸ2e ÒÒÒ°ÿ~|øá‡pww¯º@ŠÔOŠ6 ü0ü™‡0õå‡ñÆ3¡U°Oµk0¥z#Îä"¿H[½²øbÍš5X·nbbb¬ë„††"44”ås±þko¹‡‡.\¸€Q£FY? .ÀÍÍÍf?صk.^¼hó÷Ï?ÿ™™™8qâ~ùå|öÙgð÷÷¯²úÛÿjÂñuõú‰}?…††bùòå8|ø0öìÙƒW_}Õfù /¼€sçÎáĉÖÿF]mÛï¨Q£PPPpßâ}¿÷_ÓËïêñ½õêÕÃÆ9k§{fìØ±ÑÑÑxþùçñõ×_K¿í1ˆˆˆ@DDÒÒÒªuÿ¨Îõ»Wª¢üøïÿ‹ýû÷cëÖ­e’Úbç¯bók{ó©çב‘‘Ø´iŽ9‚­[·Ú$¼ÅÎoÅæWbçïb峿ZµjÙÔûĉÈÌÌĹsçàåå%9`¯~bËÅâïèúbóSGÏÏìm_J|ÅÊ/ÖþÅÚŸØr±ú9šëŸbõkŽÖßÞöqüͯ‰bñw$¿(¥þŽö¯êNᬠ™ÍfdeeA¡P”ûkð AƒðÈ#à¹çžƒL&CRR®]»†ääd@tt4–,Y‚}ûö¡~ýúX³f ~ÿýw¬ZµÊf;O?ý4š5kVfû±±±h×®ž{î9˜ÍfÌ;Æ ÃÂ… «$bõÓ¾Yžnˆ/áâõÔõU£qíêwõŠÎ`ÂÆCT»rÙ‹ÿÀ±fÍ|ýõר¹s'RRRàåå…ùóçã­·Þbùœ@¬ÿŠ-ÏÏÏG=ðé§Ÿºuë†ÂÂÂ2û)))ÁĉË-ÃÌ™3±bÅ Ô¯_“'OÆ¿ÿýoLš4©Jêooü« Ç×Õëg¯ü2™ ãÇÇâÅ‹‘žžŽððp¬X±'OžÄÑ£G­¯¿þñññån¿:µßzõê¡iӦطoß}KÈÝÏý×ôò»z|ï–¯/ï"¢{+,, _~ù%nÞ¼i™ïêt’ÇïšÐ?ªsý\ÙüùóqäÈ >ÁÁÁHNNFnn®u~!vþ*6›Ÿˆ­ß²eK$&&âÍ7ßÄÁƒŒ‡zHòù­Øù¿Øù»XùìÅ/??­[·¶ÙÞÛo¿ââbIÚ¿XýÄ–‹Åß‘õ¥ÌO9?Û¾”øŠÕ_¬ý‹µ?±åbíÇÑü“Xÿ«¿Xûs´þö¶ïŒãçh~Ml|‹¿#ùE±ú;£UwN»¢·°°[¶lÁþýûË]Þ¯_?üç?ÿF£Aqq1æÏŸ~ýúY—/\¸{öìÑhÄÅ‹±cÇ4hРÌDfúôé˜7o^™íàçŸFII 4 ¶nÝŠ   * ¤Xýì‘Ë<÷pR~¾ˆ¬«EÐMøãF öž¾fýŒZ)øZÁM!C¯Gëãß/†bl·–PÊ-‡0À[…—#B0¶[K$ôj~ÁSõWht3„7ª…Áš"¡Wk éÜ ^ª¿}¡øÇã!HèÕc»µDˆ¿‡uÙàNM1©gkLêÙÓcÚ e=ﲃU= æ!LêÕq][àñ¦Õ"þµkׯ¥K—`4Q\\ 777|ðÁ˜3gN¹¿¬=ˆås”Xÿ[n0`0дiS„††âúõë6¿è%''[o¯ËÊÊB—.]*,ËåË—±mÛ6Ô©S§Êêooü« Ç×Õëg¯ü&“ C† Á¾}û`4qèÐ!ìÚµ íÚµ³~ÆÇÇyyyn¿:µß˜˜lذf³Ùú·¬¬,Ô¯_ßfâ¶|ùrë¿ýýýñùçŸcÿþýسg¾øâ ´iÓÆºÜÛÛ{ö쇇fΜ‰ôôtìܹ³Ü_õËÛ¿Øö@¡Pà?ÿùŽ9‚íÛ·ÛÄ¿I“&˜;w.¶oߎ#GŽ`É’%\>™L†7ÞxÛ·oÇÞ½{ñù矣nݺ’ãÏ<ó ¾þúk>|Û¶m³ù~÷ððÀôéÓ±ÿ~ìß¿S§N…Z­¶.÷ôôļyópäÈ|ÿý÷hß¾}™“¹šR>g«U«vìØU«V¡Y³fÖ~tèÐ!Èår4mÚGޱ¹z^ìÛ·7`¹5<&&ÉÉÉ8zô(Ö­[g]æŒú) Ìœ9iiiÈÊʹsçpèÐ! :TÒþÅú§±í‹õ±ö!Ö¾Äâ'Öÿ¥Œ÷RBBÒÒÒŽÙ³gÛ´/)ã·£íG¬ÿ9Ò?¤±ú‰¿ÎàÈø¿~ýzDDDXJ_ß‘ø:z|U*:tè€E‹²³³ñÉ'Ÿ`ذa’Ï_ÅæÏbó±õãâ☘ˆƒZ˸{÷nÉç·bçÿbçïöÊ'%~w Çã?ŽO>ùDòþÅê'¶\,þެ/e~êÈùYe·_^|í•_ÊñkbËÅÚ·£ù'±þ)vüÅÚŸ£õÛ¾#ÇÏù5±ñA,þŽæíÕßýËáD¬È÷‹Ø÷›Ø÷c•<£W4jÔ§OŸÆ!C0pà@œ:u Mš4)ó9ôîÝíÛ·ÇÚµkm–Ϙ1K—.ENNN™}lÞ¼={öÄ€àããƒþóŸX¿~=ªSý*RÇ[¹LÀùkÅv?çá&GߨFȹ©Á§?œÁнç¡7š,É/²®áÓÎ`nêIÀ³ÛNDÚ7 Àæ#—1'õ$rnjÛÞ6‘þLX]ý=}—‰ yÅèöH=ë²/wÃì-'0{Ë äÞÒ”)[ó o¼üx¾ÿ-s6ŸÀн¿C^EO€‹ÿ¯¿þŠ=zàᇆ^¯‡——¶mÛ†]»v±|N®§½þko¹‡‡¶lÙ‚=z W¯^øæ›oàáñ× ¯¾úªõöº'NØ-CHHbbb°iÓ¦j—šr|¤ú5jÔgÏžµ™DµmÛIIIX³f FŽ ¥RY-ÛoLLL¥¿ûÞ|óM”””à©§žÂÓO?¤¤¤2W³ùùùáÓO?ÅñãÇñ /àµ×^ƒF£‘´)ÛÇúõëѹsg:t“'O¶.kÚ´)ÒÒÒУGDFFÆ/¹|#FŒÀ‹/¾ˆ˜˜<ùä“8xð >üðCÉñëܹ3æÎ‹>ø4hÍñŸ>}:Ñ¥K<ûì³hÔ¨¦Nj]þÞ{ï¡V­Zxúé§Ñ§OŸ2I’šT>gËÏÏGtt4âââ••eíG08wî222lnŒŒDNN~ÿýwëß €É“'ãñÇÇñãÇñÑGI®ßÊ•+±mÛ6›ÿîLÄ4=ôžyætèÐÅÅÅèÛ·/–,Y"iÿÎ ¶}{ýC¬}ˆµ/±ø‰õ)ãý4kÖ,tìØ3fŒMû’2~;Ú?ÄúŸ#ýCÊñ«Ÿ”ñ×QŽŽÿsæÌÁºuëÊ]ß‘ø::>Èd2( ›+®?Ž-ZTêüÕÞüYl~"¶~ëÖ­qîÜ9¼÷Þ{X¿~=fÍšeý¡ÙÑó[)çïöÊ'%~wš8q".\hÓöíí_¬~Rêo/þŽ®/e~êŒó3©Û//¾öÊ/åøÙkR–Û«Ÿ3òObýSÊñ³×þQ±þu·Ç¯ªòk•iŸŽäß*í_Ž2°÷ý&öý¨¨ŠJ(•JÈd2hµZ„……A«Õ"99jµ2™ &“%Y…O?ý:t(Î;gÝFÏž=€¯¾úªÜ_R¯^½ŠôôtôìÙS§NÅÎ;«ì²k©õ«ˆ»›¥ú¿ÝK!hUÏò|Þ·F±ÖP+åøåB>2.Yn++¾ã1¹™9–çõ)äêx«W¤Có Û«n÷f^ÃõBËJÏÝÀÍkÃÝMβï'®Z“͇ÏG¿$ÇàéVØ~ü ~ÿsý[%:8{½ZÄíÚµxã7пŒ=¾¾¾hß¾=êÔ©ƒåË—‹Ÿš^>g±×Å–«T*lÚ´ K—.… xýõ×ñÁTjÿ·ow÷ððÀ·ß~[m5åø>(õëÝ»7 ƒÍóú¶nÝŠŒŒ ìÙ³AAA˜?>üýýñþûïW«ö«W¯Vê‹påÊtéÒQQQ8xð`¹¿œûøø`Æ زe àúõë’÷/eû .ĬmêÎ$ÙO?ýds³fÍpîÜ9têÔIrù^ýuŒ;ùùù€¤¤$Œ=žžž(..-ÿðáÃñÑG!==€åŠŠeË–Y¾—ÕjÄÆÆ"**Êš8yï½÷°cǼûî»ËåøÇ?þ:Xo•ûî»ïпÿW¾Š,[¶¬Ì¼-;;¯¿þº¤åR¶?bÄë3UËK†/^¼çÏŸ`¹‚qðàÁðóóÃÍ›7Eë7`À»ûoÙ²%vïÞÒÒR”––âØ±chÞ¼9²²²$íßÑøIÙ~EýC¬}èõz»íKJûëÿRƇûÙ¾Ä8Ò?ÔjµhÿsFù¥Œß‘2þ:Ú~ÿË]_J|=¾öÆFƒÃ‡cذaHLLD‹-0mÚ4VêüÕÞüYl~"¶~PP&Nœˆ÷ßóæÍøq㘘ˆW^yÅáó[)çïöÊ'%~·…††¢^½zعs§äý‹ÕO¡PˆÖß^ü¥ÄOÊñ³7?uÆù™”íW_{å—rüìµ?)ËíÕÏù'±þ)vüÄÚ¿£õ—Ò¿îöøUU~Mjût$ÿVQýí_ŽÎ?¤Ì*ú~“òýX%‰^N‡¢¢"øùùYŸˆ¼¼<›ƒ°ÿ~<úè£ÆìÙ³ŽÄÄDÔ­[o½õúôéSævÅÛ’’’°qãFlÚ´ AAAHHHÀ¬Y³ªä‘RëWá/òÅzx© €É lúó¸S^ Ãß_çvâò­r·á©R G»`x¨äÈÎ/…L ”Wü2¸k…Z˜Ìfx¨ÖD¯ÁøWY‹JõPÈ¥¿L.ÀË ¹75÷%1#%þ‹-BÇŽ‘——‡5kÖ`ܸqèׯbbb°nݺº|ÎRQÿ•ºüÚµkÈÏÏÇÍ›7Ë}¾©˜ÛÏ8•Édxî¹ç°}ûvtéÒ徿´Èh4Öˆãû Ô/,, o½õh3vÿöÛoøí·ßXn³ž3gæÎk3¯í·OŸ>wï%K–   qqq Ãþýû1þ|œ:uªÌ„ðnö/eûw^ÁwíÚ5¨T=Z( Ó¦Mƒ¿¿?Ž;¹\^îc#Ê+ŸðþûïÛÌnܸ___›DLEåoÒ¤ Nžm98^ABø¶Zž–Ëòo;çö¸üb}Õ÷-A#ÿN:¡oß¾0™L0™L8uê¾ýö[´mÛ–ås²¿÷ßÊ,Ÿ:u*fÏžíÐþoÿB^ZZŠæÍ›W‹˜Ô¤ã[Së×¢E $%%!>>^Òm;ƒ¡Zµ_wwwtîÜß~ûm¹“¡Úµk[ÿ}çóLoïóÿûúöí‹ÈÈHœ>Þú„€€L˜0J¥7nÄ;5JµZ)S¦`ݺuÐét¸qã~þùgLœ8 …õêÕÃk¯½VãÊw¯?~~~Ö }:ulN4Ö­[‡nݺ!&&)))eÖïÑ£|||àîîŽÉ“'#%%z½^Rý €®]»ÚüwgŒúôéƒ~øqqqˆ·^#uÿbýS {Û·G¬}ˆµ/)ñëÿÎî'©ýãâÅ‹ˆŽŽ†B¡°>'VJÿsFÿpô‡)ãoyõ«Êý—§2ñ­¨üŽŽ;v´n/<<#GŽ´¾ HìüUlþ,6?‘2ÿNJJ˜1c¬Ïý1böîÝk½ZÒ‘ó[±ów)峿;5lذ̕Ûbû—R?{Ë¥Ì]ßÞüôNK—.ņ ¬}Eêñ—ºýòâ+¥übÇO¬ýÙ[.¥~ŽäŸÄú§Xý¥´?Gê/eûŽ¿Êä×ÊkŽæœ™+¯þ•iÿ÷{þp·ßN{t •Jë³$¢££¡ÑhššŠàà`¤¦¦Z'Ž?þø#Ëõ6n܈iÓ¦¡qãÆP(ضmfΜ)yÿƒÆ”)S0nÜ8 deeUøVÎ{Á^ý¤øíâMMf<ߦj{«p½H‹ÍG.£Hk´þ7¿d#:4Oµªƒ+·J±ÿlz†Û|¦PcÀë›ÁÛ]Ìì|ó‹ó®ÆÉ¸t2Áò|aO•%ZÒ³®Ãä¤D²#ñÏÍÍŨQ£¬'ȉ‰‰X»v-ŒF#FŽÉò9H¬ÿ:£K‘€qãÆ2331xðà*{lƒ½ñÏÕoM¨Ÿ½òëõz¬^½‚ àã?¶ÞSRR‚ÈÈHܼy[¶lÁôéÓѰaC˜Íf¤¤¤Hº­¨*ÛoŸ>}*|ÐŒ30wî\ôèÑ?ýôÞ~ûm >ܺ|ïÞ½ˆ·öÏœœœJ;{ûwtûï¾û.FáÇ#33_~ù%f̘!yý… ¢¨¨«W¯†›› °lÙŠ ½‰©IDAT2›gÚ+jj* fÏž€€äççcÅŠÖ«¦NŠI“&YŸýµuëVÌ™3Ǻþرc1gÎüüóÏ8sæ Ö®]‹˜˜˜U¾{íúõëxûí·ññÇrrrgýa¥¨¨?þø#ºu놽{÷–YÿêÕ«X³f ±}ûv¼ûî»N«_jj*Ö®]‹Ñ£GC£Ñ@«Õ"33S§Nµ^ÙkoÿbýS {Û#Ö>ÄÚ—XüÄú¿3ÆŸûIjûY¼x1-Z„ôôtdee¡ÿþÐét¢ýÏýÃRÇߊêWUû¯ˆÔøVT~GLJL›6 ¾¾¾ÖãrçUcöÎ_ÅæÏbó)óï 11«V­‚»»;Ž;† &H>¿;ÿwäüAJün Ä7œ~þno¹”ù¡#ë+ »óÓ;)•J<öØchÕªŽ;&)¾•Ù~yñ•R±ã'Öþì-—Ò~Í?ÙëŸÎ8?p¤þ•q·ÇOj~­¼ö'6>H‰¿#ùE±úW¦ýßïùÃÝ~? 64ƒj¼¡ÑÍvúN\.`0ˆˆj|õÕWèܹó¹ÿš^~WoU™0aAÀ¼yólþ¾~ýz$%%Uê–ïÊHNNƬY³‘‘ð÷÷Ç¢E‹°k×.|öÙg÷|ÿ÷zûDDTýݾ…ûö‹9‰Øþl †àÁ!@`ˆˆj˜ØØØroWPö_ÓËïêñ­ áááxùå—Ñ­[·òç?½™ÿ‚€fÍš! Àú¦ç°°0Ô­[׿íÎ÷jÿUµ}""ª¾ €?þøƒI6bû#+&z‰ˆˆ\Ø‚ èý×ôò»z|ï%¥R‰Ý»w£´´“&M²û¶{Ál6càÀ2dF ½^S§NaÈ!ÈÊÊâ""¢{êÑGE§N*ýÈ"¶¿šn """""""""rq2†€ˆˆˆˆˆˆˆˆˆÈµ1ÑKDDDDDDDDDäâ˜è%"""""""""rqLô¹8&z‰ˆˆˆˆˆˆˆˆˆ\½DDDDDDDDDD.މ^""""""""""ÇD/‘‹c¢—ˆˆˆˆˆˆˆˆˆÈÅ1ÑKDDDDDDDDDäâ˜è%"""""""""rqLô¹8&z‰ˆˆˆˆˆˆˆˆˆ\½DDDDDDDDDD.މ^""""""""""ÇD/‘‹c¢—ˆˆˆˆˆˆˆˆˆÈÅ1ÑKDDDDDDDDDäâ˜è%"""""""""rqLô¹8&z‰ˆˆˆˆˆˆˆˆˆ\½DDDDDDDDDD.މ^""""""""""ÇD/‘‹c¢—ˆˆˆˆˆˆˆˆˆÈÅ1ÑKDDDDDDDDDäâ˜è%"""""""""rqLô¹8&z‰ˆˆˆˆˆˆˆˆˆ\½DDDDDDDDDD.މ^""""""""""ÇD/‘‹c¢—ˆˆˆˆˆˆˆˆˆÈÅ1ÑKDDDDDDDDDäâ˜è%"""""""""rqLô¹8…36â5ãÓ:ˆESG1~ŒŸËÆñe|‰ˆˆˆˆˆˆÈµMÅ+z‰ˆˆˆˆˆˆˆˆˆ\½DDDDDDDDDD.މ^""""""""""§¨V¥1›aÖi!¨Ô<2Œï½ AÁM”üw.T=ÿŠÐG,4™Pûì3$''ÿun4B÷ãf~= …4ªk/ÈêÖ—\Ó­|”~õ<Þœìr‹DFF"!! 6ĵk×°dɬ_¿ÞiñsåøŠÅ/ 3gÎDÛ¶mQPP€ à»ï¾³~®ô«Ï ofM Μ€îëd¸¿1‚·ï_T»CѼ5dþýM&ƒç[³šåå¼Kl¹ ÄÏÇÇÿú׿ХK¨ÕjtíÚõoU”aܸqx饗`2™’’‚ÄÄD˜Íf›öiÌ8 3e»H¸uéÈ*yS@yñ¯íS,¾U1~Þk¦ì‹ÐnÝSÎ%>~P¶ ÊöO;uºßB€cÞংY§“Ü~ˆˆˆˆˆˆˆt6Wôæææ"*ªì•Š2™ ãÇÇâÅ‹‘žžŽððp¬X±'OžÄÑ£Gú´Ÿ`<{îÿ™· §OÀ• ·J$*Ìš—fEñ€–-["11o¾ù&<ˆàà`<ôÐCÖåΈŸ«Ç×^üæÏŸ#GŽ`øðáFrr2rss­íïN¦¼+ÐnX õ«Ãl“¼7T/÷¯‘Ù^üÌf3²²² P(Ê$!`РAxä‘GðÜsÏA&“!)) ×®]³&#ußo€)÷¨‡Ž‡`6C³v)ÌFTÏ¿\©2Ú‹¿+·O{ñ­ªñó^2^¾€Òeí{,”¯ƒ©ðô‡÷&# “;m?¦œKPFu†àîii/ÿ9JÒ£L&† bý÷¡C‡°k×.´k×Κ¨0]Ɇ<¤1dµëZ6Üæ1Û˜ÍЧýýá}0 × êž¼}a.)†fÉ|K¢§´Ås¬«yNœ Èd(~w4<ƾ ÁÏ ?z†ßÃýµQMÒ‡PFt„þh:LW.CV'ª—úCP§Z:..‰‰‰8xð ;;Ûz¥¯”ø™uZè~Ø ãÉ_-WT†…ÃíÙ^€Riù€Vƒ’OgÃýÍ·¡Ûº†S”np•èõ¢ñ­ÎT*:tè`mƒÙÙÙøä“O0lØ0Œ1ÂöÃÚR”®Z ·®½!oÐÄúgÍ—‰0]ÍùóÅP¿: ò?0½°°[¶lÁ7ÊMôöë×ñññÐh4,‰õéÓ§#99æâ"è¥ÁcTd¾µê—úA³xT»*µxÿ´)ýß•ãëŒñÓtý*t{¶ÁtáÌšÈ6ª÷«<½aºq šÿ΃ç[rËn6QòŸÉðxãß–cbgü•B·u#Üž~ÊG-‰n™Jm“äŸ4I­ëK0JƒáôqîPÅ „<¤±¥ÛnÛCÆa˜ nÁt%ÚoÖÙÑþk2BûÍ:N‡¹à3/¸=ù,”Ÿá7==îú½5²¹õXÑ®=´«“ ¨ÔPvèÁÇÏ6Q°gŒ'~…ûÐñ<<¡Kû ¥)+à>(‚‡'<Ƽã¹Lh¿]×·nëÒwCû¿è¾ß€Ò”åð6¡ZºuëÖXµjÞ{ï=´nÝgΜÁ‡~ˆk×®I‹ß7ë`Ö–Â}Ì;€É íúeÐ~ŸUÏÿ³~Ƭ)F隥P„¶G—0kK!(Ý¥›Sâ{¿Èd2( øúúâúõë€ãÇ—MòšMЬ]j‰áßž¡ë>x´õÿ5ÿËžAШQ#œ>}C† N§Ã† Ф‰%Qnºš™§—5 ²Àz€› Ƽ+×o$º{ñwVÿw%•?MyW¡hÚ ò} Èä(]“ÝO©Põz2ÿ:Õ‡áTaáã™Õ­oM¼ÛE™L0^<õË*{%ŒOÚM«àÖ³/Ü^ˆ…öûè¶n„ûëñU×— êúJσ*º{™aÄú¯îÀ.˜®åÂsô;0—– $qÜ_kÓf‰ˆˆˆˆˆˆj:›Kå‚‚‚‘‘aýoذaå®Ô»wo ¤¥¥ý•¨hÞ#&Áx#ÅNƒöëd˜5ÅÖåú}; |¶'Ë-¹nºÀtùÌÚR§UÆí©ç „ —Cùø“0]:oS†{Í^ü‚‚‚0qâDlÚ´ ƒFii)¥ÅO¯‡þè¨zü‚Ò ‚J·b`8¼0­Û0—j l×ʈ'!xzCæ_Ç¥cEñÓh48|ø0† OOO„‡‡cÖ¬Y ´Y_—ö`ÐÃtëL—Î?pYjÿý;¥R ™L­V‹°°0´nÝ¥¥¥P«ÕÉd0Þþì·w<½ÿ¼z’ñ­Œ»?-†â‘‚S^.„Úua¼£+#:ÂðKºõ߆_Ò¡xô §Œ¿æâBÀh„àíSþ$ŽOÊÎÝ¡hÒ‚ÚÊG;Àt-×iÇÆt%ò‡B¥‚·/dÁ þº˜ˆˆˆˆˆˆè!é½w Ã[o½…Âd2Ù,jÂýÕa0]¿ í7ë Yò!<â¦À¬-…¹¸º-k îø¼§Ì¥*µÓ+&«Èd0—[Ÿ÷x¯Ù‹_^^™™ X¼x1öíÛ•J%?ÓÍë–Ê·YËü,/#2ݼaóx Eë¶.ÛíÅ/..'NĪU«püøq,X° ¶íOAýC`øí0J¿K©6WsW‡øÙ£ÓéPTT???ÄÇ[®° D^^L&/ŸrŸŸk.)‚ÌË›ñ­„»?!0Bûíz˜KŠ ¯×0™½Î¦ßk¿]sq “Áx! êØ×,Ç©TãÐø+xzr9L…· «U»Ìr©ã“ øëëFðò zç}‘5kÝ®ï¡m sá-˜r/Û<º…ˆˆˆˆˆˆèAP©G7´hÑIII;v,Ξ=[áçdP¿ÜÅs߆¹¸‚—7w¨_YÝ`;¥QZå‘+`*.„üÏ[‘a4Ø-«)?Ï&áp¿>}-[¶´&zoܸãW»ÙŸŸ?ÌzÌE…– ó­|˜ÍfÈüjUâhÛ‰o5—››‹ñãÇ[ÿýÚk¯áäÉ“6ŸQvˆ†àî åã¡ß·†ãG­·²K& ˜Ìw¿ÜEïõø©MYEØ£P‹Ò5_ xÞdÈjÁ}Л6É*±åÕÕ‚ •J8p FƒÔÔT#55°lÙ2ëÕ½ îÙÚ-kP<70аp¨ºÿÕ¿¤ôÏšÜ>íÅW¯×;<~ª^ø'ô;¿ƒ~ÏÕ †ò‰ÎÐ¥®±)ƒ<¨>üùHà6ˤŒ¿öÈ4ûÀ‘Ðý°¥[ÖBæW ÊÇŸ„P+Àiã“#”mƒæ‹Ðíü‚› P@ †ºg_^ÙKDDDDDD ¡aÆ߇î5ãÓû^MÒ‡PvèEëvU¾ï¢©£\>~÷ãwãW™ø/Géÿ–@ýÊPÈCÿ9ŠŒ/Ûïýÿ¿L„êù— n0¡tÍ7-÷qDDDDDDD5MÑÔQP0 D$•¼A¨ºÇ@»a%L…P÷E“ Ý?f3LyW,RÑëa6›`Êù¦Â›p{¨5ãCDDDDDD &z‰¨rƒF›Ç hóAÕƒ À}à(è÷mÿóelrÈ‚êýßpÈj×e|ˆˆˆˆˆˆèQc½îCÆñh=€duƒ¡z¹?ADDDDDD4§<£—ˆˆˆˆˆˆˆˆˆˆîŸÿºb%B¦„‘:IEND®B`‚nvtop-3.0.2/screenshot/Nvtop-config.png000066400000000000000000001741461444130114000201230ustar00rootroot00000000000000‰PNG  IHDRÒj7½/„iCCPICC profile(‘}‘=HÃP…OS‹R*VqÈP,ˆŠ8jŠP!Ô ­:˜¼ôš4$).Ž‚kÁÁŸÅªƒ‹³®®‚ øâææ¤è"%Þ—ZÄøàò>Î{çpß}€Ð¨0Íê4Ý6ÓÉ„˜Í­ŠÝ¯aaª€Ì,cN’Rð]_÷ðý.γüïý¹zռŀ€H<Ë Ó&Þ žÞ´ ÎûÄQV’Uâsâ1“$~äºâñç¢ËÏŒš™ôF€î] YwœïcÇižÁgàJoû« `æ“ôz[‹}ÛÀÅu[Sö€Ë`ðÉMÙ•‚TB¡¼ŸÑ7å€þ[ ¼æÍ­uŽÓ C³J݇Àh‘²×}ÞÝÓ9·ï´æ÷ýárxÄZ“‹bKGDÿÿÿ ½§“ pHYs  šœtIMEå ,­T® IDATxÚìyxM×ÚÀgŸs2O$ˆ„ 晚¢ŠÐйô‹áÞÒ¢¦š®+m1´¥¨¡QR´HÝRUcŒ¥RMÅ¡bÖRD d”ùÌûû#uôÜœ \m×ïyÎó${íµöZïZëÝï~×»×VøøøÈ@ ‚R! @ Â@ „!-@ CZ @ ø ¡tuu}ÿYªÂÅ Ç©ï"g¤bJ»÷çz*‘$–,YB@@xzzröìY1Ê‚'ÌèÑ£6lôèуï¾ûNE xÊxzzÍ7HJJ*s9:t E‹\½zUUôÿ3ÊÚ¦¾‹ÂÑ L2¦ûé£O<^ñ5Ò`¸ò3¦Œô§lÁ+°éÞuËvȲ Ùt‡¿Y.E :vìH§NФ>}š;v0oÞ<4hÀ† ðóóÃßߟ ðüóÏ[ä9zô(ÁÁÁÄÇdznÝ:Úµk‡½½=²,£Ñh8~ü8o¾ù&ÑÑѸ»»c4¹}û6›6mâ믿6—URþìÛ·­VK```©EؿƎKݺu¹rå +W®´Ú iÛ¶-Û·o'''ÇâxÏž=INNþSL¦ÇµĈ¼ýöÛòX°`[¶laÿþý¬]»–;v˜Ëš8q"}úôA¶b º¸¸ðÆoн{wììì(òÄÀ1™LìØ±ƒððp‹²;tè@hh(>>>¤¦¦²víZ¶oßnu~k”ããÊ/iü¬Y³†®]»b4ÑétÄÅÅ1sæL222øüóÏÍå?^z½d;xêFÍ‘u:@Æ”‘†î»=¯_y(C/l{Dª^9û>ú¢ÿñvÃ' ¬U…Ú‘õzŒ×~AóõÚ _-\ÚÑ©rUl«“¢M&&}?sÎÐÍ£Ý<ú£7iÍçç›ò» ÀŒús:+Ž)[¨jëÅÈšÓX|5غk·hÁÛo¿MãÆصk .Äh4šÏqwwgذa4jÔˆ«W¯òÙgŸ‘ŸŸoµbÆŒôîÝI’Ìý[PPP!²ûg 4plŠNÖ¡Vج¹É{[¸­¹“ë¼Ë±Œï8k–u>¬¼6™òolU’ü7nÌôéÓiÖ¬ùùù|úé§lÚ´©ÂäS’~(öÞïàÀÅ‹Y¼x1+W®`Ú´iüûßÿ¦~ýúèt:ó¹ÙÙÙÄÄÄpóæM‹2Jš¿ÿͤI“X½zu…ô½_¥îô¨2µd ÈèM…uþ6e;‰÷>ñþÒý[ÞñõWîÿgÊÐ|½ãõ«HÕk`8…³+ºöWh…díÎO]j?$oò?™’»WßDÝ&}â± »Fß¾}ùôÓOIO·|H8~ü8nnnÔ¯_Ÿ+W oܾ¾¾¸¸¸˜˜Ào¼ÀܹsÑjµÌŸ?¿HùãÇ'!!¦M›òñÇS­Z5–-[fu~t:ŽŽŽxzzr÷î]«Û6|øp&NœHpp0'Ož¤aÆtèСTò¹{÷.~~~Ê'ñâÚ¿~ýzÖ¯__¬üçÏŸÏÂ… Ù³g&“‰   fÍšeµ¡*Ë2III¨TªGÞ$GŽI‹-èÑ£’$AjjªY™6lØððp&OžÌ‰'ðòò¢^½zVç/‰’Ê·füÌŸ?Ÿ 6àííÍÌ™3yçw˜>}z…õ¡6úôÇ¿/TŒZ`7|y‹B@¯Gé] »‘SÐØŽ~Ó$gWÔmžI“ ÍÆO ò~CÀ`@ûmd…ޝö•üéêÞ›È;_p3?‰jvÞÔ¶o`qÎÙ¬xvÜùÏcËhæÒ–#éÈ3æ”úúݺucí򵀮ÆâííÍ–-[¸~ý:_}õ•Y_­X±‚°°0þóŸÿð /°jÕ*FŽiUùƒ ¢U«VôèÑY–Y¼x1ãÆcùòå&ÃïRw›qÉ–¶nyµÆD–\ AFæ@Ê6^©>‚sÙ ÈȼXe {în¬#ª$ùI’Ä[o½ÅêÕ«IHH uëÖlذ‹/rúôé ‘OIú¡$233éÛ·¯ÙêÕ«W§@~~>ÁÁ~8³vþV¯^___bcc+Döñ™ÑÄgF>¬{¾ŠAÖsàÞ6‹sždÿ?þ-ïøú+÷ÿÓ ô1Ò²Œ)ùšëQ¿ðØÚ›=ºê^Âaê»8ÍÅîŸãP8»^¤rg,åC»]!)q YˆÂ­r¡§nÔ¿p ù°ð÷~8ÊÍŠZý ›a?>Ç…8Lž‰ºÝ åÇ]ß*CºÝ è¿ß‹¬×!kµè¾ßkY~ðÍ7ß0nܸ"Çõz=‡¦{÷î#::ƒÁPÊpáÓ¦Mcüøñ8;;[·wïÞ:tˆï¿ÿžž={ZÏÆÆ†wÞy‡   Ž?ŽF£áìÙ³¬Y³ÆB™Œ?žèèhŽ;Æš5k¨V­Z©¼"sæÌ!..ޏ¸8fÏž9ÝÙÙ™£GâààÀüùóIHHàðáÃØÛÛ›ÏyñÅÙ½{7'Ož$**ŠaÆUHý¬iI=z”«W¯2|øpÈ7JåYÍÉÉaïÞ½ÄÅÅ=2}ذa|ôÑG——GXX˜Eû§L™Bxx8'Nœ 99™#GŽX¿$Š+¿´ò»}û6QQQT©Rå‰)FÃ¥s ›ÜÜ ëØót1ÑŸŠ­SÚ=´w‚ÉdõŠWYõ“R¡" Êÿ±=yIyÑË:~+ø•cKÕ¦ Ù‰tvïY&y,_¾œ£Gb4¹yó&?üð5kÖ4§‡„„0wî\¾ÿþ{rrr8pàŽŽŽx{{[U¾»»;?þø#ùùùpðàA<==ÍéK—.eîܹæÿg̘Á’%KÊÔIË©û±¸©Ý±• uÈÕ¼ŸIÑÝ¡}%Zºø‘¡K!)ïb‘¼cj3¢æÔ •ŸÉdb̘1ÄÆÆb4ILL$&&†V­ZY-Ÿòê‡çƒÁ€Á`À××—Æ“žžŽR©4§oÚ´‰ÄÄDIJJ²¸—•vþiáD¨\¹2kÖ¬!..Ž£GòùçŸÓ¼yó ›ïO²ÿŸFÿ–w|ýÝûÿéÒGò-Ðjª6P5{Ž‚µaä-}ÓÍ$ì_/<7#ÓÝÛ¨=l¸²AL÷n#ß/tíü'œ¼E¡ä- Åt÷·¢7“úM°8ÝÁ]ä-Eóå* ü¸ë[s““*WÁ˜r›ç»£îÐã½d$ª*ìÈÈHLåÊ•‹¤EEEY >¢¢¢Ê|­ .››káõ³Ö>tè}úô±:Ÿ¯¯/jµšøøøÇž3aÂúõëG`` /¼ð'Nœ`éÒ¥V_cΜ9T­Z•îÝ»óÒK/Q«V-fÏžmqŽ››+W®ä§Ÿ~¢OŸ>Œ1¼4æïïÏâÅ‹Y°`mÛ¶eäÈ‘¨Õê ©Ÿ5í·†yóæ1yòd&MšÄ‚ *lÜ) jÕªÅåË—3f ¯¿þ:—.]¢N:æsš4iµkט;w.Û·oçÃ?4+:kò—Dqå—F~ …‚5jÈ®]»ž˜bTµh F#¦ŒT$”>¾~:UæòÊ£ŸªØz¢T(ù5ÿ—rµéLVϹuÂQå\æqT¹re @ûöíÙºu«Ùðöö6÷ŸB¡ ^½zdffZÛűgÏú÷ïÏk¯½†‹‹ ƒ¶ûyÿý÷éÑ£íÛ·§I“&ôë×>ø Lí°W:бò‹¤êî¢5iz%ïmÅߣ/]=úp eÛ#n–JªÙzãeçƒE…ÉïQÔªUË">´$ùþðCr ×/^ Jd… ¤ê5‘üç†åƒrŠ6™\}6z“–mÑ÷2LYžô.῾_¦%ÿÇÉï¿0`ƒÁbEª$ù.FºFh4‹¶Üºu ooo®_¿n>~ðࣗ»ëÔ©c¾Ùÿ7ÖÖ¯¬í·–ž={’ššŠ——]ºt)÷ƒÔt:¹¹¹¸¹¹1mÚ4ªV­JZZ¦ßCÒÒÒ 5+§Õ«W‹­­-Z­¶Äü%Q\ùÖÊïAŒ$Iôèуèèhºwï^jƒê±r:|À#mé0È£ÉÙSfZéõd9õS¦> '¥ JLÙy§PGÍnŽB~(Ÿ’b¤ަ}Ë”ºïósNé½ëqqq<÷Üsxyy±páBZ·nMxx8žžžæ¹¹páB^yå222ùÆãˆˆˆ`çÎìÚµ OOOBCCùðÃÍcàÈ‘#H’„­­-ÑÑÑ¥®ÿ÷©»‰Í8ĘZïp«àYËš8·&ט«º2õ›r%ï§"eäË>Ö'¿?Ò´iSBBBxýõ×-æ–5òyÒ¤¦¦’™™Éýû÷[ÖÌß!C†°m[QoðÚµkÉÎÎfÊ”)4mÚ”¸¸8¸téR…µïI÷ÿ“îßòŒ/Ñÿÿ#´Ò» Œ)w5Èùh6­!Ùû?SV¡‡ƒÃùDTÍÛ¢lÒ ÃOgÀ ·úz¦Ìt¤ªÕí·æú%•ï6J߇íó©ûXý<¤¥¥±{÷nX$-**Š®]»Òµk×r…u´lÙ{{{óË‹%ѧO^{í5üüüðóóc„ V‡w$''sçÎz÷îýÈôììl²²²;v¬¹}~ÖìÈqûömììì,<äÞÞÞ( «wô¸uë 4x"õ+©ýV=ѪT„††ÆâÅ‹™={¶ÕÞT* .ÄÝÝÌÌL6lØ`nsyëWRû‹ÃÕÕ•É“'3tèPó±ùóç³fÍvíÚeÕ2Ú²eËðóóÃÖÖsˆN·nÝ(((`ß¾}xyy±oß>óƒÅãÜâãã 端¾ÂÞÞž .˜÷¾~ ¿âò—DIå[#¿ÐÐP‚‚‚øå—_5jT……u”ø°tëW4_®Â¦ÇËØö‚œ•‰þÄ1äÌ­,ÿ{iU›ç-ö‘.¯~:›€Q6гj Ulª‘®Ka÷ÝKÍ-]ýhâlé5_t5É2t$ÇÅÏ9§hìd‡=''‡;wòÞ{ïQ»vmT*QQQæÐ{÷î¡T*ñññ!>>¾L/ÝŽ5ŠY³f„Á` ))ÉüŽ„J¥âã?fÁ‚¤§§“žžÎŠ+X¶lC‡-Ó õ»ÔHÞ¬5ƒØôïÑɺº÷!âæÃ]@ÜÛÆ°“8›oŽO7ÊFRtw0ʆRÅÈ–$?•JÅæÍ›Q(|òÉ'ØÚÆÍççç›·€,N>æ{˜ÁÀÕ«WÑétEdR’~x”4‡ òؼ;Æ´iÓÌò»sç'N¬zÙ+žhÿ?éþ­ˆñõwîÿŠ@áãã##¨”J%GޱzIS T<Çsð)Ó®];Þ~ûmÆGVV’$Q³fM‹~‚ÇQ£F 6n܈¿¿¿†èÿ?*Ñ…K¥J•øè£8wî6lBž0£G6ÕëIƈ ͉'X²d +V¬ —owîÜ) iU 4ÈüUWèÿ?Â#-@ ”Iˆ@ @ †´@ @ i@ @Ò@ 0¤@ aH @ð§¡C‡VR^ ž$¥ÚGZÕ¼ êç_DY¥¦Ô»èbb¸tÛÁ£P7jެÓ2¦Œ4tßíÁx½ð޳–’ÿÙBä´ÂOÆJ•«`?!„¼ùo[umÞxã ºwïŽ]‘¯öéÓ‡+V ÑhÌÇ>ûì3ÂÃíÊ/I3fÌ wïÞH’D\\3gΤ  .^¼ÈâÅ‹Y¹r%Ó¦Mãßÿþ7õë×G§ÓñóÏ?Ó¯_?®]»~¦{ëÖ­4o޼ܤ°±ÅqöRtßíAwä 6ÝûbÓ­¹ïO£ÿ^Øø÷AÖ?üd¶\GþÒ÷¬Ê_>øàhÑ6I’ bàÀ˜L&vìØAxx8²,[•þàæŠ©©©¬]»–íÛ·ÿÏå¯îЛ— ?éþàËu²^€îàNô‰ÇË-ÿ’æOE¢îß eK/4ó¢ÌÇ”M«£ÚYÿð“´Æ£I_5ÿߨQ#ÆŽ‹,Ëlܸ‘3gÎX”Û¼ysBCCiÖ¬wïÞåË/¿´ú3âJ_ìÇ!k5Ç VÌÇ”•iþßaB²Á@ÁÚ0‹ó§/B&Ý·‘…ã­juì^ŸDþG³*Df7fúôé4kÖŒüü|>ýôS6mÚîüøqËö(•¨ÕjZ´hƒƒŸ|ò ’$±yófó~©ö½¾xñb‰×/i|($%6=^FÙ¼ @öGtßï“ ‡ ÓÑŸŽGØr´}UëEdYÑò)I¿–…I“&±zõj«Ï/Iÿ[Sÿ’ô×ãøæ›oضm_|ñ…ÅñW_}•ÀÀ@…%"ü iuûÎØt@³s#Æ[×PVõBª]Ïâmô7è_Xp£Ø Ÿ@Þ¢øÝè(²,“””„J¥*¢(ÊÝ»w3mÚ´2å4h­Zµ¢GȲÌâÅ‹7nË—/ 33“¾}ûš ¹^½zYõéæŠBÎÏCÕì9³!¦jÒYcyÒŸ=vç—eÎo ]ºt¡nݺEŽ9’-ZУG$I"""‚ÔÔTóͨ¤ô† ÎäÉ“9qâ^^^Ô«÷p|ý/å¯OˆAŸShÐôÚß ¶Š”ÿ“œ?fƒ ^ŽEìUÏ%£ß~æ±yÌÂ… Q©TL›6ÍÂnÙ²%7ndîܹŒ7ŽjÕª1tèPT*•ŧç‹Ã”}¿XÃWªäl0 °±Eá↜}ßR™5{ýÑ(ä¼Ü íI’xë­·X½z5 ´nÝš 6pñâENŸ>Mff&Mš4±È3cÆ òòòÈÍÍåÍ7ßdË–-ìÞ½›Ã‡³cÇœœœ #$$Äêz7>lú"UõB³6 Y¡Ànð(l{ @{p'Æ´{Hn•‹> »ºaJOyâò±F¿–†êÕ«ãëëKlll…Ü?¬©Iú«8®]»†··÷#Ûqýúua…r¬ íPª°yée4;6`¼ö èõoß0+õGa¸td’›{…T4''‡½{÷÷XCZZZ™ó»»»óã?’ŸŸOAAÄÓÓóa{  ¾¾¾4nܘôôt”J¥Õõë­·HLL4ÿ._¾üغ<ÚÊ0"HÕ<½ IzzùWWWæÌ™Ã’%KФ 6Œ>úˆ‚‚òòò cذaV§O™2…ððpNœ8@rr2GŽyvä_^J)ÿŠž?…ƲU¿&].šf§†\m±Ù·oßÎ;ï¼CPP›7o.b8®\¹’mÛ¶‘››KRR ,°Úˆ¶J 5m…ñ—ó~9ªqË¢2»p ›N/U|×™LŒ3†ØØXŒF#‰‰‰ÄÄÄЪU«GžßºukÚµkgþÊŸ‡‡·nÝÂh4’——‡ ,`Ñ¢Eœ?¾LuúãøP8:¡nó<ÚÝ›0ee"ßÏ@»ë+Tº€­rz* ×J…Ýù”¤_KC`` ‘‘‘Vyƒ­ÑÿÖÔ¿$ýU¿þú+^^^,Z´ˆˆˆaH 7CZò¨Je©–™U-ڂш)#õ©4ÄÕÕ•–-[Á–-[˜8q"jµÚêü{öì¡ÿþ¼öÚk¸¸¸0xð`¶oßnNwpp`ïÞ½ôíÛ——_~™o¾ù«Ë £mÛ¶´mÛ–¡C‡’ŸŸÏ¿ÿýo먶Åxá$ªf­Q5o‹áÂ)6¶O/?…!ëÖ­ãÎ;–ž-…‚ZµjqùòeÆŒÃ믿ΥK—¨S§ŽUéMš4áÚµkÌ;—íÛ·óá‡R¥J•gGþ奔òóGÝ~1™Ò IDAT¯)¦¸ëÈYEW"vj5\Qk‹Í莨ºÔ¥Â✋/Lpp0§Nzhà*•´iÓ†o¾ù扊PÕ¤†Kç1\:ªië¢Æå™Q=×…£ÓïÎZµjqõêÕG¦³|ùrŒÆÂ0™³gÏÒ·o_š5k†^¯ÇÉɉ¨¨(bbbÊ.‹?Œ©juLy¹ÞeSê]ÐjPzTÃô´äåƒT½&(H®nÈ™iOE>%é×ÒÒeÍ[–ú[£¿ŠãéæÍ›Ó¬Y3 Õ«WŸPþ.†´ÂÞþ»h7pŽ!âò! GgóqÿÞ8ÏÇ1x>êÖ)Xÿ O¥!dݺuL:•3fPªeÓ””èß¿?‰‰‰hµZó²€­­-»ví" €Î;sèС"eDEEqùòe._¾ÌÞ½{yggg""" #!!¡wNú³'P6jª^# —Šz²T-Ûá8k©ù§¬U·Tù‹£ÿþ¸»»³qãÆ¢šZ$IhµZš6mJ“&MÐh4ØÙÙ!IR‰éžžž³k×.F…F£1Ç·?ò·¦‹Ê)ÿ'9”ͽP8ÙbøñÑ7nÓÅ»b¯£ßvýîsH«¡hlUÙ¨ÕjRRÊ& ¹¸á8ó#óOÝéŇi®•P88aJ¹ƒéö $÷*(œœ-òˆ3 ¨;v{¢ºfÀ€ †"qÑPk[½zu>l>¶uëVRRR>|8ÿú׿puu¥}ûöŒ5Ê<þ­áqãCáäùyEΗórQ¸¸"gz¤Î.ÈFäå yTCáZ ¹B;¬‘OIúÕZÚ¶mKJJ 7oÞ|jýkþ*ŽëׯãååEÕªUÑëõ¤¥¥Q¯^=á‘þ"X#mºŸŽÎ…KÑ&š]_à8ó#øƒÓJwøÀãÃ=d IɃÅ8YRT¨‘}îÜ9Î+|ñ1))‰E‹±xñbæÍ›gUþˆˆvîÜÉ®]»ðôô$44”?üÐÂOMM%33“û÷ï?2>7  ÈËn†‚$Î?þhõKX"ÌÍFÎÏC.È·x°1{䊉ѵ&ÿã¨V­!!! 2ä‘Ë©:ŽÜÜ\ÜÜÜÌ1êU«V%-- “ÉTb:@ZZ¡¡¡üòË/¬^½šØØXlmmŸù—Dyå_ìü) g;T ÑEÄÃcVÃM·³àvVa=Óò0Dý‚ú•pàçËOKKC¯×S­Zµr8ÅÅH+›´BruÃáíÂù¬ptBÕ¤úZÊðØw8Lš‰áç³ODa6mÚ”^ýuóØý#/¾øbÛh4²jÕ*:uêDZZ[¶l!((ˆaÆȶmÛ¬ºöãÆ‡œ“ EãÞŽÎÈÙ÷1¥§¢prAéÛÓÝÛ…ò¬U…³¦Œ´§"kô«5 2ÄjyUTý­Ñ_ÅqíÚ5ªT©B§NÌ/–¶k×OOOá‘þX味2!ûþ#—S­6³2ÌqzJ7w䬌'Ú8kã3œœèС{öìàîݻ̚5‹þýû‰Ã={6 .,S}‚‚‚psscÖ¬²ï$ Û·]Ô®§š¿W¯^¨T*"##‰gß¾}8;;OëÖ…cââÅ‹´iÓÆÂsôÇÝJJ¿|ù2 64ÿŸ‘‘a^–ä_^ÊÛešäM«¤Àf\Glƒ»c3ñ°UcÜEM·b,[ëbPF#§OŸ¦oß¾Oik Ö¯$ÿ£Yä4 ÍæˆGê#97ù¨Z¶«ð:4hЀˆˆ¦M›öذŽöíÛ?ÒÓÚµkW†ŠÉdÂd2qéÒ%öïßOË–-Ë]/SJ2’£SaÞƒ>¯Zll0¦ÞCÖ çç¢lÐÓÍk˜n]CªSL†Â‡º',ŸÒè×â°··Çßߟýû÷?‘1V\ÿ–¤¿Š#;;›ÌÌLºuëFbb"'OžÄÏϽ^OVV–°B‚¿ƒ!,£ýn7¶}‡ ¬Û”J”5j£(E ²áÒylº pt*|9¦KÏR‡<777Ö®]K£FP(xxxüØåýÿ&77—””Q«Õ(•JHNN.bÌݸqƒäääR×±wïÞ <˜qãÆ¡/Ç. ¦ŒT‹íÀžFþõë×ãççgþõëלœüüüÌF×_~ÉÔ©SqrrÂÕÕ•)S¦Xx}KJˆˆ`êÔ©æ¸è &pìØ1´Zí3%ÿr=å쿲`Œ¿vI´ù§[u ´z´K¢‘oÝGa¯F=¬ ’§sá ““ ª 1ž·^Î~ø!“&Mâ•W^ÁÞÞžZµj±jÕ*jÖ¬Yîú+œ]ªya¼™ô°M¿^FªéûÈxhݱïP7oS¡2lÞ¼9ëׯ'((¨Ø Ÿ"ïtìØ‘iÓ¦1}útòóóqssC’$j×®]îp(ÜFŸxÛ—ÿ‰ÂÙɵ¶^-ÜiFW8L驨ê4ÀxóÆ›¿¢ªÓSZÊS‘OiôkIs8&&†üüü Ÿ#%õoIú«$~ýõWüüü8yò¤Ùþõ×_…"ü°zû;ùD0± €äQ Sz*Ú=›‘s­Û‚LsEŸA8L™]XÞÏgÐûÎêŠ.[¶ ???lmmqqq!>>€nݺqÿþ}öîÝËœ9sðññA–eó>ŸÖä/((`Ô¨QÌš5‹   IIIŒ7®B„lggGXXá^­ÿmÜ¿ôÒKäæVÌv]ê–íP5±ôpå/™ùTÒ¾}ûðòòbß¾}|ñÅqÌ%¥ÇÇÇÎW_}…½½=.\àí·ßò ÈzLçï êÛEeÁxæ7Œ?\µºŒS§N1bÄBBBøàƒHNN櫯¾âÖ­[åWRMZa¼vþ°Œ.kµ˜n_GÕ¸%úDËP 9'ÃÏgP6jQ1JR¥bóæÍ( >ùäs¸Q~~>:t°8·jÕªddX®´Ý½{—I“&™ Àððp¶nÝŠÑhdâĉRGÝHl`?>¸P¿žýÝ¡‡cÝ”vïw½ý»ñ¬T!g¦?5ùT„~2dK—.-S‹Óÿz½¾Äú—¤¿JâÚµkÔ­[×l<ÛØØ<Ñ8o@ðôPøøøÈB @ xV©Q£7nÄßß_C fÍš‘ŸŸÏ§Ÿ~ʦM›€Â¯~òÉ'H’ÄæÍ›Íû?Pì/^äóÏ?7—uüøñRÕMac‹ãì¥è¾ÛƒîÈAlº÷Ŧ[rߟ F6þ½°ñיóÉyä/}ϪüB¿ þÊH’DPPÄd2™¿l,Ë¥ßÝ÷ƒ>`àÀ4oÞ¼Lå?*?@ÿþý;v,uëÖåÊ•+¬\¹’ï¾³üºsvv6111%~õrÒ¤I¬^½ÚüŸ>}X±bÆ|ì³Ï>³øºsq¸»»3þ|Z¶lIvv6Ë–-³0Ò[´hÁÛo¿mÖy»víbáÂ…F«ÒËÛþòè×gÊV·ïŒMç4;7b¼u eU/¤Úõ,ÎÑFƒþø÷…7jÝð ä- ½^Ìt@ð?C–e’’’P©TEŒhI’xë­·X½z5 ´nÝš 6pñâENŸ>Í믿Ζ-[ؽ{7‡fÇŽ899FHHHÅÔ/?U³ç̆°ªIKdMÅ9ú³'Ðîü²Ìù‚¿*#GޤE‹ôèÑI’ˆˆˆ 55Õü0l-]ºt¡nݺe.ÿqù‡Îĉ æäÉ“4lØÐüùù?’ŸŸ_¢·µzõêøúúká(ؽ{7Ó¦M+“üÂÂÂ8uêo¾ù&^^^lÚ´‰»wïrúôiºuëÆÚµk‰ÅÛÛ›-[¶pýúu¾úê+«Ò+²ýÏ䃜Ug)Uؼô2š0^ûôzŒ·o˜æGa¸td’›»˜åàJNN{÷î%..®HšÉdb̘1ÄÆÆb4ILL$&&†V­ZàááÁ­[·0äååacc X´hçÏŸ¯˜ šŒÈF#’G5$Ooä¼\¤§—_ ø3lØ0>úè# ÈËË#,,ŒaÆ•ª WWWæÌ™Ã’%KÊTþãòÛØØðÎ;ïÄñãÇÑh4œ={–5kÖ˜ÏÙ´i‰‰‰$&&’””D÷îÝ[ÏÀÀ@"##-¼á...¤¥¥•Iv¶¶¶<ÿüó¬Zµ €äädV¬XÁ¸qãÌç,_¾œ£Gb4¹yó&?üð5kÖ´*½¢Ûÿ,b•GZò¨J¥9Lê‚[´£SFª˜åàOE­ZµÌÞ¦³gÏÒ·o_ Ðëõ899ELLLÅ]Pm‹ñÂITÍZƒÚÃ…SØú6|zù‚?) …‚ZµjqùòeÆŒƒN§#22’:uꔪœ>ø€uëÖqçÎ2•ÿ¸ü¾¾¾¨Õjâãã{íW_}Õü÷Þ½{‹­g`` #FŒ(bÄ·lÙ’ˆˆœ‰‰‰aíڵ譈$ •J…««+éééüôÓOL˜0¡ˆ*UªDçÎiß¾½…¡]\zE·ÿOkH+ì@û0öÆnà0” ›¿br^Nᓇolž/|’0¥Ü¥`ý'ð‡@ xÖ0`ƒÁ‹·uëVÆÏðáÃù׿þ…««+íÛ·§J•*¬_¿“ÉTšX…þì 솿‰B¡ `ãgؾüOËSZ¶CÕ´µùÍ—+1ÞH²:¿@ðWD­V#IZ­–¦M›¢ÕjÙ´ivvvH’dÕüìß¿?îîîlܸ‘jÕª•ºüâò»¹¹‘““cþÑ¢E¼øâ‹ôìÙÓl¼ZCÛ¶mIII)C|ðàAΟ?ÏÑ£Gñôô$,,ŒÊ•+3oÞ¼Ë,((àäÉ“Œ7Žððp4hÀ{ï½GÕªU-ÎóóócåÊ•8880vìX®]»fUzE¶ÿOmH›î§ƒ£sáR¡É„fWaÜ‹ãÌ@ñð<Ýá÷M($%#dI!Œl@ðLÑ´iSBBBxýõ×Í7`£ÑȪU«èÔ©iiilÙ²…   † F`` Û¶m«k˹ÙÈùyÈùŽ‹Љ‘¶&¿@ðWD§Ó‘››‹›››9F¸jÕª¤¥¥YeDW«V† òÈ—K*¿¤ü¿ýö¨T* ƒù½ŠóçÏ£P(JÕÖ!C†¾øâ :dià \½zNWê÷¬)¿8vïÞ^¯gúôéøúúrýúufΜYª6† ÂÒ¥K‹¿ÿ>{÷îeΜ9øøø ˲yŸkkÛ_£F Þ{ï=\]]¹sçS¦L1¯Êåää°sçNÞ{ï=j×®J¥"**Šùóç[•^Qí–QøøøÈÏJe”J%GŽ)öƒâˆàYæøñãÏäGOž†~O5ظq#þþþB¿>ƒúUõ¬ ©R¥J|ôÑGÀ£?a+Ïü„í£b…~eeРAæ/ª ýúìé×gÊ#m•å/<Ò@ðLêW@ øÛéÍ?[…çï€,ÿÏÒொÐ@P:þti@ àY@"@ „!-@ CZ @ xVQººº¾ÿ,UHáâ†ãÔw‘3R1¥Ýûs=•HK–,! €€€<==9{ö¬eÁfôèÑ 6Œ€€zôèÁw߉= OOOO¢££¹qãIIIe.§C‡´hÑÂüQèÿg«wíp˜ú. G'0ɘî§cH<Ž>ñxÅ×HS€áÊϘ2ÒŸ®ogºc7” š¡P«É_1¿ôe(tìØñ‘›…Ÿ>}š;v0oÞ<4hÀ† ðóóÃßߟ ðüóÏ[ä9zô(ÁÁÁÄÇdznÝ:Úµk‡½½=²,£Ñh8~ü8o¾ù&ÑÑѸ»»c4¹}û6›6mâ믿6—URþìÛ·­VK```©Û߿ƎKݺu¹rå +W®´Ú iÛ¶-Û·o''ÇòK™={ö$99ùO1™×þ#FðöÛoXÈ`Á‚lÙ²…ýû÷³víZó^¡ýû÷gâĉôéÓÙŠ]\\\xã7èÞ½;vvvyÈ bàÀ˜L&ó—¯þXv‡ ÅÇLJÔÔTÖ®]ËöíÛ­Îor|\ù%Ÿ5kÖеkWŒF#:ޏ¸8fΜIFFŸþ¹¹œãÇK¯—lBݨ9²NȘ2ÒÐ}·ãõ‡Û¼I^>ØöˆT½&rö}ô?Eÿãì†O@Y«. µ #ëõ¯ý‚æëµ6¾Z¸´£SåªØV'E›LLú~.朠›G?ºyôGoÒšÏÏ7åv5€õ?ætVR¶PÕÖ‹‘5§±øj°U×.i|¸»»3lØ05jÄÕ«Wùì³ÏŠ|θ8'ÄŒ3èÝ»7’$™û·   Bd÷ÏhàØ¬C­°!Ys“÷¶p[s &×y—cßq:+Ö,ë.}Xym.2忼ó§¤üåM/‰uëÖqøðaó¾ã]»veáÂ… 0€””óyÙÙÙÄÄÄpóæM‹ü%ÍßÿfÒ¤I¬^½ºBúÞ¯RwzT€Z²dô&ߦl'ñþQÑÿáþ¦ iÍ×k1^¿ŠT½v#P8»¢ûa…VHÖiÑîÜøÔ!ËzÀ%%ªÆ-žÈ5úöí˧Ÿ~JzºåCÂñãÇqss£~ýú\¹RxãöõõÅÅÅ…ÄÄDÞxã æÎ‹V«µøüæÆOBBM›6åã?¦Zµj,[¶Ìêü>>>èt:ñôôäîÝ»V·møðáLœ8‘àà`Nž3ºðaÝóU ²ž÷¶Yœ#úÿ¯ÛÿO© Sò-4;Ö£~á%°µàŽEýÂK8L}Ç ¹Øýs g׋T®‚ãŒÅ |h·+$%Ž! Q¸U.ôÔúŽ!þÞGÙ YQ«¿a3ìÇ㲇É3Q·{áîàÇ^ߺ»h†ó'1þzù‰ û›o¾aܸqEŽëõz>L÷îÝÍǺuëFtt4ƒ¡Ô7¼ .0mÚ4Ƴ³³Õy{÷îÍ¡C‡øþûïéÙ³§Õùlllxçw âøñãh4Ξ=Ëš5k,ž¨ÇOtt4ÇŽcÍš5T«VÍêk8880gÎââ∋‹cöìÙØÙÙ™Ó9zô(ÌŸ?Ÿ„„>Œ½½½ùœ_|‘Ý»wsòäI¢¢¢6lX…ÔÏšö—ÄÑ£G¹zõ*ÇgàÀܸq£TžÕœœöîÝK\\Ü#Ó‡ ÆG}DAAyyy„……Y´Ê”)„‡‡sâÄ ’““9räˆÕùK¢¸òK+¿Û·oE•*UžØ\5\:² Éͽ°Ž=_Asý©xÐj0¥ÝC{p'˜LÖ.W•Y?)*ªüۓב”w½¬ã·‚_9–q°TmºHg÷že’GIã+$$„¹sçòý÷ß“““ÃpttÄÛÛÛªòÝÝÝùñÇÉÏϧ  €ƒâééiN_ºt)sçÎ5ÿ?cÆ –,YR¦¶èLZNÝÅM펭T¨C®æýLŠîí+ùÓÒÅ ] Iy‹äS+˜5§–úšå?%å/oºµ899ÁÂ… 9}ú´ùø¦M›HLL$11‘¤¤$‹{Yiço`` ‘‘‘N„Ê•+³fÍâââ8zô(Ÿþ9Í›7¯°ù.úÿïÝÿOÕ#ýGLÉ·@«AªR Óoױ進IK Ö†!ççaÓéEì_§à‹O0e¤bº{U£æ~*¾²AL÷n#ß/tíü'Ü\¶ý›ï½™Ôo‚íÀáh¶|ŽñÆU$7”[>4fйþ³Bdd$7n|ä’ETTÿüç?ÍiþþþezZ4ß4/\ 77—zõêY ø’ éwÞyGGG¦OŸnö¢Zó„ªV«‰ì9&L W¯^’™™ÉرcYºt©Õ“yΜ9899ѽ{w$IbùòåÌž=›™3gšÏqss3‡,]º'''óÒ°¿¿?‹/fâĉüøãT¯^ݳVžúYÓ~k˜7o›7o&++«HÈMyP(ÔªU‹Ë—/3fÌt:‘‘‘Ô©SÇ|N“&Møê«¯˜;w.Mš4áÊ•+,]º”ÔÔT«ò—Dqå—F~ …oooÙºuë“SŒ-ڂш)#$ ¥/š_–¹¼òè§*¶ž(J~Íÿ¥\m:“ǨZA-¥nìíímî?…BAݺuÉÌ̤f͚ܾ}»Ä2öìÙÃæÍ›¹sç»wïfðàÁ„‡?¼'¼ÿþûOOOΟ?oþ=ðÞÛÙÙ1hÐ Þÿ}óõܹsùÇ?þZ,‘o IDAT­6çwqq!22’M›6‘žžÎ7Ìio¾ù&ü1 ȲLrr2_|ñ…9Ýšú•§ýÖpåÊÒÒÒ(((àòåŠ[Q«ÕH’„V«¥iÓ¦4iÒFƒ’$™eÌ®]»5jÆlÈX“¿$Š+ßZùÍœ9“óçÏsäȲ²²ˆ‰‰©ÐùiãßÇàù8ÏGݺ#ë?£…£3(•È9Ùeïƒrè'{Ééa¬ð+ÕGZ?ŒÐúa8ª®8µtõã݆+Ì¿Zõ-W¾d§³âx¾ÒK*7.^,ôÞuìØ‘mÛ¶ñÚk¯Q¹re”J¥Ue¤¤¤@ÿþýILLD«ÕZ8²³³ eÑ¢E,X°€Y³f‘]ºþx±ÊBê-afýåxÙùðŸK-ë M&WŸÞ¤%E[ô½ F–'½Kø¯ï—jÉ¿¼ó§¤üåM·–±cÇbkk‹··7Ï=÷\©Ç‰5ó·mÛ¶¤¤¤‰±½wï­ZµÂÏÏâââøå—_*t‹þÿ{÷ÿÿÄ#  prœ,vö(±é?ÙÒЖì0é´~>‹mŸÁ¿¿°hBY«.šíë­¾–ä^ÓÝG{6¬¹þ³ÂgŸ}ÆÁƒùöÛo-ŽgggsêÔ):uê„N§#11‘¼¼¼r]«J•*Ü»gÝÎ'½zõ¢zõêf¯RåÊ•éÕ«7–¯þÛo¿áááJ¥Â`0ÀùóçQ(¸¸¸àîîμyó,–k222puu5·óq1Ò5jÔ@£ÑX´åÖ­[x{{sýúuóñƒím«S§ŽùfÿßX[¿²¶ßZzöìIjj*^^^téÒ¥ÜRÐétäææâææÆ´iÓ¨Zµ*iii˜~MHKK#44Ô¬œV¯^Mll,¶¶¶hµÚó—Dqå[+¿1v’$Ñ£G¢££éÞ½{© ªÇÊéðsŒ´¥Ã ŒF$gWL™i¥×“åÔO™ú4œ”.ü?{ç&E‘6ð_÷ôÌlÎì»dXr¢ èpŠñ<@D8à#iQ9ðŽƒãD²(+(9.qÉ,l`s˜ÐÝßã.;³©ßóì£LwUWÕûÖ[o½]U-c@Cey’Ãnޝ3I¿Þ>îÖHüšú=Ck¾ÍáìÝåfÓ*V¬è웓&MâÉ'ŸäÊ•+EîøsçÎeùòå¬X±‚Š+2fÌ>üðC§.lܸY–1›ÍüôÓO%.ç)+Ùre=¯D¿Å¹üD2í®êû7#GÍ"ÐBmßÏ=T(5ë–ô¿²¤/ëuOQU•AƒѳgOÆÏ“O>Y¢vð¤ÿöíÛ—¯¿þºPÚ9sæ••ÅСCiР[·n%..Ž#GŽ”› ùßÛòÿC"Ò†ÊÑH&jrzA>z~‹þKÞÇo»üi™Žvö;QµÄP¿)öC{ÁnóøyZzrx¥¢#ãž<ÿ!55••+WòÄOºOÇŽ騱#ñññezN“&Mðöövn^tG·nÝxî¹çhÛ¶-mÛ¶eРAtëÖÍ£´/^$))‰®]»y=++‹ÌÌL à¬ßµ?ONä¸pá^^^.òÊ•+#I’Ç'zœ;wŽ:uêÜ’ò¹«¿G3ZEa̘1ÄÅÅ1eÊÆïq4ÏhÑ¢…ËÌÿƉűcǨ[·®Ë$BUUÓ»£¸üKÚ~š¦±nÝ: ¨]»ö­ï´š†zîJÃf¥J^Vû”i»B–=†ÍË\•5‹}™Ûiض\mZPãͤ*T Q£FEž^T~~~´iÓ†U«V9'ÔãÆ£G.}à•W^aß¾}¨ªZ¤ýô”øäoèÚoƒï ¡GÃû°>eñÉËèÑY*<<ú*þ.éÊ«ÿ]#$$ÄÙ–%I_Öëž0oÞ<222X´h¡¡¡žö_ooo:uêÄÚµk‹Lóå—_Ò¯_?Ú´iCBBóæÍ+GGHÈÿ^–ÿâHË+cþËsX‹c™mûÌ=þêÜ@#yû`¨îê¸ØwmAiÜc£Øv—lG¦mÛ/˜쎡J5Gþ¾~˜êW ­'Ï¿“¢Ò=zô¸©#Ý¡C~üñÇRçC\\ÿþ÷¿ÉÉÉq{xx8õêÕc×®]Îß¶nÝJ‹- ñ¨cL™2…‰'rÿý÷c4iÚ´©ËfÀ ðþûï;—šÒ®];ꓟŸÏòåËùç?ÿ‰ÙlÆËË‹qãÆñõ×_{¼Njþüù >œ¦M›Žuo¾ù¦siHYÊçIýÝñ /pâÄ öìÙÃ÷ßONNŽËº³²òùçŸ3lØ0üüü dèС|þùç.ÁaÆ97€ 4ˆM›6a±XyW|†š¾õ1HªxWÇ(›JU—_Ó¾§Q@«rk›³gÏR£F À±©466–®]»òÁÚÕ_¤sŸ“Crr2½{÷Æh4b0èÒ¥ /^tN¶j×®Íßþö7&NœHll,ãÇ÷x#c¡òæŸätþ :…]wÚ…>¾Ð+wwéËzÝÓˆ$€ÝngêÔ©Œ=ÚeiÇþÃMúo×®]Ù°aC‘G&Ž3†&Mš I¹¹¹œ9s¦DÑTwùßÛò/+%ZÚáÕïeÐqœ¡ºõg—s¤m?‡n)Àçoo€¢ äaÝö œºA—.€$!ùø96+–ûÁÝ 0÷zÉ×=/×q†ëÕÆôäùÅÖ­Ï ÈÕj#)FðòÆçMÇyÏùŸ¼ƒn+ßEíÉÉÉ|ÿý÷…Ž‘ºpá™™™Øl¶BGÏýþè¿þõ¯…ÎþôÓOÑuK—.ñ¿ÿý¯Øs¤oLÿØc±eË—BrssÙ»w/>ú¨K>7cåÊ•Øl6FM58}ú4cÇŽ%5Õñ*ü“O>!''‡¯¾ú “ÉDVVóçÏ¿é)¿güøñŒ=š_~ùp,á˜ÿÓ#=1?Þ=3ÛŽMè鎣,Ž´Òâ>—s¤ËjŸöemGÕí<Þ› ¦Ҭɬ¼ô…Ë«æ&m©ïï5Ÿ|b$VÍuéH¶=“ÃÙ»‰ñó<Â^œ~]¾|ƒÁ@TTÛ¶m+Õ¦Û—^z‰qãÆ‹ÝnçäÉ“Î=Š¢ðÑGñÁ––FZZ3gÎäã?¦_¿~¥PHYÆß£ÿÁ–´±êt íÆÜ³×Oùîò×ô¯2„}™ÛœëÓU]%Ùš„ªÛK|,š'ýÇn·sâÄ ¬Vk¡:¹K_Öë%eÍš5 8çŸÞå ÷âp×ûöíËôéÓ‹L»iÓ&†NµjÕP…¤¤$\.}ÛÛà#äË¿<¢¢¢tå‚Á``ãÆ¿ÒåÏæÍ›E¼Í´jÕŠ7ß|“’™™‰,ËT­ZÕeï@p3ªT©Â_|A§NDcùßu(B„åKpp0Ó¦M`ÿþýÎ/ ‚[ÇË/¿LLL @‘k ·–;v0uêTfΜ 8^ß._¾\8ÒèÓ§ó«®!ÿ» ‘@ J,š@ @ Ž´@ @ i@ @8Ò@ p¤@ áH @p×ЦM?)/wŒ#­4j÷«oá7.ŸWG¢Ôkì¼f~ê%üÆOÇwÔ$|G}ˆ÷€ª]ÿŽºï¸éHaá×Rß±Ó<~v@@o¼ñ«V­">>¾ÐõÆóÙgŸ±cÇvìØÁرc1\ý|88> ýŸÿü‡­[·²nÝ:#ìããÙ3g2dˆó·áÇsæÌL&Çgx>ìü .8>Ã}àÀÛ"$ÉdÆïÝY˜:<êüÍô`wüÞÇQà¦Ná÷ö |ÇNsþùÄNô8}Ix÷Ýw Õ]–eÞ|óM6mÚÄÆ6l’tý3ªÝºu#11‘Ç;ÿ^ýõ»¢ým::ÛÔïíø½ý‰ó߯–íË¥ýÝõŸ2wôÊ_hyÔØG=Œñ±oøÌ­$¡<\óˆÎ˜c;£t®Íï¿‚[¯^=âââ˜6mšóSë7Ò¨Q#-ZÄþýû‰ç¹çžó¸|†¨ø½3Ó¥ý|ÇNC v¹ÏgÐ(¼Œ(”ÞwôdLýåz}Ã+9¿NZ¸³/Å]gñâÅ|ýõ×ôîÝÛE‡¯}íwú!ÉÌ>‰Ï›ïáûæ{˜é W?3ì3h4ƶ ëuËû‹lË[éü®X±‚Ý»w³nÝ:úôéS꼆 R¢¯Zº?bbbX°`»víâ×_å™gž)‘}+Žo¿ý–_|±ÐïÏ<óŒ8;Y øà±elý¦ºP°ü Ôs‰Â#‘«Õr¹ÇòÓ·Ø6ÿèȸ^c¼žDîäQ`³•¹ º®sòäIE)ôimp|ªvΜ9lÙ²…Ê•+³xñbNŸ>ÍÂ… ˆ‹‹c÷îÝüýï'22’E‹qéÒ%öìÙ@zz:Ý»wgÖ¬Y<öØc}šùv¡çå¢4lŽuã:GûÖo‚^ïrmß,Ë?/uzOèС5kÖ,ôû‹/¾HãÆyä‘Ge™¹sç’’’¢E‹œÙÊ•+>|x‘ùÞÉíoÛ¾Ûö ‡æñ¾`·cù~YáûÊØþ·²ÿÈuÂQ7'bKLC òÆôr; i¹¨;Î:Ù¶Õ*a™±I–0öo‰!Çâ¼ðÔSO1iÒ$EaøðáìÝ»×y­I“&|ñżóÎ; 8ˆˆúõ뇢(.Ÿž/-+ƒ¼iãn^‡à0t»ÉdF BÏÊp5f ›cû5=7§ÜuÀ})îúóÏ?ÏâÅ‹Y¹r%¿üò ß|ó ~~~ÄÅÅ1jÔ(ËPœ~˜ºõF¤`Nº$áõÔK˜é…eÝrÔÔËÈA!…'èAhiÉ·¥Õ­[—3fðÚk¯±cÇ"##©U«V©òªT©5jÔ`Ë–-å2~Ȳ̈#˜={6Û·o§Y³f|öÙg$$$8Çwö­8©\¹r‘õ8}ú´ðB‚»Ï"ÒÓÃ=)øæ3ÔÄ£`³¡^8ã4êEa?²t 9(´\ šÍêÕ«Ùºuk‘×?ùä~ýõWTUåìÙ³üüóÏT­ZÕáü˜ÍÜwß}|úé§\¼x‘™3g2pàÀëåµÛ±ÛíÔ¨Qƒ˜˜ÒÒÒ\"Nî1b;wîtþ;vì¦e-šŠ®ªÈaÈ+;œY¾}éÀÀ@&NœÈÔ©S ]ëß¿?Ó¦M#??ŸÜÜ\âââèß¿¿KD(55õæúr§·ÿm–_y÷ûÏÇÑN¤‚¦£_ÉC;–ŒìsÝ m…ºþ(ØTt‹ûú£(­¢\òXºt)o½õ±±±|õÕW.×þñ0kÖ,¾þúkrrr8yò$|ðÇN´Gf¨ASÔ£°=€Ó¤pîÆÔþá["¾âì‹»ëaaaœ;wUUÉÍÍÅd2ñÁ0yòäR¿U¹Q?$_?Œ-îòrZf:zÆ,+¢´éf/ô´¤«‘}¯'úãÕÿU‡#Œ––r[ÔèС̘1ƒ;v8mðÆK•WïÞ½Y¶lº®—Ëø¡i¯¼ò [¶lAUUvîÜɆ \Þº¸³oÅqêÔ)"##˜>>?;..Ž–-[Ò²eKúõëG^^o¼ñFùUÎhF=¸ ¥a3”F-±Üd2ß¾ô8–tÌ›7¤¤¤BíͱcÇxå•Wxþùç9räÕ«Wwq›4iÂܹsY¼x1ƒÆh4Þ=í›åwKú’¯ C“ÊÈÑ!¨»Ï]ÿ=Ä-9¥} ”6ÕÐ.g#…ù¹$OHH`äÈ‘Œ9’Ý»w_wp Z´hÁ·ß~{K›P©ßû‘Ø@iЬ°s¹÷7”æí|ýn«}qw}ß¾}tïÞ† b³Ùðóó#>>ž 6”¾-nÐ9¼ZnŽKtYK¹– ah7D¤åÈ(äJUA’ƒÐÓSo‹úׯ_ŸÄÄDÞyç–.]ʇ~H… JíH/]ºô––7::š'NxlßŠãÆˆt£Fhذ!’$Q©R%ñ uàO€GK;$o°8ÿíõD u7óô\Ç+xS§®˜î{ÐaÈ“/‘¿à_ ª·­2mÛ¶eÖ¬Yøøø0`ÀÈÏÏg×®] 83fP§N&L˜@xøõ5Ûf³™+V0oÞ<$Iâå—_æƒ>pÉ?>>MÓœÎy~~á¥þþþÌ;—¸¸8¶oß^Ž’R°íÛ׳G’$ò¿øæžO»ÞÒ¤•‹ƒQðù,Ô3'=N_=zô 44”/¾ø‚ˆˆWÑhD–e, 4Àb±°hÑ"¼¼¼eMÓX·nà×_¥bÅŠÄÅÅÂ{ï½ww´¿'"*cûßêþ#W Åø×f`R°-܉žš{õ‚ ’v©R€ã¿;4P®þî&ò†Ñh$9¹lËä€ —}Ö_¾s¾õ’ƒ‘|üÐ’“N`h$?ôœëËt»ûÞíÛuƾçm³/î®/Y²„W_}•gŸ}–×_ÀÀ@Z·nM… X°`S§Ýq3ýü /·ÐýznR@ úGDZò@WíH¹ÙÈaHÁè·iiGÅŠ9r$ï½÷S§N%66–3fðôÓO—(Ÿ–-[’œœÌÙ³goYY{õê…ÝngóæÍÛ·â8}ú4‘‘‘„‡‡c³ÙHMM¥V­Z""-ÜKŽ´–‘¾þŽWÓ(XáXè;všË†¤¾ÂV]C’ \’uY*w'{ëÖ­4oÞœÈÈH&MšD³f͘1càxµ8räH.\È¡C‡øøã3fŒKú””ÒÓÓÉÈÈ(r}n—.]œƒcLLL¡ˆ”,Ë̘1ƒß~ûÏ?ÿ¼Ü…¥çd¡çå¢çç¹Llœ¹bÖèz’þfDDD0jÔ(úöí[äëT«ÕJNNAAAÎ5Ðááᤦ¦:™ýû÷³ÿ~Nž<ÉäÉ“™2eŠÓ‘¾ÚßemÿbûO9 JÃòáz¤@o”'!W ÂþË P5t‹ÉÛ„m©cݳäoFϱ¸u¢RSS±ÙlDDD”ÉÁ)n´¡~SäÀ çBÉ×¥~Sl¿ýêÚ†›~ÀgÈXì‡÷•{ûg_Š»®ª*Ÿ~ú)íÛ·'55•Å‹KÿþýéÝ»7_ýµGÏ¿™~èÙYàã[8âëž•––‚䀡F=´Kí] É?íÊí‰H§¦¦2fÌŽ= Àìٳٲe f³‹Åâq>}ûöõ¸½JCƒ 5jÏ?ÿ¼Óvybߊ#11‘ *о}{hÕª+ViàO€GK;ôÌtÈÊ(òuªÇN`æç:=CP(zæ•[R©‹/2oÞRw4/¿ü2111èºÎÈ‘#ï¸2 û*ÜÙT¬X‘U«V1nÜ8âããoz_›6m á»ï¾»'ê§Û×9ÒJ£ï{C…´”KX7¬Ã~d?æ§^ÂX¯ºÕ èhWR±þ° õôq|ÇM'ï?“Я~–V©€÷ Qä¾ýëV’$Ñ®];Ú·o/z”@ ¸­Nfll,O<ñš¦9¿¼©ë:áááüë_ÿB–e¾úê+çyÆ× {BBÿûßÿœymÞ¼¹DÏ–Lf|ÇOÇúÃ*¬×`z°;¦ÎÝÈy{¨vLÃÔ©ºÍêL§çç’7}‚Gé…}Ü«ý·<Ò»»ÃèÑ£iذ!yyyüûßÿfÑ¢E.ÏèÑ£  fÍš?~œY³fñî_wÎÊÊbÆ n¿z9dÈfÏžíüw·nݘ9s&ÎßþóŸÿxüõàÐÐPÞÿ}š4iBVVü±‹“Þ¸qcÞ|óM§Í[±b“&MBUUç~̘1DEE‘’’œ9sXºti¹Ô¿,öõŽr¤­Àô@ –z.Cx$rµZ.÷X~úÛæ×kŒ×³ƒÈ< l6ÑÓÁË‹/¾HãÆyä‘Ge™¹sç’’’¢E‹xþùçY¼x1+W®ä—_~á›o¾ÁÏϸ¸8FU.Ï×órQ6w:ÂJý&èù.÷ØöíÀ²üóR§îÅþ[é‹».Ë2#FŒ`öìÙlß¾fÍšñÙgŸ‘Àž={xöÙgÍÂ… ¨[·.3fÌàµ×^cÇŽDFFR«Öuÿ°<ëGNä<ºË `z¸'ß|†šxl6Ô gœNsQØì]C …‘ž IDAT½\ ÜÑôïߟiÓ¦‘ŸŸOnn.qqqôï߀°°0Î;‡ªªäææb2™øàƒ˜ºwïN~~>6› ???âããÙ°aCùÂhF=¸ ¥a30š±ܹFÝÛ—^ ø“öß²¦/MþÑÑÑÎhv50lÛ¶í¦÷?óÌ3Îÿ_½zu±åíÝ»7/¼ð‚Ëo4iÒ„¹sçâïïφ ˜3g6VȲŒ¢(’––À¡C‡4hP¡v æ uëÖ.ŽvýúõY¸p!ï¼óõë×çøñãLŸ>”””r¯ÿˆG! ÉÛ,××Þx=ÑßQâ;êC$_çï¦N]ñù>¾#ßÇØ¬ù þ7¬¡‚; £Ñˆ,ËX,4h@ýúõ)((ÀËË Y–Y²d ÉÉÉ<ûì³¼þúëÒºuk^zé%äòŠú* ¶};0ÔkŒR«ö#…#ÝJ“VøŽ›îü3D×,Qzà^ì¿eM_Òü{õê…Ýnw®å ";;Ûy}òäÉÎèkhhÉÞØ·lÙ’äääBkˆ×­[Ǽyó6lÿøÇ?èÒ¥‹ÇËÎòóóÙµkÄ××—fÍšñá‡îr_Û¶mY¿~=“'Ofâĉ$&&:¯U¬X‘‘#G²bÅ ^zé% œë³Ë³þw*E¤µŒ4ðõw¼*Ô4 V8ÖÅøŽÒõû¬¿|wó庆$¸ö2B—%ád ‚?«ÕJNNAAAÎ5†ááᤦ¦¢iŸ~ú)íÛ·'55•Å‹KÿþýéÝ»7_ýu¹”CÏÉBÏËEÏÏs \\Ã^ÌiOÒ ÷jÿ-Kú’äß AFÅóÏ?ï¼vþüyÂÂÂP»Ýîtp8€$I%ªkß¾}‹´7û÷ïgÿ~ÇÁ'OždòäÉL™2…÷Þ{Ï£|‡ÊÈ‘#Y¸p!‡âã?f̘1.÷lݺ•æÍ›ɤI“hÖ¬™ÓYNMMe̘1=z€Ù³g³eËÌfs¹ÖÿNÅ£pŠž™Y( š•~ȼ‚ìü·!(=óаà'!!-Z¸D~œÿîØ±#ýúõCÓ44MãÈ‘#¬]»–&Mš”¯S°f ÖøXzàÏØ¯BPPP‰Ó{’:u˜;w.ÇçĉÎß/^¼HRR]»v-S½½½éÔ©k×®õè~»Ýîqý/]ºÄˆ#xâ‰';v,ÑÑÑE¶ßµúÌ›7ž={:;vìuë^_JvåÊç‰åUÿ»Þ‘F×±ü°s÷¾jÖƒC•jHF£Ç²9€©C$_?$_?Œ¯ÁÁçŸΰaÃðóó#00¡C‡òùçŽèo»ví>|8£G&//   dY¦Zµj$''—k9´+)h™éXzàÏÖ¯¡( ëׯ'>>¾Ð’ wéÝ]oÔ¨ , 66–íÛ·»öIMcÊ”)Lœ8‘ûï¿£ÑHÓ¦Mñòò*Q»víʆ ÈËËsù=((ˆ9sæP¯^=$I",,Œ‘#GZk\\ýÛ·oï\fѬY3ÌÌ™3ð÷÷göìÙÄÄÄ I‘‘‘ôë×Ïy¢Àܹs6l*T`РAlÚ´ ‹ÅRnõ¿“ñøø;ûþ ª˜»ôB‹@KKÁ²ê+ôœlÒÛ6¬CêÖŸ¡ãùÞ‹uÓ‚?œ5kÖÉš5k˜?>ëׯwFk† âÀf̘Á’%KPU•Áƒß¶2›´B©ïÏ›:VO úo1ý×éÃØíœ8q«ÕZhI†»ôÅ]W…¯¾ú I’ø×¿þ…Ùlvôͼ<ço+W®Äf³1zôhjÔ¨ÁéÓ§;vl‰NÚèÛ·/Ó§O/ô{FF«W¯fâĉDEE¡ëºóœkOë_¥J&L˜@`` III :ÔUÏÎÎfùòåL˜0jÕª¡( ñññ¼ÿþûÎôÛ¶mcÆŒ,\¸ooo<È›o^ÿFHyÔÿNFŠŠŠÒï” 6nÜ(> îZ6oÞ|GÚ0a_‚»“*UªðÅ_ЩS'a_ï@ûªÜiÌ´iÓñ [@pwpã'l‹Zƒ(ì«@ (-}úôq~QUØ×;ϾÞQi@ ànA|úJ @ ( €×{ÝEKÜB Æ}[ìuÑþè_@ ¸ûÆ‘@ Jp¤@ áH @ w£#­ƒn±‹V½XçlE;téÖ>ä–ŸÏ׳ °Lù5á’P Á§Ÿn³øƒõ÷–<_Ó±LZeÒz &¬EÝsþ•zà"Öÿm½ëäsWŒ6ÛÂ]èùÂ&î Ó%ëÂ`׊¼îßihÑò¥.fb_wýb&R€rëh”6Ñ·OYÊ ?§þHBGGiZå¡: Kåû|/¹v¤`¡0ÏôÊjÇòÎ:”Gê¢t¬€ý§cØ:Ž×Ä®`oyÿ¸Õúkùøȵ¢Ër7†VQZFÝžçËæÑ;¶¿ÝÝÊr í‹zà"êæSh)9Há~(jaˆ‰¸ûœò%{0T E ò¾®þ€¡i”®Ž³~õäl¬ v`ù ê±dì«b~óAWþ3Æ'#WÅúù´3é`³ È5C1=ÝÂ#ýv—Þyß§›@‘1 ¼ï¶ÊO;›ŽuÎ0]~7})Ðû®ûÍê¯n;ƒmýÑ«“¬ëí`|¬†U±ÎÚ„¡}u ͪ8ó²o8‰yÈà‰‹P`þå4Ú±d°©…m°®cÿñ8ê¾ ¡Y”Nµ]òÖN§aûþ¤ç#ù›]Êã.½âƒ\5Û7û0ökvsGZÝ| íD ¦¿µEò3£OF;™Z2G:ß&FíÒ:Ñç3°Îÿ c· Ï´@϶`ßy4½DÎh™Ž2ÈÏþÝaôË9˜¶lKö`‹?‚ñ±˜r}¾dR0>ÙX(Œ DH>&ÔƒINGZ;|¼”ÛÖ?n‡þŸi\-=)ëÒ}èY”k‹þsÈGýí ö'ŽcT0ÚålôÓWîºöQ$MÃоzák“P:Ô_“Ë°åYÑ“€–šù6¤¨`Lϵrøak‚b(rÜ(N¿=I¯_ÉEF·Úѳ ¼n«ü¤oÌ#¼+ûEqõ7´ÆÐ6ºØöW‹Á¶b?†Æ•AûÇ0öhè™íh=¤ ¾ÈZ´"ÞÙ·žF¿ùõ蚎máNT?3†VŽÉ–v9Û’½û5CŽAÏÌGOÉñ8=€Ò¡&ÖyÛP_ÂP¿bÑŽ´~9 ¹J0R˜¯£qEòøÕͧΪ#W @y¼R€zžÛ·:š–I׿Qo~ë!%,¾Ã4¼“s«î9ºÿ"¦Z;fŠs¶bhYuïôKYHü0>Ù)Ô÷ž0àöuGP:ÖÄмªCmÌJ!eÔ5 Û²ýhG“Á[Áا)r• «†)õדhg®@¾9*剆H¾æ«3:;–OÅôÚØ¿?‚vä2’É€iÈè6Õ­üŠu0r­¨;Ïaz­ƒsvm|¢1–oÂØ¹6˜•båë‰þXÿo;úålÇù6‡Q­îu´ÇEK¸ìˆˆ7ŒDy¸Žsfl³åÑz¨;΢K)Ô~z®ÛŠýè³À !…û£©E:Òꎳû4£ P®‹mÍ!gýÕ_N t®í´ R ·Ë›wéªÜ©6ê†7w¤å¦U°¹»YÁоz¡¶o<‰vø¦÷!ù˜°oNÄöÍ>‡¡ó1az£#ÚÉTìk—úÕ§}ûŒ}š"{cÿ>ëÒ½˜_mÿçä5íìŒ)>bÿñJÏF»Å`û.û÷ ˜^i縘–‹¡fÆÇ€,cûj7öõÇ0öjt½³æÙ°-Þƒ¡^ÊCµÁ¢:Çh(“üôäl$_3rØu£-…û!™´”§±¾™|=ÑÓKm®jÿÞT¸m¾= vÌotD×tìK÷bû.cφÎ{lË÷£ôhˆ±{ýBí§n8áˆFÅvB’e´Ói¿òÜØTäF•Ð&UÅа¶“©åjßnÖ¿<Ñ_íx Öåû0ýµ9rt(zV>ZÂåÒGV#Ál@OÉAªäöùžè™ìs1öI óEŠ @;t ¹±#€£žJC ðr:‚ÅÉÀ¾æØ0Çv]Ƕâ@‰ÚË]û¸³Åš÷”Pu W›ÚÑbôÇûîN>ÅŽž`±£§ä W .Ú‘nVËÿmÇpÂŽTLEÔgœ×´c)(%$£ßù“0ý¥1XTlñG6uï”Ç€Y/#rƒŠå®BÅÙwòQSÛŠýÎÍ™z®Å#ýñľ»“Oqã‡GeF>zßüu¼bÀд2êÖS…ºÐÎgBC^Ú¹t¤Za·M¿õÌ|ÇR’p¤*Aèi¹c-7ùyb?ô¬| Þ‹wþ©›K4~§îìGYì›ÇúëÎÆ„û!ûyIA /DZUÓ@w蟞”…ž”®ÈŽúÕö˶8¢êMª`z®’Ñ€mÉÏÓ;+!!z£eæ‘Â|1õo‰–š‹ýÛCXÿ»óëÁbCϵ`[u$ÉÅQ¢Àæ0^åŒTÁd =׊ämüSñ’Ÿ ’cÝV1ƒ¯¤\ÓܰƒTϵ`ûö0äY‘#Ñ5Íñ û÷­~ù0’¿ò ¨Z®%Àû–ËWÏÈG2\Þ¢\Û,¤gä9£ZŵŸ¡½ã¡ý—ŽÙkõ0 Õ.ÑÁßÏ$º·ÑõupAùÙ·Òö/=-©œuMϱ€¿Ù³r—PÿKÚÝÙ'¹vX{ȱŽ6ÄõX2Æn <’nQýÿoÚ*Î~;‰ñqÈâê~ãŽ7ïÅ#é’Gúã©}/N>¥-ÿuƒ®#¹Yæg| 37 ÿ¾^FäªAh‰©`‘£‚‘Êè7”D¿ÕC—Ð3ó±Lýéj{ZQ'ah]vùyh?n¶FÚÓñ«Xý(Î~”Ѿ•D‹•ÁáKàg‚Œ|´)ȵ*”OÇ4ÈHf=ßêXžèÙ‡Ž_«¯¯ ¥W#¤«ÁÃý5°OûÉÑÒ»À‘~×uŠlA9Ìã_š`™¼r­àgBò6bìß²ø(Ñ€žk½ieõËõ¾n:±žîðøå{átYB®|}³FinK÷ahX C Çkílºc½`I(N~ÅÎ4ýÑs-h©9ÈaŽ5pzr6’Us®¹÷H¾¥}~7ºMuDüL΄®ë.;Ë‹ÏDÂÐÒ±\·ØQ7%bûbg¡æ‚»¥GC0H…ù2Û·²:iÁ>èÉÙ\>Ašó`U‘=ü”PÿojŸ%‡ÃUbû$¡M5Ôg‘£Ck„]Ÿì¸‘žkE·ÚN×t‘½¼P%Þ{t‹ìû­?¥ o÷GÞù™PWFÛw±° Sõx ä2tJªßÚ¡K˜^líˆØÚ‘ËØ·žöÈ‘v+?OíÇ-¿Šµe-_9è/šŽcï¦èÙØÖ&`~-¬ÜR*ú£ŸMGªqµ\q:Ír„¿cÄÕß$_“ë¤ÂMz² Ðuõ€ci‡®cýïÔígÐs,ŽÙÚžóŽ5¯Wkh}ÕAô,Ç«=߆v*͵2¡>èùV´³é×gŒWª拺ç<ºÅŽv*ͱå÷3–ƒIchS±Ÿà8šÄ q/`|4ûÆŽãWl*ú•FÇ+EëÚCŽ šMÅöÝaÇ«a×9Û×qgݱÑS ñ)r6*¸Ë£Ò!>EF.ËjßÊTi[ ûOÇ:kžþ˜ë«]OǬ¤,lËö9&åFý<ÑOìóµh2šî”À>šWA=| uïùëÇRy Éׄ\-ÛGÑU =3uÛ™;Hé$Œ]êa[síd*¨º£­mªç2õ ýnõø)y!À ýRVñºü@MÔ…i9&íx zK«n¥~ëÙ´ËYÈQ×7 JÕCÑΦ{61ö@~žØ[9~¹³e*_9è¯}Ûi¤ ~HUƒo+Ìì;Ζ›nZWÃþóqÇ:þ|öŸO¸l¸¯:öŸ;l6Ž¥0r­0PdÒ»LàB| ½MQœ õ—&Ø~8‚}ãI°Ú‘¢‚Qžmu½ k#yÆ:o›CØ^F”vÕ úõè’¯c¯ÆÎµ'R€Æ~ͽQºÅ`[~ËÁŸ1Ô‹ÀØ«‘ãY7ÊËߌeî6ôœ u#PºÕ¿wøªA˜žo=þ(¶Õ‘½1´ŠöøGº úï‰}Ví«ÝLYæé¥Ö`=³Of¹^8ÚáË·£ß|Œ}š:ÖnNù9Üßá”ï=Çè—Ü8£ArLXRsB}ÉüLåfßoÇø©´Šr¬ÇíÛìæãˆ¿¹~ZBr¡È+^FÇ«ôßfðûs Õç ]œ~—^=œ„¡†kôS2+ÈUÑ.yÔOÜÉÏûq+Ç/wö£¬å+‹þêù6Ô '0½ÜöúÜ¡k}l w¡4©ìÑ©+¶¯÷¢¾vÕq‚ÉÕ%:æ7::&"*Af¾s£°Ò¶šã„–k寊ҩ¶ÿÛŽnS‘+búK×ö+&½sBðëÉ"7ÉJQQQº×{ÝÿpCc³¥}õÂk«þŒû¶ØëwBû ù DÿüÑý×¶þ¨óø)Áh_uëÿ¶¡´Žvž°"Ü ¨{Σî9饶.n Æ}Ëu¾—.„õ§FÈW ý÷fÙŸË@Û{åþš¢­ïTû*IŸnmë)ñ‰pÁ½Óµ®ä9Κ~ºE‘§Ö(¢‰@ð‡¡êX¦ÿŒd48NðÃÒŒäkÂ<à¾ÛöÅ]à×ùÇ™ë7Ñù;Æb™´Òú#ä+ˆþ[$é®ýtò=k_…-¸×(F票¨(ñÂ] @ (©-š@ @ Ž´@ @ i@ @8Ò·ƒÁÀÎ;Ù¹s''Nœ OŸ>w§0d™iÓ¦9ÿžþyÓ¾üòËÎtS§Nš}ê—$Iøúú–K™zôèÁâÅ‹ ý^±bE~ûí7ºtérÛÛÉ“úý‘å»(ÁŒª=ÿfweù} ~ô¯2„Ôþˆá5ß§mH绦ì&Ù|OËO Ü~”ßÎ  fÍš?~œY³fñÃ?Üñ•PU•–-[°`Á‚»V’$Ñ®];Ú·o_â´ÿûßÿœÿ¿yóæ§ÿ÷¿ÿMÇŽÉÏÏÇËË‹C‡ñî»ïràÀ{¾“”—~UªT‰ùóçßR'2++‹ 6pöìÙÛÞNžÔï(ŸI63¡î,âS–±!u-UèɃa=ùç‘¿£êör{V–Çñœƒ¤ÛRîJ]°B>J‡U³`’M%ΣgÅþ4 hûÇ^¿í“˜¢†1#qÂ=+¿²Ð8 íCºPÁ\‰dËE6¤­%!{/ý"RÏ¿1VÝ ºÎ[*ñÉË8•w€Öɧ§Þ%Õz€S8Cª»í: ü¡Žô³Ï>ËàÁƒ9r$»ví¢nݺ´iÓF´Ð=Ä´iÓ˜7o¾¾¾ôë×ÿüç?¥rêExËŸ‘——ÇÈ‘#ïØúýQåËSshäßÒéH×÷kNVþ”°j–%Í¿ku4ÒÅ–ôÉWsÈWK6ɨíÛ€0ÓóõRoƒÏ=/¿ÒÒ:¸C»²,i>góNáU™jÞu\îYŸ²ŠÍWâˆñoÊsU‡òá±XlºUwp¤M&o½õdÛ¶mìÛ·}ûö9o”e™Я_?L&‡füøñ\¾ì˜.]º”I“&ñôÓOÓ¹sg222ˆeïÞ½¥÷÷÷gíÚµ<ú裌;–‡~˜üü|ºvíJ~~>Õ«WgРA´lÙ’   víÚÅèÑ£IKKR,grssYºt)&LÀ××—ÜÜÜbåͪU«hÕªV«Ã¨*ŠÂöíÛéÕ«çÏŸ/³üCBB˜4i5Ân·sìØ1>þøcgÄÜ]þîXºt)_~ù%½{÷&&&†'N0räHNŸ>íQzFåŒÆ®]»–©S§RPP@pp0Ë–-#00ÀÀ@vîÜéLצMTUu›¿¯¯/o¿ý6=ôÉÉÉìØ±Ãåú¢E‹¨SÇ1ð3`À~úé'çuwíëIû=ôÐC¼þúëT©R…´´4,XÀÂ… =ªŸ»ò×~žØwhºŠª«„™+¢ «fBçõ0SB»åS Ù—3ù'Xqé3ríÙô‰ü­€Õ—ðXøSø|N×ߢFa޼êÐù±ðü,Žæì Ú»*<ަ«T4WeyÒ|ºEô$朙D¾šÇ;õf3ýä?Ȱ9ìYóÀûhЊç>ñ(½;L²™.á!Ư’³vñCòr§ôXx´"ÀÄ“æÊôˆx€É'F¢éšÇŽìãO³4i/V}Ãc{ãIý$$îíB‹ P$…¤‚s¬¾´,{>?^·Á/ƒcjÇ9ó¾V~/Ù›!5þÉ¿ßæ±ð§ˆñk‚U·2óÔDlšµXù]£ž_c:…õ ØJ®=›mé?ñ[úGÿTüy¢âóDzE£¡’l¹ÈO)«¸PpÆ£6=Š¿Ò,°ÍUH±&±,i>iÖd€b븭_q$….þÂÂó³œæóù§8Ÿê¦i²÷¢£l #ÙrQ š‚{ FF§]ƒ âñǧwïÞÜÿýìØ±ƒéÓ§»Ü3yòd¾þúk:uêÄÎ;;vl‰Ò1kÖ,:D·nÝxá…ÈÏwDjÔ¨ÁæÍ›éÞ½»3R>bÄ!Á[Y|饗8yò$¹¹¹nåwæÌxøá‡ytêÔ‰#GŽpþüùr‘ÿk¯½F^^<ð:t`îܹN§ÝÓüÝñÜsÏ1vìXZµjÅ¡C‡øè£\dŵ¯»öëÔ©S¦Láƒ> eË–¼øâ‹Fëç®|ŵŸ'öÅFÙÌì4òoIãÀ•»@Ò IDATÖÌÞ鲞6ÌÁÉÜfz‡É'Þàá°'œ××\úŠz~M©æS›Jæª4 hÉÚËKœ×çãÃã#øðø.œ+ôüš>1ü’º–„œ=ôªø,ÿwv:º®QÇ·‘Gå/kúÇ#žÆ_ âãÄq|ròŸ„+Ð5¢¯óú÷ÉK™zbòϰäâ\g]JÇâ‹ÿ%ÕzÉYöß—ßGö寕_%©à,3O¿Ã‚sŸ8Lwò«ãÛ'#_d]ò×L:6‚ç>ÁpÃÊÈŽ¡Ý°j¦ŸÃôÿ`sZ<ö.j܉U—¾`ò‰7I*8ÇS‘/;¯WOêWÌ1H§í Z£êvÒ¬—Å€)Žôµ6;;ÛeÀº¶¹êÚ€ýòË/3uêTÒÓFrîܹ4nÜØesÑŒ3ضmYYY,Y²„Zµj9¯y’> €eË–±hÑ"ÒÒÒ8sæúlþÇdåÊ•hšFÍš5ILL¤yóæB‚åHll,Û·ogïÞ½4lØgŸ}Öcù]‹æ^£wïÞ,Y²¤Üäùòeš6mJÛ¶m1™Llݺ•£G–(wÌž=›S§Na·ÛY´hÍ›7'((Èm:///úôéÃÛo¿M~~>¹¹¹¼óÎ;üõ¯u:›eÁËË‹¿üå/Œ?žœœ²²²øî»ïJœOqíë®ýþþ÷¿óÑG±}ûvt]çâŋ̟?¿\ôÎÓö+ξ¸C‘ŒìÍÜFŒ_Sjù6àHö>—ëGrö³/ËQ· æJ¤Y/åSÓy½@Ëcå¥Ïx²Ò‹ôªô«.-¤@Ëóøù™¶4ÎåŸ$ْĉܲ홤Ù.ãåár„²¤7J&š¶çÛK_bÓ¬X´Ö^^LË 0H†r‘aã€Vø)þü–þK©Ò»«_ûàGø!e9yj›Ó~ ²Wµm.ô2ø°7s+;26’kÏæÊÕh¯'<Ö•SVq*ï::™¶+lMÿÑy=ÛžAïêTó©‹ARHÌ;ÊeË…µÁ¯iëHµ^FÕU~ËØ@Uïšx|=®iëç-ûº,sz²Ò Œ©ǘÚqø*þÎ߬ЃQµ¦2ªÖTZÝÏÿýUWîu€óçφ¢(ØívFÀ$‰€€BCCyï½÷ÐõëB¼rå Ψå””Ìf³s÷$=ÀºuëŠ,hhh(&L $$„ƒb0ðöö,G¦OŸÎ¼yóX²d »wïæâÅ‹Ëïûï¿g„ „††b·ÛiÕªo¼ñF¹ÉΜ9dee1tèP4hÀÖ­[‰‹‹ãÈ‘#%ÊßSNœ8ªª“‘‘Qì½UªT¡  ÀeĹsލVåÊ•=^r3ªV­JAAIIIe–qQíëIûU¯^„„„[¢wž¶ßÍì‹§äØ³ÈSsÈÓr ­öUüéñW| þ\,8ƒ$É%×vÇs!EH(²±Ðkwè7üŸ~õ_úmJd Ŧ[ËÒm©Îki%p(‹œ )At ïÍœ3Sœe+)ÅÕÏKöÁWñ§gÅþ.¹çª9x|±jŸs({O©Êf /2R}Miñ¨ùtíN¥*Q$æáÇÔ•\*8_ªç¥X’Ðt _ƒº®{\ÿÒÔ/Ý–ŠŸ!*Ë“ªÇ×™¤_ÿ,òO)«k¤ ËOG¾aR&# '[po9Ò/^$))‰®]»²zõêB7eee‘™™É€\¢€žRÖô}ôß~û­óȯ–-[òÈ#îкŽÁ`’-“'Ofþüù|ùå—dddx$?‹ÅÂêÕ«éÙ³'ùùù|÷ÝwX,–r“¿¦i|ùå—|ùå—øúúòꫯ2oÞ<î»ï¾rÉ¿(çõÚ$Ó~]¸p///ÂÂÂHMMu:€’$9'#×Ú($$¤ÄeIKKÃÇLJ€€²²²Ê]Þž´ß¹sç¨S§»víºi>¥­Ÿ§íW¬º¼¨ÈS:žªô2²w²+càX·ã×Ôåžö!]8ŸŠ0sEš´a_Öör+—ªÛñSœk¤ ’RnygØÓ0J&ü ä¨ý 4† !‘a»Ræüëû7GÆÀ«Ñc®–]Ælðæ­ZSùò¿9—ŸX¦ü ´<òÕ<¾8?«Ø(¯]³ákð»%61Ý–J„¹2góOÞÔ‘Ü‘±‘1Ë^Üú(ÏUÊÔ£Jõ¼`SçsU]õ¨þ¥%Óv…,{: š³?kGétÌšFâ\/l #Ã~à^@¾æ¤L™2…‰'rÿý÷c4iÚ´)^^^Î,XÀûï¿ODD„ÃÒ®];TÖôU«VEQƒËÿ³wçqQÕûãÇ_ÃÌÀÊ®&.(´|ÕoW¯Ž©]2×rËû-¸¶av¯.wÊ$4úŠd¤7 ìæê%í«¹ ©D ÐuOw M$ Yf~ðõä\•6×÷óñà¡pÎg?ç3ŸùœÏ9ÇÝÝI“&Ýr¿³gÏÒ¿4ÍMëH…e²²²Ø·oŸI[Ò~«W¯æÏþó-ŸqÜÐöï½÷èÚµ+*•ŠÒÒRΜ9ƒÁ`h´ø†Žƒƒ¶¶¶±nÝ:*++Í_eeelذ>øt:ï¿ÿ>‰‰‰&³¨§NÂÉɉ=zТE ‹¾ô]¾|™ŒŒ Ñh4´nÝš1cÆ4j››«¿øøx¦M›F·n5ƒKWWWfΜi²ô¢¾å³´þÃ劋\¹ÅàÑÙº…²ÌÁQã³nÃL¶·´qçi—A|sq5IùËöÈË8i¯ù¥âgº;>•ŽŽvOàíú|£Å]i¨àßÅi kõ2•­Êša­F‘}%µQý÷CQ '•ŸÅ§>äZu'<ˆ¾1??⇃¦f©•­ÚO»'Lö¹Ty[u3ÚÛÖ,Éi¦qÀJÕ8¯JH+Ja@‹‘´µí€½º9ƒZürÌ iéK[ÛŽ¨PqÍPÎåŠ_ê<;ÿßztVvh­¬Úò/üxå{eV×’ò×—#[/®gÄ#¯áeßµJM[ÛŽhëðèßJöÓ×möšæØkšó¬ë°›–O ñ R¦=’““©¬¬dÖ¬Yxzzrúôi‚‚‚”¢E‹QRRÂêÕ«±¶¶¦¸¸˜øøxÒÒÒ,J¨¡áCBB˜Bˆ»8NIIaÿþýdgg³qãF^}õÕ&I°¸¸˜ï¾û޳gÏJíßC,mÿ¦h¿êêjôz=z½žÔÔÔ®nÍ•¯±Êÿ /ðõ×_søðaþõ¯1xð`e[tt4GŽ!++‹ÌÌLÖ¯_OïÞ½•íGŽÁÓÓSùÝÃÃ>p骓DZyq46/ŽFÛ«¯ÅAµOPÂUŸ<ö@¶OëÖ­Ù°aCûﺿMÙÿ×7ÿ÷ KÊ'„¸óLžÚáïïOzz:]ºt!**ŠV­ZñÉ'Ÿ4j‚W¯^%00Pj¾‘?žÃ‡³gÏžzÇaIûKûÝ›üüü˜8q"deeñÄOЫW/“}¢¢¢ˆ`ðàÁ,_¾œîÝ»S^^.(탣£c“÷ßMÙ܉üßM–”OqçÝ´´Ãh4rèÐ!¦M›†¿¿?Í›7¯ÙÑÊ RRRØ»w/111´jÕJ™Ù¿?ÖÖÖ¿Ð5²²²hÛ¶-+W®T.ÿåææ2`À€›23pà@’““ÉÊÊbëÖ­¼þúë¿g´–ô\\\ˆ‰‰!--={ö°lÙ2ž|òɇ¦!·nÝÊôéÓ™7ovvvõŽçvío®ýÌÕRR>>>¬\¹’ü‘ÄÄD:tè`q¾:vìHDD)))dgg‹««+žžždgg›*•Šï¿ÿ^IÃÜñcooÏüùóÉÎÎfË–-<õÔSuª·Úò×Ô¬­­yçw˜>}:©©©”——³ÿ~bbbnfÛ¶m ÚµkgQËùUu “ªÃ?ÞwícNnn.mÚ´Q~÷õõ%!!¨y›êÎ;ùꫯðòòRÎóÌÌLÔjµÅýwmÌ…Ÿ1c†IºÇ'--Í¢ó«1òoggGhh(iii¤¥¥ŒN§3é¿ôz=‘‘‘dgg“’’B·nÝ,.óæÍÙ³gvvv„……‘žžÎ®]»°µµm”ò™ëß„wp }Ý¡C‡())áÑG`„ Œ1¼½½Ù·o .àÌ™3=z”Aƒ)áûõëÇO?ýÄùóçxíµ×”ËG޹)½~ýúÁG}„^¯çÍ7ßD«Õ*ÛkKàïÿ;W¯^å™gž¡oß¾ÄÅÅQQQñÐ4äÉ“'ñõõ¥  €¯¿þšž={6(¾ÿlsígIý=š   zöìÉáÇ‰ŠŠ²8?žžž¤¦¦2|øpe&oÆŒJÙ<ÈСC•ý{õêEAA§OŸ¶èø™;w.ÎÎÎôíÛ—Q£FÕy\[þšš§§'Z­–~øÁâ0#Gޤ¢¢B©sôóËXvµæßkå¯]3ùÛýÐ> QTTDÿþý  77W9Ïõz=ÕÕÕÿæ˜ ©lùå—¹zõ*S§NµèüjŒü‡††Ò²eK À Aƒððð 88ØdŸððpéׯ™™™Õ©œœœX¼x1‡fذaŒ3†²²²F)Ÿ¹þMqÒ………Ê·Ú±cÇ2þ|ŠŠŠˆ‹‹ãøƒróêU«ðññQÂúøø°víZ‹32~üx¢¢¢HOOÇh4’ŸŸO||¼²Ý\ú.\ [·nôîÝkkkÒÒÒ8vìØÑHgΜ©õçºêêj–,Y¤I“X°`Agjks,©ÿ¥K—rêÔ)ªªªX¹r%Ý»wÇÉÉÉ¢øwìØArr2ƒ///Nžcuã‚)S¦žžNzz:£FbôèÑTVV6ZûÞÏ*ÓR(‹¤ê`&UûÓ)‹[X§›ïvû<(š7oN\\‘‘‘¤§§ß‘óK§ÓáëëKHHeee”––2wî\^yå“ÉœO?ý”~øââbÖ®]«L2XÊÁÁõë׳råJ MúÏÜ磢éÔúfÃ-ZpáÂpuuåÃ?Ähüýâ—/_ÆÑÑ‘ÒÒR¶lÙœ9spuu¥ªªŠž={šÌ(˜Ó±cGŽ=zÛÈ\ú±±±@—.]HKK#22’Ÿ~úé¾o$:}(¼òÊ+‘““Ó t¯·¿%êZÿ'Nœ ººggg~ýõW³ñ»ºº2gÎ\\\8tèjµZ¹, °k×.æÌ™Ãc=ÆÙ³g0`sçÎµèø±··§¼¼œ‚‚‚zו¹ü5¥óçÏãææ†F£¡ªªŠwß}€ƒ¢R©”ý-Z¤¬ÁýOƒæ÷î@­VSUUUïö½ßX±W?®F*vS>@¥³½oÚç˜Õ±²âÓO?%##ƒ/¿üòŽ_mÛ¶¥¼¼Ü¤¯;wîmÚ´Q® Üxæ—_~ÁÆÆ¦Îi}ûí·ÞXòù(„¸ é®]»bkkKNN%%%\¹r…qãÆÝvêÚµklܸ‘‘#GRVVÆæÍ›¹ö—H-qîÜ9üq²²²nÚV\\l6}ƒÁÀªU«Xµjöööøûû³|ùrž~ú釦1»wïNxx8_ý5¾¾¾ ú ½±ý-Q×ú¿¾öóúÒŸëŒF£²îïFQQQ|óÍ7Ê#éôz½ÉSŒF# ¼úê«ìÛ·ÔÔTeÐÜñãââ‚׫¾ÌåÏ\ù,Ý~+ùùù0tèP6nÜX¯üçååáîîÎñãÇ•ÁE^^ÞCu~UfìÁúO1VUQ•™ŠÖ{P£Ä{'ÚÇœŠŠ ÜÜÜ”07ÞOpcîââÒ ²Öçø½núôé899ñöÛo×ëüªoþóòòÐét¸¹¹qéÒ%e­R©ÈÏÏ¿#Ç^CÊgÉ磢 'nõÇN:É?þñJJJHHH ,,L¹ÔïèèHŸ>}L­^½š?ÿùÏõzo||<Ó¦MSnàpuueæÌ™Ê¥5sé¿÷Þ{tíÚ•JEii)gΜÁ`0<4 ùÊ+¯Æ”)SˆŽŽnÐ úVíoŽ%õ?|øp°µµ%((ˆuëÖÝtéúìÙ³ôïßFcrÙ»]»vÊŒœ»»;“&Mº)‰‰‰ 2Ö­[g²­¶ãçòåËdddˆF£¡uëÖŒ3¦NufIþj+Ÿ¥Ûo÷%&""‚ÐÐP¼½½ÑjµtëÖÍäf)s¶oßÎĉqqqÁÅÅ…I“&±}ûö‡çüªªÄp¥­÷ ¬û ¡úÒÏ`¨n”¨ïDû˜“››‹¯¯/öööôîÝ›qãÆÝ´Ï©S§prr¢G@Í©ºŠësü :”¿üå/¼ýöÛ·\ÎbÉùUßü—••±aÃ>øàlllÐét¼ÿþû$&&Þ±ûZ>K>Ÿ…MÃdFzÉ’%F~þùg–-[ƪU«”m‹-¢¤¤„Õ«WcmmMqq1ñññ&wV=z•J…³³3‡ªSF6mÚ„F£áã?ÆÕÕ•¢¢"V¬X¡ Í¥¿wï^¦M›F‡Ðh40qâć¦!;ÆÈ‘#´¦²¶ö7Ç’ú¿xñ"kÖ¬¡eË–¤¤¤rS !š†ª}ûöF©ÑÔ’’’ˆ‹‹cË–-MšÎÌ™3Q©TÌŸ?_*]ÐlÞâšÿ ”FÍÁ~ƼÅWlGIð$©d!„xHi¤ ÄûÖvÃUMáü#/¾ø"C† ‘Ê·VVʵ 57²Y¹{XüvÃÊïS0\¨Y_ÜXÅB!i!î:­VËîÝ»)//gÖ¬Y&Bae…ýûõ{¶®öéß%ióâh©K!„2wޝ¯o“Å]YY)7Ö!„⎓5ÒB!„BÔƒ•TB!„2B!„BÒB!„BÜ×i•µ Íæ-ÆþÝÿ×´¹Q©Àʪæ_qOzä‘GÈÈÈà¹çžk´8Õj5™™™dffrâĉ&½1ÑRõy;§¸Ç;;++,X ü¼ñƇ;v¬NžQ~R©TØÛÛ×¹«KÿÔýcCóÿ µ÷ü@Zݶ¶c°ŸÝ”°ô¨ï܃=´=½iºããÒ2wXJJ û÷ï';;›7òꫯÞr¿ââb¾ûî;Ξ=ÛhiWWW£×ëÑëõ¤¦¦Þ·uøÂ /ðõ×_søðaþõ¯1xð`e[tt4GŽ!++‹ÌÌLÖ¯_OïÞ½•íGŽÁÓÓSùÝÃÃÖi8sæLöîÝËîÝ»™2eJ“?·û~ü îÓ§3gÎdæÌ™¬X±Ââ°Ë–-SÂ=ýôÓ÷Ýñ! uëÖlذ¡Ö}nÕ¿Õ¥jŠþ±¡ùÚGˆ{‘2JV{ýºÑQYYQw•­Ú^ÏRõï ŒÅ¿ÖìdlÚ|¨œ\îÛŠ´òÕGP}æÄ]Iüøñ>|˜={öÔ;ÒÓÓéÒ¥ QQQ´jÕŠO>ùÄdŸ«W¯(gÎðóócâĉ’••ÅOV98aåÖ ã¯—©úwúõÆ_/›ì¬rk‰ö©¾Ë®¢jÖëa£@«@Ûãi¬ÜÛS}òÆ+Ehžøot/Ýü0›aÁzà Py cy†¢B E—¨Ü·ÃåKTʦ2u•©; ºê¾¨Èòõ_RñÝ·h{þ »ÉÁ¨ÿï;šþÉ“'ñõõ¥  €¯¿þšž={6(¾C‡QRR£> Àk¯½¦\Þ À„ 1b>>>x{{³oß>.üý-wsçÎÅÙÙ™¾}û2jÔ(¥“·4oZ­–~øÁâ0#Gޤ¢¢BÉ_C¨T*<<<8~ü8o½õo¼ñ?ýô;v”îp·ooo/^ÌÖ­[ ÃÏσÁ@¿~ý,:?Ì… ¥eË– 0€AƒáááApp°IœœœX¼x1‡fذaŒ3†²²2‹Î߆(**¢ÿþ››«ôcz½žêêj‹ú7sÌ…ŒŒT¶¿üòË\½z•©S§ZÔ¿5Fþ-iŸððpéׯ™™™Õ©n×¾Q>sǧw“ÀÊÙ CQaí³•åe”.š×ʰŸù!*GgTŽÎ/]¤â“0–]ÅXq •³+öS>¨Yë¬VÃÿ Vîí)û<œê¼ß×pòÏq-ÿ:g7¬\[P¹o/Õ'Ý_5YUIÅŽT؇ÍÈW±=ò¤ªög48ê3gÎÔºÝÃèYË·dÉÂ.ð! IDATvìØALL ¡¡¡¤¤¤Ô;ÝÂÂB‹¿õ_¸pлwoöíÛg2ÛrÝÒ¥K9uê”2ƒò׿þ'''~ýõW³ñïØ±£æ‹˜ ^^^œ(¬¬¬øôÓOÉÈÈàË/¿¬SÿÖ–¶ÏWùållê¾DñvíÛò™;>e -ñJ†+EX9»¢éöUÿ®™EµjÛÃùÓæ‰Z-v›Š¡¼ŒòK0\ÈÃîí@Tn-oz”±¼ìö}EÍM5Vn-ï¿i›~CÐzÆøÛÊW,¦*çÈÍB÷îÝ ç믿Æ××·N´ÿ©k×®ØÚÚZ<7 ¬ZµŠU«Vaoo¿¿?Ë—/¿í®¯ý<þüMø××ÅÝ(**Šo¾ùFy$^¯7yêÑh$!!W_}•}ûö‘ššªÌsåÊÆDZc7W...ØÙÙáàà@qqqë*??Ÿ‚‚†ªÌÆÔgÆÐÝÝãÇ+~yyy‡?zô(=zô`ûöíJý=zTz¸{À½p|ÔÆÜùáîîn6o:777.]º¤ ÐT*ùùùôowþZúeÒÍÍM©“×[_wíÚ5\\vCûíú'KLŸ>'''Þ~ûí:÷o Éc´OC5¤|æŽO!îú—äëƒâŠoÁhD÷ÒØùbð>voÏDýxó‘Ø5*šÎ]ѽòVÍ ºŽ grk:Á#ÐýÏëè^óGecs_T¤î¥Ñhû>Oå¾=\ýìÃ;>ˆ~å•W cÊ”)DGG7hÝ©S'"##ùÇ?þ¡,u0ç½÷Þ£k×®¨T*JKK9sæÌM³¡Ã‡ÇÁÁ[[[‚‚‚X·nÝM—®Ïž=KÿþýÑh4&ë”Ûµk§Ìȹ»»3iÒ¤›ò˜˜È!Cðññaݺu&Û S–ª8::Ò§Oef###ƒÀÀ@4 ­[·f̘1–·„††âííV«¥[·n&7ó˜³}ûv&Nœˆ‹‹ ...Lš4I[âË/¿dÊ”)4kÖ GGGnšõwǽp|˜SÛùaNYY6làƒ>ÀÆÆNÇûï¿ObbâM÷IÔ¦¶óלÜÜ\|}}±··§wïÞŒ7î¦}N:…““=zôj®¸ÕuP|»þÉœ¡C‡ò—¿ü…·ß~û–Ëu,éßê›ÿÆjŸ†hhùr| ÑÔ”k…UG÷SõÀ¨[¹cøí »¿¥úÄQTmíWЏöí¿°ö„¦Ë©:òoŒÅWÐt{ªN™©ÌNCÕâ´Oö@Óµ'†_/£rpÆøËÏ÷|E‹¥,n!ÕgOÞ•ô;ÆÈ‘#´¦rÉ’%F~þùg–-[ƪU«,»wï^¦M›F‡Ðh40qâD“}.^¼Èš5khÙ²%)))„„„ÜÏÒ¥KY²d éééäææâççGEE!!!Lž<™ñãÇsìØ1¾øâ æÍ›g¶¤¤„íÛ·3dÈöîÝk²mÑ¢E”””°zõj¬­­)..&>>^YË=uêTÂÃÃÉÈÈ ''‡µk×âããcqù“““©¬¬dÖ¬Yxzzrúôi‚‚‚” s>ûì3æÌ™£¬%ܼy3Ÿþ¹ÅéoÚ´ www6mÚÔ¬9mÌ–h˜»}|˜cîü0'88˜Y³f±k×. æxxxòPÛùkμy󈈈`øðáìØ±ƒÙ³g3~üx“} ™={6ÑÑÑP§YÙÛõOµN²ètDFFÜtEbРA”””XÔ¿5$ÿÑ> ÑÐò5ôø¢)©Ú·oo”jM-))‰¸¸8¶lÙÒ¤éÌœ9•J%oŸ7Q«ÕìÞ½›?ýéO Š'55µÁq9…T¸cßÚšøM{üãyñÅ2dˆT¶¸%ggg,XÀ,~»áرcéÔ©Pó!ç¯BÈ@Z<´Z-»w寮¼œY³fÕé&%ñ𨮮¦sçÎõ »lÙ2åÿ3gΔʔóW!YÚ!„B!D½XI!„B!i!„B!d -„B!„ ¤…B!„´xX=òÈ#dddðÜsÏ5ZœjµšÌÌL2339qâ¾¾¾w½œ/¼ð‚ò:[ñ€tvVV,X°@ùyã7,;vìX%œ<ãøá<¿T*öööÒxBÊã£8p eeeFΞ=KDD?üðƒÔÒC %%WWWª««ÉËËcåÊ•·|³aqq1ß}÷gÏžm´´«««Ñëõ@Í«`ïçÁÁ¸qãðòò"''‡Å‹³mÛ6‹Î¯#GŽ0bÄNž¬y3¦‡‡›6mâÉ'Ÿ´(mþö·¿1`Àt:]£~ÑyP¨T*úôéS¯—©Üøø»ÔÔÔûîø ׺ukâããåÜBÜz Ell,ƒfùòåtïÞòòr©©{œõ—¨>z€ê3'ꇿ¿?ééétéÒ…¨¨(ZµjÅ'Ÿ|b²ÏÕ«W ” ÿ~~~Lœ8‘ÀÀ@²²²xâ‰'èÕ«wêü2äææ¢Ñhäƒ^ŽÑ¥„7¹íÒŽmÛ¶a0h׮͛7gÏž=ØÙÙFzz:»víÂÖÖ;;;BCCIKK#--àà`t:Iœ$99™¬¬,¶nÝÊ믿þ{F¬¬ð÷÷'%%…½{÷C«V­”í...ÄÄÄ––Æž={X¶l™ÉlŒ¹í ÿžoH'lÇNÅfÄË`mÓ Ù¡C‡˜6mþþþ4oÞ€•+W*Ë/rss0`€I8sõ—””„+W®äÇ$11‘:Xœ¯Ž;AJJ ÙÙÙÄÆÆâêê €§§'ÙÙÙX[[+û«T*¾ÿþ{% síoooÏüùóÉÎÎfË–-<õÔS–‰±¶æwÞaúô餦¦R^^Îþýû‰‰‰ÁÒó«¡~ûí76nÜHZZšôj ðç?ÿ™aÆ5î—Ü{àø0wü'%%¡×뉌Œ$;;›””ºuëfqÿm®ÿ7w~™ËŸ¹ÏsÌ…¯­qvvfçÎ|õÕWxyy)ý`ff&jµÚ¢ü !ÂôÈ‘#©¨¨àôéÓÊßœœœX¼x1‡fذaŒ3†²²2BCCiÙ²% `РAxxx¬„íׯ|ôÑGèõzÞ|óM´Z­²}„ Œ1¼½½Ù·o .T¶ÿýïçêÕ«<óÌ3ôíÛ—¸¸8***,ÞÞÐøïuå뿤â»oÑöüv“ƒQ?þß ŠïСC”””ðè£ðÚk¯¡×ëÑëõ9rä¦ý-©¿Ñ£GDÏž=9|ø0QQQçÇÓÓ“ÔÔT†®Ìä͘1€“'OrðàA†ªìß«W/ ”ã×\ûÏ;gggúöí˨Q£”QKó¦Õjë´ êVç—¸û³Íš5SÖÁ6Ö ä½p|˜;þÂÃÃILL¤_¿~dffdqÿm®ÿ7w~Y’¿Ú>,Q[øÚú—¢¢"ú÷ïO@@¹¹¹J?¨×ë©®®¶8ÿBˆ“ÉÒŽ)S¦ðÖ[o““ÃèÑ£©¬¬T¶;88°~ýz6nÜ@aa!:___z÷î­tLsçÎeç΄„„PYYÉøñ㉊Š"==€üü|âã㕸ǎËÔ©S)** ..ŽÉ“'cooOii).\`À€ôîÝ›}ûöÝ4ófn{Cã¿›šÍ[\ëö’àIPUIÅŽT؇ÍÈW±=ò¤ªögÔ;ÝÂÂB‹gU,©¿¥K—rêÔ) f†û¯ý+NNNüúë¯fãß±c666xyyqòäIž}öYe{||<&L 99’’’,jÿêêj^zé%ž~úiJJJؼy3~~~@ßøZãððpÀóÏ?¯œ'æÎ/q÷Œ;–?ýéOTUUa0xùå—ùî»ïˆŽŽnpÜ÷Âña®ÿøôÓO•ÁþÚµk•e&@­ý·¹þ_­V›=¿,Éßí>,U[xsýKcÔ¯â!H/Z´È¤ó¼•o¿ýö¦¿µmÛ–òòr.\¸ üíܹs´iÓ†Ó§OÓ±cGŽ=zÛÎÕÕ•?ü£ñ÷7–_¾|GGGJKK‰¥¸¸˜€€ºtéBZZ‘‘‘üôÓOµnoŒøï¦’àIõ hlØÛß[´haÒ¦µ©ký8q‚êêjœ-H»ºº2gÎ\\\8tèjµÚä²î®]»˜3g=ögÏžeÀ€Ì;×¢ãËÞÞžòòr êUOçÏŸÇÍÍ FCUUï¾û.D¥RYt~ 4šßOGµZMUU•ôPwÈÂ… ‰gûöí  @qqq£Ä}·Kú?Àä Ò/¿ü‚ÍïKÄjë¿ÍõÿZ­¶ÖóËÒüÝîó§.nÞ\ÿÒõ+„xÒõ•——‡N§ÃÍÍK—.)¨J¥"??_éXüq²²²n _\\Ì•+W7nÇŽ»íɪU«Xµjöööøûû³|ùrž~úi³Û#þ{¿%µØô‚Ö{0Æß®P¾b1U9Gê]×®]±µµ%''Ç¢ýëZ××~ž?þ?ÆþFeÝᢢ¢øæ›o”Gféõzl.!!W_}•}ûö‘ššªÌškìììppp¨×à)??Ÿ‚‚†ªÌvÕçrwwçøñãÊà$//Oz¨;hôèÑÄÄÄ`cc믾ÊÒ¥K%Þ»}|XÒÿ™S[ÿm®ÿoÖ¬Y­çWc䯡Ìõ/×®]ÃÅÅåžÌ¿âîi”çH—••±aÃ>øàlllÐét¼ÿþû$&&*³ñññL›6M¹ÅÕÕ•™3g*ëì S–8::Ò§O%÷Þ{®]»¢R©(--åÌ™3 ‹·74þ{î¥Ñhû>Oå¾=\ýìà ¢;uêDdd$ÿøÇ?”K±æXRÇÇÁÁ[[[‚‚‚X·nÝM—®Ïž=KÿþýÑh4&ë(Ûµk§Ìȹ»»3iÒͳô‰‰‰ 2Ö­[g²­¶ö¿|ù2¢Ñhhݺ5cÆŒ±¸¾ „††âííV«¥[·n7Ýl[›íÛ·3qâD\\\pqqaÒ¤Ilß¾]z¨;ÄÆÆ†6mÚ°téR¢££ñòò2™nˆ{áø0×ÿ™S[ÿm®ÿ·äüjhþÊ’þåÔ©S899Ñ£G æŠÝõ/ýw;ÿBˆ»GÓX3kÖ,víÚÔ\B W¶oÚ´ FÃÇŒ««+EEE¬X±B¹<¹hÑ"JJJX½z5ÖÖÖ¯¬µÝ»w/Ó¦M£C‡h4 ˜8q¢¿¹í ÿ^g,þ•²¸…TŸ=Yï8–,Y‚ÑhäçŸfÙ²e·|ŽôíXR/^dÍš5´lÙ’””BBBnŠgéÒ¥,Y²„ôôtrssñóó£¢¢‚&OžÌøñã9vì_|ñóæÍ3 [RRÂöíÛ2d{÷î5Ùf®ý§NJxx8äää°víZ|||,.rr2•••Ìš5 OOONŸ>MPP2CgÎgŸ}Æœ9s”µš›7oæóÏ?·8ýO>ù„Þ½{cccƒƒƒƒ²Öµÿþuº!ëauíÚ5ÞyçšsÉhTþßXîöñaîø7Ç\ÿm®ÿ7w~54 eIÿRXXÈìÙ³•uóŸŸ×ó/„¸{TíÛ·7J5ˆ¦–””D\\[¶liÒtfΜ‰J¥’·Ï‰›¨ÕjvïÞ]¯²Ü(55µÁq!„x0h¤ ÄûÖvÃUMáü#/¾ø"C† ‘Ê·äììÌ‚ 8pà+V¬°(ÜØ±céÔ©Pó!„BÒâ ÕjÙ½{7åååÌš5ËäQcB\W]]MçÎëöÆW„Ïœ9S*S! K;„B!„¨+©!„B!d -„B!„ ¤…B!„´B!„yj‡â¡`eeEDD„ò{}g4 ¼¯ëâ…^ÀÏÏ—_~ù¡L¿>T*vvv”––ÊÉ$„´âá¢R©èÓ§O½^¦rããïRSSë=x7n^^^äää°xñb¶mÛ@tt4¤¬¬ £ÑÈÙ³g‰ˆˆPÞPyäÈFŒÁÉ“5o.õðð`Ó¦M<ùä“Ò°wHëÖ­‰ç¹çž“ÊBÈ@Z!î???&NœH`` YYY<ñÄôêÕËdŸ¨¨(bcc}:©©©”——³ÿ~bbbnfÛ¶m Úµk×(y°··gþüùdgg³eËžzê)Ó++üýýIIIaïÞ½ÄÄÄЪU+“}Hrr2YYYlݺ•×_]ÙfggGhh(iii¤¥¥ŒN§k´ô›7oΞ={°³³#,,ŒôôtvíÚ…­­­Eå7¾cÇŽDDD’’Bvv6±±±¸ºº5oÃܹs'_}õ^^^dff*?jµÚâúBÈ@Z!Dyzz¢Õj•e–9r$œ>}ºQò0wî\œéÛ·/£FR‰×M˜0#Fàãヷ·7ûöícáÂ…Êö~ýúÁG}„^¯çÍ7ßD«Õ*ÛCCCiÙ²% `РAxxxÜhéCÍ«Ù/^ÌáÇ6lcÆŒ¡¬¬Ìâ:¨-¼§§'©©© >\¹R0cÆ ŠŠŠèß¿?äææ¢×땟êêj‹ó/„´Bˆ:rrr2ym}xx¸2£yã€rÊ”)¤§§“žžÎ¨Q£=z4••• N_§ÓñÒK/LII ÅÅÅlÞ¼ÙdŸ±cÇ2þ|ŠŠŠˆ‹‹ãøöööŒ?ž¨¨(ÒÓÓ1äçç¯ÄïëëKHHeee”––2wî\^yå´Zm£¤àààÀúõëY¹r%………œ9s¦NõP[ø;vœœŒÁ`ÀËË‹“'OÒ½{w‹ã¶$ÿBˆ“¬‘Bˆ&tþüyÜÜÜÐh4TUUñî»ïpðàAT*•²ß¢E‹”5ÒÿÉ`0 ÑüÞ]«Õjªªª,J¿]»v”——SPPpÛ¦««+~ø!F£QùûåË—qtt¤´´”Ž;rôèÑ[†oÛ¶-ååå\¸pAùÛ¹sçhÓ¦ Z­¶Áé_÷í·ß6¨-nÞÕÕ•9sæàââ¡C‡P«Õ/©Kþ…2BQùùù0tèP6nÜX¯8òòòpwwçøñãÊà5//Ï¢°………ØÙÙáàà@qqñMÛ‹‹‹¹rå ãÆãرc·Œãܹs<þøãdeeÝ2o:777.]º¤  U*ùùù4kÖ¬Áé7µ¨¨(¾ùæÖ¬Y€^¯gðàÁ&û\»v —{2ÿBˆ»G–v!D2 DDDŠ··7Z­–nݺ™ÜŒgÎöíÛ™8q"...¸¸¸0iÒ$¶oßnQØË—/“‘‘A`` †Ö­[3fÌ“} Snstt¤OŸ>Êöøøx¦M›F·nÝ€šÜ™3g¢Õj)++cÆ |ðÁØØØ Óéxÿý÷ILL¤¢¢¢QÒojíÚµSfüÝÝÝ™4iÒMûœ:u '''zôè@‹-”› ïvþ…wÌH !DKNN¦²²’Y³fáééÉéÓ§ RfpÍùì³Ï˜3g;vì`óæÍ|þùç§?uêTÂÃÃÉÈÈ ''‡µk×âãã£l_´h%%%¬^½kkkŠ‹‹‰'-- €M›6¡Ñhøøãquu¥¨¨ˆ+V(ËK‚ƒƒ™5k»víj–P„‡‡7ZúM-$$„É“'3~üxŽ;Æ_|Á¼yóLö),,döìÙDGGPPP@@@ùùùw=ÿBˆ»GÕ¾}{£TƒâA§V«Ù½{w½^Èr£ÔÔÔÇ!„âÁ 3ÒBˆ‡†³³3 ,êÿŠp'''©H!„€ÌH !„BQ/r³¡B!„2B!„BÒB!„BÈ@Z!„BH !„Bñ“Çß ! VVVDDD(¿×÷ñwF£‘ÀÀÀû®ü*• ;;;JKKÈö}ÐË'„¸Gûyüâap·_Èò /0nÜ8¼¼¼ÈÉÉañâÅlÛ¶ €èèhHYYF£‘³gÏÁ?üÀ‘#G1b'OžÀÃÃM›6ñä“OZœ¾»»;ñññ<÷Üsdû>èåBÜ›dFZ!š˜ŸŸ'N$00¬¬,žxâ zõêe²OTT±±± <˜åË—Ó½{wÊËË%ŽŽŽt?èåBÜ›d´B4!kkkÞyç¦OŸNjj*åååìß¿Ÿ˜˜˜Û†Ù¶mƒvíÚ58}gggvîÜÉW_}…——™™™ÊZ­®ù °²Âßߟ””öîÝKLL ­Zµ@¯×“À²eËHKKã™gžaëÖ­lÛ¶M¼&%%áããÃÊ•+ùñÇILL¤C‡¿ÐÔ?@óæÍÙ³gvvv„……‘žžÎ®]»°µµ cÇŽDDD’’Bvv6±±±¸ººZ\¾ÜÜ\Ú´i£¤çëëKBB‚Åé›Ë¿BÒB!š€§§'Z­VY¦a‰‘#GRQQÁéÓ§œ~QQýû÷' €ÜÜ\ôz½òS]] À„ 1b>>>x{{³oß>.\¨ÄáííÍâŋٺu+aaaøùùa0èׯŸ²ÏèÑ£ ¢gÏž>|˜¨¨(e›¹ø¡æÕë‹/æðáà 6Œ1cÆPVV¦Ôajj*ÇWfòg̘aqù,Q[ú–ä_!i!„ÌÉɉß~ûMù=<<\™1½>« 0eÊÒÓÓIOOgÔ¨QŒ=šÊÊÊ;’DZcÇ2þ|ŠŠŠˆ‹‹ãøöööäåå‘MNN{÷îåâÅ‹œ:uÊd9ÅÒ¥K9uêUUU¬\¹’îÝ»ãäädQü¬_¿ž•+WRXXÈ™3g”m;vì 99ƒÁ€——'Ož¤{÷îZµ¥oIþ…'Y#-„Mèüù󸹹¡Ñh¨ªªâÝwßààÁƒ¨T*e¿E‹)k¤ÿ“Á`@£ù½»V«ÕTUU5ÚÒÕÕ•?ü£ñ÷{Ï/_¾¬ ”¯ÿÝh4šüÿvNœ8Auu5ÎÎÎ †Zã¿ñ)ß~ûí-ãsuueΜ9¸¸¸pèÐ!Ôjµ²ì¢1Ý*}sõ#O BÒB!šH~~> :”7Ö+޼¼<ÜÝÝ9~ü8mÛ¶%//¯Nq\»v —›þ^\\Ì•+W7nÇŽ»i»»»{ó{}m÷ùó穬¬¬5~KDEEñÍ7ß°fÍ fÝöàÁƒ-*@EEnnnJY[[[œ¶¹úB<Üdi‡B4!ƒÁ@DD¡¡¡x{{£ÕjéÖ­:Îâ8¶oßÎĉqqqÁÅÅ…I“&±}ûö:åãÔ©S899Ñ£GZ´h¡ÜŒ—@XX˜r££#}úô©SüÇÇÁÁ[[[‚‚‚X·n²4¥¡ñ·k×N™‘wwwgÒ¤Iu*_nn.¾¾¾ØÛÛÓ»woÆW§²5Fý!L2#-„M,99™ÊÊJfÍš…§§'§OŸ&((ˆK—.Yþ³Ï>cΜ9ìØ±€Í›7óùçŸ×)………Ìž=›èèh  ??ŸE‹QRRÂêÕ«±¶¶¦¸¸˜øøxÒÒÒ,ŽÿâÅ‹¬Y³†–-[’’’BHHˆ²­¡ñ‡„„0yòdÆϱcÇøâ‹/˜7ožÅå›7o >œ;v0{ölÆoïtP IDATqÙ£~„&y!‹â¡p·_Èò KJJ"..Ž-[¶He!*2#-„xh8;;³`Á þ¯¿þ$ aêÆ'…BÒBñ©®®¦sçÎõ »lÙ2åÿ3gΔÊBÈÒ!„B!êEžÚ!„B!„ ¤…B!„´B!„2B!„BÒBq¿uvVV,X°@ùyã7,;vìX%Üüùóúº|á…”×u?(T*öööMžŽN§#66–¶mÛ>´õ׫W/†zÇòæááALL 666ÒŠF'¿B<T*}úô©×ËTn|ü]jjjÃGGG3pà@ÊÊÊ0œ={–ˆˆ~øái˜{DëÖ­‰ç¹çžkÒt>ýôS2228þüC[“&MbéÒ¥w,ogΜáßÿþ7‘‘‘üýï—ƒ]4*™‘Bˆ; **Š=z ×ëùÇ?þÁòåËÑétR1÷GGÇ&OcĈØÚÚûÐÖ_ëÖ­ñôôäûï¿¿£ù[²d ®®®<ÿüór° H !ÄýlÛ¶m Úµk€¡¡¡¤¥¥‘––Fpp°2Èþßÿý_úöí €ò÷ž={²~ýúšŽÜÊ RRRØ»w/111´jÕJI¯yóæìÙ³;;;ÂÂÂHOOg×®]ØÚÚZ”_{{{æÏŸOvv6[¶lá©§ž2Ùn.þŽ;AJJ ÙÙÙÄÆÆâêêjqùÌiHúÎÎÎìܹ“¯¾ú ///233•µZmQýZj̘1,Z´è–ÛHrr2YYYlݺ•×_]Ù–››K›6m”ß}}}IHH°¸üæ¶›+_RRz½žÈÈH²³³III¡[·n×ß|||X¿~=FcÍ+,ôz= ,[¶Œ´´4žyæ¶nÝʶmÛ”Áymí°páBæÎ«ü>{öì[.ÁZ´hQ–t !i!„¸9’ŠŠ NŸ> @hh(-[¶dÀ€ 4‚ƒƒšW™_=ùüùóùüóÏèÔ©‡`„ Œ1¼½½Ù·o .4IÓÉɉŋsøða† Ƙ1c(++³(¿sçÎÅÙÙ™¾}û2jÔ(“AŒ%ñ{zz’ššÊðáÃéÕ«3f̰¸|–¨oúEEEôïߟ€€rssÑëõÊOuuµÅõkN³fÍxôÑGÉÊʺi[¿~ýˆˆˆà£>B¯×óæ›o¢Õj뿹ö­m»%å '11‘~ýú‘™™IPPÅõ÷Ÿ餤$“¿y{{³xñb¶nÝJXX~~~ úõëg¶ýBBBû¬26W>KÔ7}KXR¿æ´iÓ†üü|e&öFãÇ'**Šôôtòóó‰¯Óñe®}kÛnIù>ýôSeMÿÚµkëµüðC“AÚåË—qtt4è}ûí·uÎw»ví(//§  Àì¾·‹ßÕÕ•9sæàââ¡C‡P«Õʲså«‹ú¤oÉÕÒú­••Õ-gh¡féÂÑ£G|Œ™kß[m·´|ʶ_~ù¥^OÀ5j‰‰‰7ýýzºF£Ñäÿui¿Ý»wcee… )))·ÍƒÁ`¸å’!d -„÷¡¼¼Pn¶{ÿý÷ILL¤¢¢‚ªª*Nœ8ÁÈ‘#ùñÇùá‡2dgΜ¡ªª €„„”ÄéÓ§O£äïòåËdddˆF£¡uëÖŒ3¦Nq´kצfÞÆÝÝI“&)Û,)_CÕ–þu§NÂÉɉ=zТE eæ²1ê÷×_åÂ… tîÜù¦mñññL›6M¹ÏÕÕ•™3g*ë¤sssñõõÅÞÞžÞ½{3nܸF=£|µÕÀСCùî»ï¸zõj£·ßc=Æßþö7BCC™>}:ÁÁÁ&7g^×µkWΜ9cñU!d -„÷àà`®\¹Â®]»Ø¹s'?ÿü³ÉÌÝøÓŸþÄÈÌ̤gÏž&7â-Z´ˆmÛ¶±zõjRSSY½z5íÛ·o´üM:•Ž;’‘‘Á'Ÿ|ÂÚµkë>$$„—^z‰={ö0wî\¾øâ “íæÊ×PæÒ‡š™÷Ù³gÍ÷ßÏ矮 ,«~¿úê+&L˜pÓß7mÚÄG}ÄÇ̾}ûXµj?ÿü³òEbÞ¼yôíÛ—={öàããÃìÙ³õøkŒòÕVpûe m?FCTT}ô………?~œÏ>ûŒO>ù++Ó!΄ øê«¯¤ÃJÕ¾}{£TƒâA§V«Ù½{w½^Èr£ÔÔÔÇ!NVVV¬Y³†þóŸ$''?4ånÛ¶-ÿüç?•§pÜ ¾¾¾øøøðÚk¯Ýò†O!êKÖH !ÎÎÎ,X°¨™]±b…EáÆŽ«<¢ÍÉÉI*RÔ‹Á`ÀßߟåË—“••õÀ½Ý°¶AìºuëîZú¼öÚküõ¯•A´ht2#-„BÜAjµú¶OðRçâþ"k¤…Bˆ;HtRçBÒB!„BÈ@Z!„B!i!„B!d -„B!ĽH'„x(XYY¡ü^ßÇßF¥Bà…^ÀÏÏ—_~Y*C!i!„¸×©T*úôéS¯—©,[¶LùjjjÃëõz’’’øí·ßLþþüóÏ“ŸŸ/#„2Bq;?ÿü3½{÷–ŠBˆˆ¬‘Bˆ»¬cÇŽDDD’’Bvv6±±±¸ºº*Û“’’ÐëõDFF’MJJ ݺu³8~bbbHKûÿíÝ{|ŽõÿÀñ×uŸ·ÅfsfÓ ‰˜Fœm¬¢¡Í·rŽ$¢˜Ã´bÊÈW'ÔøÊ¡9þ2ÍÂlb(‡Bs¶Å°6;ÞÇßwݬi÷½ƒ¼ŸÇl×és}N×ûúܟ뺓عs'‹/¦Y³fEöÊòåË9pà±±±4hÐàú…B¥bèСÄÇdzk×.>ùäjÔ¨áòrfÏžÍþýûùꫯxøá‡¥Ð…H !„(????éÙ³'¼öÚkEÖ™5k±±±tèÐ}ûö1iÒ$—÷ÿòË/“——G»víhß¾=‹-Âh4YgàÀLš4‰Ö­[säÈ¢££ˆNHH¡¡¡²wï^æÌ™ãòòˆˆªT©Bûöíéׯ_‘›!„@Z!D‰j֬ɡC‡?C† q,ûæ›oذaV«•FqòäIZ¶lYdû÷ߟääd²³³ùâ‹/¸ûî»]>öÅ‹iÑ¢mÚ´A§Ó‘””ıcÇŠ¬óñÇsêÔ)Ìf3Ë—/§eË–xyyö‡-gÏžMff&‹-âÁÄÃÃÃérƒÁÀSO=Exx8999dgg³eË©BˆÛ‚Ì‘Bˆ¿@Is¤}||˜:u*ÞÞÞ>|µZ››[‘unAÎÈÈ@¯×»|ì… ’ͨQ£hÚ´)III¼÷Þ{üôÓO7]ÿçŸÆb±P¥J¬V+>>>¼õÖ[Øl6Ç:W¯^ÅÓÓµZ]âr HOO—J „@Z!DÅŠŽŽfóæÍ¬Zµ °¿å£k×®¶«ÕÊŠ+X±b :”O?ý”Gyä¦ëûúúpþüyL&YYY <¸Ø(öïJZîíí»»;•+W&;;[ [q[‘©Bñ7óõõE£±kÔ®]›‘#GVèþßxã š7oŽ¢(äææræÌ¬Vk‘uzöìIåÊ•qsscÒ¤I¬Y³“ÉÀ’%KˆŒŒt<@èééIÛ¶mÛ–´üêÕ«|÷ÝwŒ?FC­Zµ “BBÜdDZ!þfÓ¦McôèÑ 6ŒcÇŽñÙgŸ1cÆŒ Ûÿ®]»xõÕWiР†ôôtFŒQdK—.±jÕ*ªW¯N||<Ó¦Ms,›7o999¬\¹NGvv6111$%%¹´|̘1Ìš5‹ï¾ûŽ'NðÅ_*/„ø×SêÕ«g“lBÜîÔj5;vì(Ó²Ü(11±Üûø§Y½z5‹-⫯¾’Š"„¥ #ÒBˆ;F•*Ux÷Ýw²Eøïo²¸Ý(Š"D!$Bˆâ, Mš4)Ó¶7~Eø¸qã$3…B2µC!„Bˆ2‘·v!„B!´B!„H !„B!´B!„·yk‡⎠R©ˆŠŠrü^Ö×ßÙl6ÆÛä‹Z­fÏž=€ýÕ~'NdõêÕzŒÈÈH222˜;wîßvžŠ¢àîîNnn®4!„ÒBQÚ@ªmÛ¶eú2•_—˜˜X¦ã?þøã <˜FqâÄ ,X@\\óçϧsçÎäççc³Ù8{ö,QQQ$''pôèQBBB8yò$õë×gÓ¦M4kÖ¬Üùb±Xð÷÷ì_õ}»ªU«111tëÖMƒBi!„ø·0`#FŒ`üøñ¤¤¤pß}÷Pdèèh.\@×®]ùôÓOiÙ²%’ÀÓÓS2AQádŽ´BÜB:Ž×_±cÇ’˜˜HAAßÿ=Ÿ|òÉŸn‡ÕjÅ××·ÂÒѹsg6lØ@JJ [·nå¹çžsy[www¦OŸNRRIII„‡‡c0ʼÿAƒ±~ýz<<<\:~¥J•عs'îîîDFF²gÏpss aÆDEEÏþýûY¸p!>>>€ýÛ,·oßÎçŸN£FØ·oŸãG­VÛ/„*C‡%>>ž]»vñÉ'ŸP£F ©¼B ¤…âïäçç‡V«uLÓpÅO<ÑhäôéÓ’†:ÅÛo¿¿¿?ƒ B«Õº¼ýôéÓ©^½::u¢K—.Ô¯_Ÿððð2í¿_¿~<óÌ3„……•j¾²—— ,àÈ‘#ôèу°°0òóóyœ˜˜HÏž=#ý¯½ö™™™tìØ‘Q£F‘ššŠ¿¿¿ãÇb±0|øpBBB %00½{÷2gΩ¼B§dj‡BÜB^^^\»vÍñû¬Y³èܹ3Ý»wçÊ•+¼òÊ+¼ôÒKœ8q‚b2™*$ Æ #::ÚñPaZZ111.mk0èÓ§mÚ´q®lß¾iÓ¦a2™\ÞHHcÇŽåñÇ'++«TçP¹reÖ®]ËÆùðÍ7ß ×ëiÔ¨'Ožä±Çsyß/¾ø"cÆŒ!33€E‹1zôh<<<äáD!„ÒBñw9þØl6|}}ÉÈÈ(uZ¾þúë›þÝÇLJ©S§âííÍáÇQ«ÕŽi®è>>>¼õÖ[Øl6Ç߯^½Š§§§ÒB ¤…âï’––Fzz:ÁÁÁŽÑÔÒºpáµk׿øñãŽàöÂ… .oîÜ9î½÷^RRRJ\Ïf³9æ ßxlƒÁ@ÕªU¹|ù²#€V…´´4—÷ïççGß¾}ñõõ%::šàà`òòò*$£££Ù¼y3«V­Àßߟ®]»Y§°°ooïbÛfgg“••ÅàÁƒ9vì˜TX!D©Èi!„¸…¬V+QQQLŸ>ÀÀ@´Z--Z´(ö°^I¶mÛÆˆ#ðööÆÛÛ›‘#G²mÛ6—·‰‰áÕW_¥E‹€}wܸqÅæ1Ÿ={–Ž;¢Ñhëåçç³nÝ:¦L™‚^¯Ç`00yòdbcc1.ïÙ²e¤¦¦’@rr2“'O®°<öõõuŒØ×®]›‘#G[çÔ©SxyyѪU+ªU«æ¸iX²d ‘‘‘Ž ===iÛ¶­T^!„S2"-„·Ø† 0™LLœ8???NŸ>ͤI“#¼Îü÷¿ÿeêÔ©Ž¹À[¶lá£>rùø›6mB£Ñ0sæL|||ÈÌÌdéҥŦ‡|üñÇ|ðÁìÙ³‡ÔÔT €Ñh$<<œ‰'’اXÌš5«Tû·Z­ŽÿGDDG§Nˆ/wþN›6Ñ£G3lØ0Ž;ÆgŸ}ÆŒ3ЬsåÊÞ|óMæÏŸ@zz:£F"--yóæ‘““ÃÊ•+ÑétdggCRR’T^!D‰”zõêÙ$„·;µZÍŽ;Êô…,7JLL,÷>„BÜdDZqǨR¥ ï¾û.Pö¯÷òò’ŒBȈ´B!„e" !„B!´B!„H !„B!´B!„H !„Bq‡“×ß !î*•Ѝ¨(Çïe}ýÍfcüøñ’¡ÿjµš={ööWNœ8‘Õ«WWè1"##ÉÈÈ`îܹÛy*Š‚»»;¹¹¹RèBH -„h´mÛ¶L_¦²xñbÇÿËtüÇœÁƒÓ¨Q#Nœ8Á‚ ˆ‹‹`þüùtîÜ™üü|l6gÏž%**ŠäädŽ=JHH'Ož ~ýúlÚ´‰fÍšIÁ:a±Xð÷÷ì_~»ªU«111tëÖM ] ¤…âö1`ÀFŒÁøñãIIIá¾ûî#  È:ÑÑÑ,\¸€®]»òé§ŸÒ²eK $…Sžžž’ Bü dŽ´BÜB:Ž×_±cÇ’˜˜HAAßÿ=Ÿ|òÉŸn‡ÕjÅ××·ÜÇ÷÷÷gÉ’%,^¼˜¤¤$ÚµkÇÖ­[‰‹‹s_*•Š¡C‡Ï®]»øä“O¨Q£†ËÛ»»»3}út’’’HJJ"<<ƒÁàHC¥J•عs'îîîDFF²gÏpssÃÏÏýû÷£Óéë+ŠÂîÝ»iРËçÙ¹sg6lØ@JJ [·nå¹çžsy[gé/íþ Äúõëñððpéø%å@Æ ‰ŠŠ">>žýû÷³páB|||û·unß¾Ï?ÿœF±oß>ÇZ­vZ¾B ¤…âËÏÏ­V똦áŠ'žx£ÑÈéÓ§+$ ,X°€­[·É€°Z­tèЀáÇBhh(ìÝ»—9s渼ýôéÓ©^½::u¢K—.Ô¯_Ÿððð"iðòòbÁ‚9r„=zF~~>'OžäСC;Ö  ==ÝåóïСQQQ¼ýöÛøûû3hÐ ´Z­Ëùã,ý¥Ù¿~ýxæ™g +Õ|å?ËŸßëPbb"={öt|’ñÚk¯™™IÇŽ5j©©©øûû;~,‹Kå+„(;™Ú!„·——×®]sü>kÖ,:wî @÷îݹrå ¯¼ò /½ô'Nœ`àÀ˜L¦ IÃ… Ø¿?Mš4A«ÕréÒ%N:åQ~ñÅ3f ™™™,Z´ˆÑ£G;FTKÚÞ`0ЧOÚ´iãü"""ؾ};Ó¦MsœCåÊ•Y»v-7npœ7@LL ÇgÆ „††–êÀaÆíx¨0--˜˜—¶u%ý®î?$$„±cÇòøã“••Uª2*)¾ùæôz=5âäÉ“<öØc.ﻤò•‡…@Z!þ±ÎŸ?OÕªUÑh4˜Íf&L˜À¡C‡Pű޼yós¤ÿÈjµ¢Ñ\ï®Õj5f³Ùå4Øl6Ç¿7þÿ÷ÎÇLJ·ÞzËñ7€«W¯:í’¶¯[·.\¼xѱí¹sç¨S§N‘Q寿þú¦éKHH`êÔ©ÜsÏ=œ={–N:áòù5lØü±LåãJú]Ù`` }úôÁf³áëëKFFF©ÓògùãããÃÔ©SñööæðáèÕjÇ´Wô’ÊWi!$Bˆ¬´´4ÒÓÓ vŒ6–Ö… ¨]»6Çw.\¨ôegg“••ÅàÁƒ9vìX±åµk×vš6ƒÁ@ÕªU¹|ù²#U…´´4—ý%K–пöîÝKbbb‘Q|gÎ;ǽ÷ÞKJJŠÓãü>o¸4éweÿ~~~ôíÛ___¢££ &//¯BÊ(::šÍ›7³jÕ*À>o½k×®EÖ),,ÄÛÛ»Ôå+„(™#-„·Õj%**ŠéÓ§ˆV«¥E‹Åf+ɶmÛ1bÞÞÞx{{3räH¶mÛVai\²d ‘‘‘ŽÐ<==iÛ¶­KÛæçç³nÝ:¦L™‚^¯Ç`00yòdbcc1.§!66–   BCCY³fM©Ò믾J‹-ûî¸qãŠÍc>{ö,;vD£Ñ8Ös%ý®ìÙ²e¤¦¦’@rr2“'O®°òñõõu|"Q»vmFŽYlS§NáååE«V­¨V­šã¦¡<å+„(™ŒH !Ä-¶aÃL&'NÄÏÏÓ§O3iÒ$Ǩ3ÿýï™:uªc®ì–-[øè£*,}óæÍ#''‡•+W¢ÓéÈÎÎ&&&†¤¤$—¶gâĉ$$$ö) ³fÍ*UrrrضmAAAìÚµ«TÛnÚ´ FÃÌ™3ñññ!33“¥K—›þòñÇóÁ°gÏRSS0`F£Ñiú]Ù¿Õjuü?""‚¸¸8:uêD|||¹ËgÚ´iŒ=šaÆqìØ1>ûì3f̘Qd+W®ðæ›o2þ|ÒÓÓ5jiiiå._!ÄŸSêÕ«g“lBÜîÔj5;vì(Ó²Ü(11±Üû77nÜ8EaöìÙ’Bˆ‘BÜ1ªT©Â»ï¾ ”ý+½¼¼$#o‡zˆÞ½{$™!„ø×i!„­VËŽ;(((`Ê”)ìܹS2E!´B!„·3yk‡B!„H !„B!´B!„H !„B!´B!„H !„B!$B!„Bi!„B!$B!„Bi!„B!$B!„BH -„B!„ÒB!„BH -„B!„ÒB!„BH -„B!„@Z!„B ¤…B!„@Z!„B ¤…B!„@Z!„B!´B!„H !„B!´B!„H !„B!´B!„Bi!„B!$B!„Bi!„B!$B!„Bi!„B!„ÒB!„BH -„B!„ÒB!„BH -„B!„ÒB!„Bˆ’iþ ‰¼kƂۺrÂGÞÑùw«Ïÿvw»·ÛÝÞþ…ö+í÷ß\þ2"-„B!DH -„B!„ÒB!„Bü5*tŽ´¢(¸»»“››{{å’ÕJîìIØòsÑ?ù,Ú‡ÚܑƖý+yE¡ü4üÃB6c!ŠÞpÇåKdd$Ì;÷Î-ÿrïüέ?¥€··7[¶l‘̸õËrú¶¼\4MZH¾ýÝíS®¿â÷*˜—KÁúϱžM7wtm:¢ hÿ×\Ÿ\ ¤GÅ+¯¼B~~¾c᯿þJ»ví\ÞY­Zµˆ‰‰¡[·nšHÓžo1nÛhÏ(“PP´ZtÝ{£õôÖæ’J…Ç„wÈ_rk&þ;ËFÃ믿N¯^½Ðét8p€Y³fñÓO?9ÖoÖ¬o¼ñ<ð¿üò ÿûßÿøßÿþ€1á+Œ _¢hu×o|ÜÄýåIe·M›6QXXHhh¨ô¥;sÚ肞²—Å¥t –.À}Ü[{ Ê¿Ü×Ë ¨?7í|…ä΋®ëèÚw··‡øÍ·É]ÓæZó¯+ï‘#GòñÇ»¼~Á²±œI-ÒªýîÃÐðÓFJS¿L;¶¢ ìâø=o^¶Ü×—j~IDATP)¨¼|Ðø?zë¯;ÿâü»‘ùÄ ÿo%¯Í(ò÷¼9SÑ÷€ºá=ûõ·¼üýýY½z5×®]+ò÷îÝ»“––FåÊ•yá…èÔ©ƒ¡XŒÔ¸qc&NœÈ<@^^~ø!Ë—/¿Þ‡Y,·ýæï÷‚ÅŒªnCôÝž@U£Î?§~¤¥ðëõXÓÏ¡TöBûp;´·¯Ðc·‰‚ ÷W¦ èô،ƿìúäR °~ýzÆWæyzzÞ’DjCð…›¾ýoÃí¤¤ü2díÛ·§ÿþ\ºt‰:褛7oβeˈˆˆ`È!Ô¨Qƒ§Ÿ~æzk›·Fß{`¹Ò¨èôè{¸yÀ’ŸW®}׫W£Ñˆ‡‡5kÖä—_~‘¹4¬ÃûѶë†âq×-;FIå_œõ§Ät»{`>¼ßH›~z·\6iÒ«ÕZäùf~~~ìÞ½ÛõûŸÃoûþ³¢ê—5+Ëå‹Þ[4ûFÝàn¬éç)X³Ûµ,t{Hþ9 2üî§ /ë¥_PU¯iÏã˱䣪çwÛäÏ/¿üB›67)·Ùl¤¦¦¢ÑhŠÑ*•Š×^{?þ˜={öðÐC±téR~üñG8`¿±KüËÏ?âöÂ+¨*UÆ|ü(æÔcèþ!´å bæ£ îƒöÙ!X¯eaJÙ V ¨Ô¬§ŸCÛ¦Š›‡½_wÓüe×'—é’¬^½š™3gÒ¿:vìȯ¿þÊØ±c9xð UªTaíÚµxzzâééɾ}ûÛ`±XP©T <˜§Ÿ~NÇÑ£G çâÅ‹TªT‰/¿ü’îÝ»3iÒ$ºtéB~~>ÁÁÁ.:ãþËßc´MB×å ømä«…Âͱ˜Á–ØPÜïBØí£/wš¦Äo0¥ìÆf1£®U}ÈÓ(•*ææâ¾ûîãàÁƒ¤¦¦°qãÆ"Ëß|óM,X@ll,999¼ýöÛ®X­YŠ¢7 ég¿à~½òr•2ÿ³÷±^J·¯œŸ‹áÙ!¨ï}À~êy¹ä/|ÏÞÑä‘;ë Ç~=ÆG‚ʵ©øÁÁÁlÛ¶ ºwïÎ’%KËJªùùùN—»»»3aÂG'öå—_2{öl øòË/™9s&;vì@¯×£( ´nÝš7Þxƒ§ž*}Ð1hÐ zõêÅsÏ=Gnnn‰õßÏÏÕ«WÓ¦MŒ¿Ýa+ŠBbb"Ï>û,§OŸÆÛÛ›™3gÒ¬Y3Ìf3Çgîܹ:tèzc~ %ÆÄmè»õ*Þ]¹„qçV¬gNbËÏC]¯!ú'ŸEñ¨„õjùÍÆcÂÛŽÑY›ÅBÞ»“pú:Š—w‰åïJû*éø.ÕŸò¶/•E¥¶_ÀM&»P2/»Ü~óÍA×­æ}‰˜AqsGú<êº È6÷1ÓP¼¼í¾ɘHÁ-¬t¯ÆzôÑG),,,1 eíÚµØl¶ »8;?ó±Ã˜¶`ýõ ŠG%ûGë@ûÂÂ|òÌÄíå71~½óO‡P´:ÜF¾aÿ¬„üµœ=‰1a ŠZ5ý<ú^(üj Øl¸½4Åͽ\åSÚþÉ|pÚƒ¢ÜäŽLAUÛChù‹£Ñ=ÒÑ~CæBý¼Sò¯µͽM±?ì¤-Ç ¾¯)ŠZí´r…Óöçäüm¹9lXŽ-í,¨Ô¨jÔB×±ªÚõ*¤}]»v7rõêÕb´Õj套^rü¾oß>¾ýö[Z´h᤭ÓP×m€ªj {_߬U…öïåí__¯C×¾;Ú–ö •Þ€¾{o—ã3gýOáÖõ˜¥`ËÎÂzq9…›c‹Ô¿ò^ŸÊ«TΚ5‹ØØX:tèÀ¾}û˜4ÉþOff&;vdÔ¨Q¤¦¦âïïïø±X, >œBCC dï޽̙3§Èþ½¼¼X°`GŽ¡G„……™êPbAnŽÅv- ·W¦à>*ëÕËöÎä÷åÉßbÍøÑSð7E§ÇíÅ1ŽLt¶ÜéñwnÅ|x?nƒ_Ãclªz(X³´Â.tk×®åÉ'ŸdòäÉÔ¬Yóý”šV­Z±yóæ2ï_ß³/–Ÿ~Àrúg¬¿œ·Þ_Ÿ^áöŸÑxLx ï ªY·ØhŸû+S0ôûJÕŽõ<&¼ãr}c ½mÛ6zô(>Òã¬~”´|úôéT¯^N:Ñ¥KêׯOxx8?üð7`öìÙ|ôÑG€ýã¶Ã‡—:/ûõëÇ3ÏëÕ鸿: í#þÖ)_õë×ççŸ.Ú·ÿ°ãWk±eÿZáý{¹úW«ËÙ“hhYæøÌYÿ£ïÖ ×fØobû*VÿÊ{}ªÐ@ºwïÞ=zÔñÓºuë"+¿ÿþû$''“Í_|ÁÝwßíò^|ñEfÏžMff&‹-âÁÄÃÃñNåÊ•Y»v-Ë—/çÊ•+œ9sÆÅ‹¤ Ódô=û¢hu(z=º¡˜SvÃo¼õb껃V‹RÉUmßëw0.,wš„ÝÛÑvyÅÝ~>ºG:a½p[aËû()ÿ¿ýö[zöìI½zõعs'3gÎÄËË €ªU«¢Õj¹téR‰û7¿—Ü·Æ:~,gR¯Ã7tOö§`ÃçlXáñ§Q ÝGßµkצJ•*?~œƒÒ AªV­ZdgõãÏ– úôéôiÓÈÏÏ'77—ˆˆžyæ´Zm‘@º^½z4lØ•JEÓ¦MKH‡„„0vìXHVV–Ëõ?&&†çž{îOƒ¥‹/Ò¢E Ú´iƒN§#))‰cÇŽ½¡ÑèдÀ”´½ø…ì¾Ð<è¢(X/ÿ‚Rµ–s§˵þb>¸§È¨œ¦e[×?rsÒ~œÿ–·/³móÖX~úóÏ?¡¹¿Y©÷¯íŒ¦á½(7´-ÁšQqSbbbزe ƒfäÈ‘lÙ²…Å‹[ÏßߟK—.qöìÙ›nãÏͶ/IIçg܇®cOÔ î±ÊzVAÛ¦CÑ@° m‹‡Ñú¢xTBå]ÍåüU<½Qù6DU­&êF÷ÙëO5Çt‚¿ª|,gO¢TªŒªJU§ë*waý-¨q–¾;%ÿþtPúÞ°\8 …ùØLFÌçN¡nt…õåí?T•<±ž?õô °˜Q7¼UÚ¥:FÍš59tèãgÈ!eJë“O>‰Ùl&11ñzþÜÓ÷á±\½LnXŽ-?·Âú÷òô¯¶Ük`± Tª\æøìV׿òÆw¥šÚ±nݺçHß8–‘‘^¯wé •+WÆÇLJ·Þz«ÈÇ‘W¯^ÅÓÓ³È[>¾þúëÒgÒ¯WìtÃÇ*/Ÿß–]EåS M£û1~ûšÆÍ±]ËÂúËÔ¾ ¯g„“å%V¤‚|l¹×0n\…Q)ÚÑÚ ò]~ÊÙYþŸ}ëfÛ—GIçg½r UMçó1ÿXï\É_û/×§N8¦Tüöï_Y>¦ý»ŽF;Î+'¥’§Ké»SòïOë–Á µoCÌ©ÇP4ÔõüŠ´ÛòôÑhí 7Œß~…%í<¿{Ðu)ÕÃ|%Í‘vUÓ¦M™0aÏ?ÿ|ð¾¾¾®ê_úSÒvô=ûb}žÂ-k°ýzµtéô©†-?ËÙ“ŽþpW}3Õ«Wçþûï'%%Åñ·¤¤$ZµjuÓ³ÒÊÏÏgݺuL™2½^Á``òäÉÄÆÆb41›ÍüüóÏ<ñÄ8p€ääd‚‚‚8sæ f³ëѲeËHMM%!!ääd&OžìXæJý%((ˆÐÐPÖ¬):ì7Þ yóæ(ŠBnn.gΜ)6bq}Tº ¦C)E/¶™—±Y-ŽQã·ÅGî5­Áôý^L‡Rж|¤Tyì¬ý¸rü’êOEµ/•w5TžÅ;ïòî_©Zódl……XNÀ˜øM™êê±cÇþôæ-88˜o¿ý–¼¼<þjÚ60ÆoÆrþôo#ˆ9¿ÙXä£Ù·/gþVDù;ëŸ,G¢¾§ Š®äOZ-éç)\»Ô4ü6Zç,}wBþ9 ¤ïóÏG±üü#šû(uÿPÒõ×Yûsvþ…[×c¹pl6½Þ>­æf›Þ"Íš5cÉ’%Œ;Ö1˜tÃ( ù ßôg¶œll¹9˜îAåSݘ–·/oýÐwë…ñÛ­˜¿ÿ›Éˆõj«c˼âR|v«¹ßUȈt¯^½èÞ½{‘\\¹Â›o¾ÉüùóHOOgÔ¨Q¤¥¥1oÞ=()ÿ_ýuÆψ#pww'%%…ÿüç?ŽõöïßOXX&L`ÆŒ¤¥¥ñùçŸsîÜ9~šéû½ö×~ÝÀ}|$¨5¬Y‚®[/J(•Ð=DÁš%¸½0ÆåEñ¨„á‰þÄ~fïô*{¡ï÷ÂM—±{÷î"Aknn.¤{÷î¬X±¢Üõ#<<œ‰'’ا€Ìš5˱ü‡~ ÿþ 6 •JEëÖ­YµjU©Žqc`A\\:u">>Þ¥úŸ““ömÛ b×®]Eö½k×.^}õU4h€F£!==#Fܼ*y¢iҢȈ„¾G_L [0íŒCU£6Ú¶0n*z~êšuP[^ŽýaªÒZNÚ+Ç/©þTDû*1ýåÜ¿>ø) ×NÞáýhîk†á‰þwÄ•:;vìøÓeýúõ+ö€¶«þøisÊîR½GZó@Kû“ï–ÛGÁÜ=ìïˆuña³òæoE”¿³þÉ´? ]§žž‡«ƒ‚ý¹m;y´³ôÝ ùçt{/oƒ;ŠZRÙ«hûq¡(éúë¬ý9-¿û1ÆoÆv%›Õ‚ʳ †§_¬°@kîܹ´iÓ½^OåÊ•S;vìˆÉdbåÊ•(ŠÂüùóSfóòòEAß{Ƹÿôs+6c!*_? ‡WXÿ^Þú¡òmˆÛó#0Æý¿@åUmë@”*>.Åg·| ÀÅø®Ìƒ¹õêÕ³ñw׌ò¿„=ÿ³÷Ñwïåx-7‡‚U‹QßÓ]»nN—ßJ9á#ÿñù÷o>ÿ“qãÆ¡( ³gÏþW•ïßÙ~þí\©ÿuëÖeÙ²etèÐá¶kÿÿ¶_¯’3÷1S%3„\¿o3·òú”>Í‘‹6›ýý±¹9`2a³Y±¦ŸÇzíWtw7q¾\ˆ¿ÀC=DïÞ½ º½Ú—(·>}ú›î#*Žé@2š’BÜiñ_¸3iEÁíù‘˜vÇÿ6Ù\ªfÜžæxÁ¹³åBÜ*Z­–;vPPPÀĉ‹}ÍìíоDùÌ;W2ẓ¾¡Pˆ;Ê_p}ÒÜ)y©ªQ»Ä¯Žt¶\ˆ[Åd2U؃·ÿÔö%„B܎קÅi!„B!þiþ˜;Í=|:»PIEND®B`‚nvtop-3.0.2/snap/000077500000000000000000000000001444130114000136135ustar00rootroot00000000000000nvtop-3.0.2/snap/snapcraft.yaml000066400000000000000000000041621444130114000164630ustar00rootroot00000000000000name: nvtop base: core22 adopt-info: nvtop summary: 'GPUs monitoring tool for AMD, Intel and NVIDIA' description: | Nvtop stands for Neat Videocard TOP, a (h)top like task monitor for AMD, Intel and NVIDIA GPUs. It can handle multiple GPUs and print information about them in a htop familiar way. license: GPL-3.0-or-later issues: https://github.com/Syllo/nvtop/issues icon: desktop/nvtop.svg grade: stable confinement: strict architectures: - build-on: amd64 - build-on: arm64 - build-on: armhf - build-on: ppc64el - build-on: s390x compression: lzo apps: nvtop: command: usr/bin/nvtop desktop: usr/share/applications/nvtop.desktop plugs: - opengl - home - hardware-observe - process-control - system-observe # - kubernetes-support # Temporarily required for nvtop to display AMD GPU processes. Once apparmor rule to allow access to @{PROC}/[0-9]*/fdinfo/ is added to system-observe, this can be removed. # layout: # /usr/share/libdrm: # symlink: $SNAP/usr/share/libdrm parts: libdrm: source: https://gitlab.freedesktop.org/mesa/drm.git source-tag: libdrm-2.4.113 plugin: meson meson-parameters: - --prefix=/usr - --sysconfdir=/etc - --libdir=lib/$CRAFT_ARCH_TRIPLET - -Dradeon=enabled - -Damdgpu=enabled - -Dudev=true - -Dnouveau=enabled - -Dintel=enabled build-packages: - meson - pkg-config - libudev-dev - libpciaccess-dev stage-packages: - libpciaccess0 prime: - -usr/include - -usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig nvtop: after: [ libdrm ] source: . plugin: cmake cmake-parameters: - -DCMAKE_INSTALL_PREFIX=/usr - -DNVIDIA_SUPPORT=ON - -DAMDGPU_SUPPORT=ON - -DINTEL_SUPPORT=ON override-pull: | set -eux craftctl default VERSION="$(git describe --tags $(git rev-list --tags --max-count=1))" craftctl set version=$VERSION git checkout $VERSION build-snaps: - cmake build-packages: - gcc - libncurses-dev - libsystemd-dev stage-packages: - libncurses6 - libncursesw6 - libsystemd0 prime: - -usr/share/doc nvtop-3.0.2/src/000077500000000000000000000000001444130114000134415ustar00rootroot00000000000000nvtop-3.0.2/src/CMakeLists.txt000066400000000000000000000056161444130114000162110ustar00rootroot00000000000000include(CheckCSourceCompiles) configure_file( "${PROJECT_SOURCE_DIR}/include/nvtop/version.h.in" "${PROJECT_BINARY_DIR}/include/nvtop/version.h" IMMEDIATE @ONLY) add_executable(nvtop nvtop.c interface.c interface_layout_selection.c interface_options.c interface_setup_win.c interface_ring_buffer.c get_process_info_linux.c extract_gpuinfo.c extract_processinfo_fdinfo.c time.c plot.c ini.c info_messages_linux.c) check_c_source_compiles( " #include int main() { int *buf = NULL; buf = reallocarray(buf, 15, sizeof(*buf)); return EXIT_SUCCESS; } " HAS_REALLOCARRAY ) if(HAS_REALLOCARRAY) target_compile_definitions(nvtop PRIVATE HAS_REALLOCARRAY) endif() find_package(UDev) find_package(Systemd) option(USE_LIBUDEV_OVER_LIBSYSTEMD "Use libudev, even if libsystemd is present" OFF) if(NVIDIA_SUPPORT) target_sources(nvtop PRIVATE extract_gpuinfo_nvidia.c) endif() if(AMDGPU_SUPPORT OR INTEL_SUPPORT) if((SYSTEMD_FOUND AND UDEV_FOUND AND USE_LIBUDEV_OVER_LIBSYSTEMD) OR(NOT SYSTEMD_FOUND AND UDEV_FOUND)) target_compile_definitions(nvtop PRIVATE USING_LIBUDEV) target_link_libraries(nvtop PRIVATE udev) elseif(SYSTEMD_FOUND) target_compile_definitions(nvtop PRIVATE USING_LIBSYSTEMD) target_link_libraries(nvtop PRIVATE systemd) else() message(FATAL_ERROR "Neither libsystemd nor libudev were found; These are required for AMDGPU and INTEL support") endif() target_sources(nvtop PRIVATE device_discovery_linux.c) endif() if(AMDGPU_SUPPORT OR MSM_SUPPORT) # Search for libdrm for AMDGPU support find_package(Libdrm) if(Libdrm_FOUND) message(STATUS "Found libdrm; Enabling support") target_include_directories(nvtop PRIVATE ${Libdrm_INCLUDE_DIRS}) if (AMDGPU_SUPPORT) target_sources(nvtop PRIVATE extract_gpuinfo_amdgpu.c) target_sources(nvtop PRIVATE extract_gpuinfo_amdgpu_utils.c) endif() if (MSM_SUPPORT) target_sources(nvtop PRIVATE extract_gpuinfo_msm.c) target_sources(nvtop PRIVATE extract_gpuinfo_msm_utils.c) endif() else() message(FATAL_ERROR "libdrm not found; This library is required for AMDGPU and MSM support") endif() endif() if(INTEL_SUPPORT) target_sources(nvtop PRIVATE extract_gpuinfo_intel.c) endif() target_include_directories(nvtop PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) find_package(Sanitizers) add_sanitizers(nvtop) set_property(TARGET nvtop PROPERTY C_STANDARD 11) target_compile_definitions(nvtop PRIVATE _GNU_SOURCE) target_link_libraries(nvtop PRIVATE ncurses m ${CMAKE_DL_LIBS}) install(TARGETS nvtop RUNTIME DESTINATION bin) include(compile-flags-helpers) include(${PROJECT_SOURCE_DIR}/cmake/optimization_flags.cmake) add_compiler_option_to_target_type(nvtop Debug PRIVATE ${ADDITIONAL_DEBUG_COMPILE_OPTIONS}) add_linker_option_to_all_but_target_type(nvtop dummy PRIVATE ${ADDITIONAL_RELEASE_LINK_OPTIONS}) nvtop-3.0.2/src/amdgpu_ids.h000066400000000000000000000552221444130114000157340ustar00rootroot00000000000000 /* * Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. * * This file is modified from libdrm. MIT License. * * URL: https://gitlab.freedesktop.org/mesa/drm/-/blob/main/data/amdgpu.ids * The amdgpu_ids has to be modified after new GPU release. * */ #ifndef AMDGPU_IDS_H #define AMDGPU_IDS_H struct amdgpu_id_struct { uint32_t asic_id; uint32_t pci_rev_id; const char *name; }; static struct amdgpu_id_struct amdgpu_ids[] = { {0x1309, 0x00, "AMD Radeon R7 Graphics"}, {0x130A, 0x00, "AMD Radeon R6 Graphics"}, {0x130B, 0x00, "AMD Radeon R4 Graphics"}, {0x130C, 0x00, "AMD Radeon R7 Graphics"}, {0x130D, 0x00, "AMD Radeon R6 Graphics"}, {0x130E, 0x00, "AMD Radeon R5 Graphics"}, {0x130F, 0x00, "AMD Radeon R7 Graphics"}, {0x130F, 0xD4, "AMD Radeon R7 Graphics"}, {0x130F, 0xD5, "AMD Radeon R7 Graphics"}, {0x130F, 0xD6, "AMD Radeon R7 Graphics"}, {0x130F, 0xD7, "AMD Radeon R7 Graphics"}, {0x1313, 0x00, "AMD Radeon R7 Graphics"}, {0x1313, 0xD4, "AMD Radeon R7 Graphics"}, {0x1313, 0xD5, "AMD Radeon R7 Graphics"}, {0x1313, 0xD6, "AMD Radeon R7 Graphics"}, {0x1315, 0x00, "AMD Radeon R5 Graphics"}, {0x1315, 0xD4, "AMD Radeon R5 Graphics"}, {0x1315, 0xD5, "AMD Radeon R5 Graphics"}, {0x1315, 0xD6, "AMD Radeon R5 Graphics"}, {0x1315, 0xD7, "AMD Radeon R5 Graphics"}, {0x1316, 0x00, "AMD Radeon R5 Graphics"}, {0x1318, 0x00, "AMD Radeon R5 Graphics"}, {0x131B, 0x00, "AMD Radeon R4 Graphics"}, {0x131C, 0x00, "AMD Radeon R7 Graphics"}, {0x131D, 0x00, "AMD Radeon R6 Graphics"}, {0x15D8, 0x00, "AMD Radeon RX Vega 8 Graphics WS"}, {0x15D8, 0x91, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0x91, "AMD Ryzen Embedded R1606G with Radeon Vega Gfx"}, {0x15D8, 0x92, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0x92, "AMD Ryzen Embedded R1505G with Radeon Vega Gfx"}, {0x15D8, 0x93, "AMD Radeon Vega 1 Graphics"}, {0x15D8, 0xA1, "AMD Radeon Vega 10 Graphics"}, {0x15D8, 0xA2, "AMD Radeon Vega 8 Graphics"}, {0x15D8, 0xA3, "AMD Radeon Vega 6 Graphics"}, {0x15D8, 0xA4, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xB1, "AMD Radeon Vega 10 Graphics"}, {0x15D8, 0xB2, "AMD Radeon Vega 8 Graphics"}, {0x15D8, 0xB3, "AMD Radeon Vega 6 Graphics"}, {0x15D8, 0xB4, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xC1, "AMD Radeon Vega 10 Graphics"}, {0x15D8, 0xC2, "AMD Radeon Vega 8 Graphics"}, {0x15D8, 0xC3, "AMD Radeon Vega 6 Graphics"}, {0x15D8, 0xC4, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xC5, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xC8, "AMD Radeon Vega 11 Graphics"}, {0x15D8, 0xC9, "AMD Radeon Vega 8 Graphics"}, {0x15D8, 0xCA, "AMD Radeon Vega 11 Graphics"}, {0x15D8, 0xCB, "AMD Radeon Vega 8 Graphics"}, {0x15D8, 0xCC, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xCE, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xCF, "AMD Ryzen Embedded R1305G with Radeon Vega Gfx"}, {0x15D8, 0xD1, "AMD Radeon Vega 10 Graphics"}, {0x15D8, 0xD2, "AMD Radeon Vega 8 Graphics"}, {0x15D8, 0xD3, "AMD Radeon Vega 6 Graphics"}, {0x15D8, 0xD4, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xD8, "AMD Radeon Vega 11 Graphics"}, {0x15D8, 0xD9, "AMD Radeon Vega 8 Graphics"}, {0x15D8, 0xDA, "AMD Radeon Vega 11 Graphics"}, {0x15D8, 0xDB, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xDB, "AMD Radeon Vega 8 Graphics"}, {0x15D8, 0xDC, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xDD, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xDE, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xDF, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xE3, "AMD Radeon Vega 3 Graphics"}, {0x15D8, 0xE4, "AMD Ryzen Embedded R1102G with Radeon Vega Gfx"}, {0x15DD, 0x81, "AMD Ryzen Embedded V1807B with Radeon Vega Gfx"}, {0x15DD, 0x82, "AMD Ryzen Embedded V1756B with Radeon Vega Gfx"}, {0x15DD, 0x83, "AMD Ryzen Embedded V1605B with Radeon Vega Gfx"}, {0x15DD, 0x84, "AMD Radeon Vega 6 Graphics"}, {0x15DD, 0x85, "AMD Ryzen Embedded V1202B with Radeon Vega Gfx"}, {0x15DD, 0x86, "AMD Radeon Vega 11 Graphics"}, {0x15DD, 0x88, "AMD Radeon Vega 8 Graphics"}, {0x15DD, 0xC1, "AMD Radeon Vega 11 Graphics"}, {0x15DD, 0xC2, "AMD Radeon Vega 8 Graphics"}, {0x15DD, 0xC3, "AMD Radeon Vega 3 / 10 Graphics"}, {0x15DD, 0xC4, "AMD Radeon Vega 8 Graphics"}, {0x15DD, 0xC5, "AMD Radeon Vega 3 Graphics"}, {0x15DD, 0xC6, "AMD Radeon Vega 11 Graphics"}, {0x15DD, 0xC8, "AMD Radeon Vega 8 Graphics"}, {0x15DD, 0xC9, "AMD Radeon Vega 11 Graphics"}, {0x15DD, 0xCA, "AMD Radeon Vega 8 Graphics"}, {0x15DD, 0xCB, "AMD Radeon Vega 3 Graphics"}, {0x15DD, 0xCC, "AMD Radeon Vega 6 Graphics"}, {0x15DD, 0xCE, "AMD Radeon Vega 3 Graphics"}, {0x15DD, 0xCF, "AMD Radeon Vega 3 Graphics"}, {0x15DD, 0xD0, "AMD Radeon Vega 10 Graphics"}, {0x15DD, 0xD1, "AMD Radeon Vega 8 Graphics"}, {0x15DD, 0xD3, "AMD Radeon Vega 11 Graphics"}, {0x15DD, 0xD5, "AMD Radeon Vega 8 Graphics"}, {0x15DD, 0xD6, "AMD Radeon Vega 11 Graphics"}, {0x15DD, 0xD7, "AMD Radeon Vega 8 Graphics"}, {0x15DD, 0xD8, "AMD Radeon Vega 3 Graphics"}, {0x15DD, 0xD9, "AMD Radeon Vega 6 Graphics"}, {0x15DD, 0xE1, "AMD Radeon Vega 3 Graphics"}, {0x15DD, 0xE2, "AMD Radeon Vega 3 Graphics"}, {0x163F, 0xAE, "AMD Custom GPU 0405"}, {0x6600, 0x00, "AMD Radeon HD 8600 / 8700M"}, {0x6600, 0x81, "AMD Radeon R7 M370"}, {0x6601, 0x00, "AMD Radeon HD 8500M / 8700M"}, {0x6604, 0x00, "AMD Radeon R7 M265 Series"}, {0x6604, 0x81, "AMD Radeon R7 M350"}, {0x6605, 0x00, "AMD Radeon R7 M260 Series"}, {0x6605, 0x81, "AMD Radeon R7 M340"}, {0x6606, 0x00, "AMD Radeon HD 8790M"}, {0x6607, 0x00, "AMD Radeon R5 M240"}, {0x6608, 0x00, "AMD FirePro W2100"}, {0x6610, 0x00, "AMD Radeon R7 200 Series"}, {0x6610, 0x81, "AMD Radeon R7 350"}, {0x6610, 0x83, "AMD Radeon R5 340"}, {0x6610, 0x87, "AMD Radeon R7 200 Series"}, {0x6611, 0x00, "AMD Radeon R7 200 Series"}, {0x6611, 0x87, "AMD Radeon R7 200 Series"}, {0x6613, 0x00, "AMD Radeon R7 200 Series"}, {0x6617, 0x00, "AMD Radeon R7 240 Series"}, {0x6617, 0x87, "AMD Radeon R7 200 Series"}, {0x6617, 0xC7, "AMD Radeon R7 240 Series"}, {0x6640, 0x00, "AMD Radeon HD 8950"}, {0x6640, 0x80, "AMD Radeon R9 M380"}, {0x6646, 0x00, "AMD Radeon R9 M280X"}, {0x6646, 0x80, "AMD Radeon R9 M385"}, {0x6646, 0x80, "AMD Radeon R9 M470X"}, {0x6647, 0x00, "AMD Radeon R9 M200X Series"}, {0x6647, 0x80, "AMD Radeon R9 M380"}, {0x6649, 0x00, "AMD FirePro W5100"}, {0x6658, 0x00, "AMD Radeon R7 200 Series"}, {0x665C, 0x00, "AMD Radeon HD 7700 Series"}, {0x665D, 0x00, "AMD Radeon R7 200 Series"}, {0x665F, 0x81, "AMD Radeon R7 360 Series"}, {0x6660, 0x00, "AMD Radeon HD 8600M Series"}, {0x6660, 0x81, "AMD Radeon R5 M335"}, {0x6660, 0x83, "AMD Radeon R5 M330"}, {0x6663, 0x00, "AMD Radeon HD 8500M Series"}, {0x6663, 0x83, "AMD Radeon R5 M320"}, {0x6664, 0x00, "AMD Radeon R5 M200 Series"}, {0x6665, 0x00, "AMD Radeon R5 M230 Series"}, {0x6665, 0x83, "AMD Radeon R5 M320"}, {0x6665, 0xC3, "AMD Radeon R5 M435"}, {0x6666, 0x00, "AMD Radeon R5 M200 Series"}, {0x6667, 0x00, "AMD Radeon R5 M200 Series"}, {0x666F, 0x00, "AMD Radeon HD 8500M"}, {0x66A1, 0x02, "AMD Instinct MI60 / MI50"}, {0x66A1, 0x06, "AMD Radeon Pro VII"}, {0x66AF, 0xC1, "AMD Radeon VII"}, {0x6780, 0x00, "AMD FirePro W9000"}, {0x6784, 0x00, "ATI FirePro V (FireGL V) Graphics Adapter"}, {0x6788, 0x00, "ATI FirePro V (FireGL V) Graphics Adapter"}, {0x678A, 0x00, "AMD FirePro W8000"}, {0x6798, 0x00, "AMD Radeon R9 200 / HD 7900 Series"}, {0x6799, 0x00, "AMD Radeon HD 7900 Series"}, {0x679A, 0x00, "AMD Radeon HD 7900 Series"}, {0x679B, 0x00, "AMD Radeon HD 7900 Series"}, {0x679E, 0x00, "AMD Radeon HD 7800 Series"}, {0x67A0, 0x00, "AMD Radeon FirePro W9100"}, {0x67A1, 0x00, "AMD Radeon FirePro W8100"}, {0x67B0, 0x00, "AMD Radeon R9 200 Series"}, {0x67B0, 0x80, "AMD Radeon R9 390 Series"}, {0x67B1, 0x00, "AMD Radeon R9 200 Series"}, {0x67B1, 0x80, "AMD Radeon R9 390 Series"}, {0x67B9, 0x00, "AMD Radeon R9 200 Series"}, {0x67C0, 0x00, "AMD Radeon Pro WX 7100 Graphics"}, {0x67C0, 0x80, "AMD Radeon E9550"}, {0x67C2, 0x01, "AMD Radeon Pro V7350x2"}, {0x67C2, 0x02, "AMD Radeon Pro V7300X"}, {0x67C4, 0x00, "AMD Radeon Pro WX 7100 Graphics"}, {0x67C4, 0x80, "AMD Radeon E9560 / E9565 Graphics"}, {0x67C7, 0x00, "AMD Radeon Pro WX 5100 Graphics"}, {0x67C7, 0x80, "AMD Radeon E9390 Graphics"}, {0x67D0, 0x01, "AMD Radeon Pro V7350x2"}, {0x67D0, 0x02, "AMD Radeon Pro V7300X"}, {0x67DF, 0xC0, "AMD Radeon Pro 580X"}, {0x67DF, 0xC1, "AMD Radeon RX 580 Series"}, {0x67DF, 0xC2, "AMD Radeon RX 570 Series"}, {0x67DF, 0xC3, "AMD Radeon RX 580 Series"}, {0x67DF, 0xC4, "AMD Radeon RX 480 Graphics"}, {0x67DF, 0xC5, "AMD Radeon RX 470 Graphics"}, {0x67DF, 0xC6, "AMD Radeon RX 570 Series"}, {0x67DF, 0xC7, "AMD Radeon RX 480 Graphics"}, {0x67DF, 0xCF, "AMD Radeon RX 470 Graphics"}, {0x67DF, 0xD7, "AMD Radeon RX 470 Graphics"}, {0x67DF, 0xE0, "AMD Radeon RX 470 Series"}, {0x67DF, 0xE1, "AMD Radeon RX 590 Series"}, {0x67DF, 0xE3, "AMD Radeon RX Series"}, {0x67DF, 0xE7, "AMD Radeon RX 580 Series"}, {0x67DF, 0xEB, "AMD Radeon Pro 580X"}, {0x67DF, 0xEF, "AMD Radeon RX 570 Series"}, {0x67DF, 0xF7, "AMD Radeon RX P30PH"}, {0x67DF, 0xFF, "AMD Radeon RX 470 Series"}, {0x67E0, 0x00, "AMD Radeon Pro WX Series"}, {0x67E3, 0x00, "AMD Radeon Pro WX 4100"}, {0x67E8, 0x00, "AMD Radeon Pro WX Series"}, {0x67E8, 0x01, "AMD Radeon Pro WX Series"}, {0x67E8, 0x80, "AMD Radeon E9260 Graphics"}, {0x67EB, 0x00, "AMD Radeon Pro V5300X"}, {0x67EF, 0xC0, "AMD Radeon RX Graphics"}, {0x67EF, 0xC1, "AMD Radeon RX 460 Graphics"}, {0x67EF, 0xC2, "AMD Radeon Pro Series"}, {0x67EF, 0xC3, "AMD Radeon RX Series"}, {0x67EF, 0xC5, "AMD Radeon RX 460 Graphics"}, {0x67EF, 0xC7, "AMD Radeon RX Graphics"}, {0x67EF, 0xCF, "AMD Radeon RX 460 Graphics"}, {0x67EF, 0xE0, "AMD Radeon RX 560 Series"}, {0x67EF, 0xE1, "AMD Radeon RX Series"}, {0x67EF, 0xE2, "AMD Radeon RX 560X"}, {0x67EF, 0xE3, "AMD Radeon RX Series"}, {0x67EF, 0xE5, "AMD Radeon RX 560 Series"}, {0x67EF, 0xE7, "AMD Radeon RX 560 Series"}, {0x67EF, 0xEF, "AMD Radeon 550 Series"}, {0x67EF, 0xFF, "AMD Radeon RX 460 Graphics"}, {0x67FF, 0xC0, "AMD Radeon Pro 465"}, {0x67FF, 0xC1, "AMD Radeon RX 560 Series"}, {0x67FF, 0xCF, "AMD Radeon RX 560 Series"}, {0x67FF, 0xEF, "AMD Radeon RX 560 Series"}, {0x67FF, 0xFF, "AMD Radeon RX 550 Series"}, {0x6800, 0x00, "AMD Radeon HD 7970M"}, {0x6801, 0x00, "AMD Radeon HD 8970M"}, {0x6806, 0x00, "AMD Radeon R9 M290X"}, {0x6808, 0x00, "AMD FirePro W7000"}, {0x6808, 0x00, "ATI FirePro V (FireGL V) Graphics Adapter"}, {0x6809, 0x00, "ATI FirePro W5000"}, {0x6810, 0x00, "AMD Radeon R9 200 Series"}, {0x6810, 0x81, "AMD Radeon R9 370 Series"}, {0x6811, 0x00, "AMD Radeon R9 200 Series"}, {0x6811, 0x81, "AMD Radeon R7 370 Series"}, {0x6818, 0x00, "AMD Radeon HD 7800 Series"}, {0x6819, 0x00, "AMD Radeon HD 7800 Series"}, {0x6820, 0x00, "AMD Radeon R9 M275X"}, {0x6820, 0x81, "AMD Radeon R9 M375"}, {0x6820, 0x83, "AMD Radeon R9 M375X"}, {0x6821, 0x00, "AMD Radeon R9 M200X Series"}, {0x6821, 0x83, "AMD Radeon R9 M370X"}, {0x6821, 0x87, "AMD Radeon R7 M380"}, {0x6822, 0x00, "AMD Radeon E8860"}, {0x6823, 0x00, "AMD Radeon R9 M200X Series"}, {0x6825, 0x00, "AMD Radeon HD 7800M Series"}, {0x6826, 0x00, "AMD Radeon HD 7700M Series"}, {0x6827, 0x00, "AMD Radeon HD 7800M Series"}, {0x6828, 0x00, "AMD FirePro W600"}, {0x682B, 0x00, "AMD Radeon HD 8800M Series"}, {0x682B, 0x87, "AMD Radeon R9 M360"}, {0x682C, 0x00, "AMD FirePro W4100"}, {0x682D, 0x00, "AMD Radeon HD 7700M Series"}, {0x682F, 0x00, "AMD Radeon HD 7700M Series"}, {0x6830, 0x00, "AMD Radeon 7800M Series"}, {0x6831, 0x00, "AMD Radeon 7700M Series"}, {0x6835, 0x00, "AMD Radeon R7 Series / HD 9000 Series"}, {0x6837, 0x00, "AMD Radeon HD 7700 Series"}, {0x683D, 0x00, "AMD Radeon HD 7700 Series"}, {0x683F, 0x00, "AMD Radeon HD 7700 Series"}, {0x684C, 0x00, "ATI FirePro V (FireGL V) Graphics Adapter"}, {0x6860, 0x00, "AMD Radeon Instinct MI25"}, {0x6860, 0x01, "AMD Radeon Instinct MI25"}, {0x6860, 0x02, "AMD Radeon Instinct MI25"}, {0x6860, 0x03, "AMD Radeon Pro V340"}, {0x6860, 0x04, "AMD Radeon Instinct MI25x2"}, {0x6860, 0x07, "AMD Radeon Pro V320"}, {0x6861, 0x00, "AMD Radeon Pro WX 9100"}, {0x6862, 0x00, "AMD Radeon Pro SSG"}, {0x6863, 0x00, "AMD Radeon Vega Frontier Edition"}, {0x6864, 0x03, "AMD Radeon Pro V340"}, {0x6864, 0x04, "AMD Radeon Instinct MI25x2"}, {0x6864, 0x05, "AMD Radeon Pro V340"}, {0x6868, 0x00, "AMD Radeon Pro WX 8200"}, {0x686C, 0x00, "AMD Radeon Instinct MI25 MxGPU"}, {0x686C, 0x01, "AMD Radeon Instinct MI25 MxGPU"}, {0x686C, 0x02, "AMD Radeon Instinct MI25 MxGPU"}, {0x686C, 0x03, "AMD Radeon Pro V340 MxGPU"}, {0x686C, 0x04, "AMD Radeon Instinct MI25x2 MxGPU"}, {0x686C, 0x05, "AMD Radeon Pro V340L MxGPU"}, {0x686C, 0x06, "AMD Radeon Instinct MI25 MxGPU"}, {0x687F, 0x01, "AMD Radeon RX Vega"}, {0x687F, 0xC0, "AMD Radeon RX Vega"}, {0x687F, 0xC1, "AMD Radeon RX Vega"}, {0x687F, 0xC3, "AMD Radeon RX Vega"}, {0x687F, 0xC7, "AMD Radeon RX Vega"}, {0x6900, 0x00, "AMD Radeon R7 M260"}, {0x6900, 0x81, "AMD Radeon R7 M360"}, {0x6900, 0x83, "AMD Radeon R7 M340"}, {0x6900, 0xC1, "AMD Radeon R5 M465 Series"}, {0x6900, 0xC3, "AMD Radeon R5 M445 Series"}, {0x6900, 0xD1, "AMD Radeon 530 Series"}, {0x6900, 0xD3, "AMD Radeon 530 Series"}, {0x6901, 0x00, "AMD Radeon R5 M255"}, {0x6902, 0x00, "AMD Radeon Series"}, {0x6907, 0x00, "AMD Radeon R5 M255"}, {0x6907, 0x87, "AMD Radeon R5 M315"}, {0x6920, 0x00, "AMD Radeon R9 M395X"}, {0x6920, 0x01, "AMD Radeon R9 M390X"}, {0x6921, 0x00, "AMD Radeon R9 M390X"}, {0x6929, 0x00, "AMD FirePro S7150"}, {0x6929, 0x01, "AMD FirePro S7100X"}, {0x692B, 0x00, "AMD FirePro W7100"}, {0x6938, 0x00, "AMD Radeon R9 200 Series"}, {0x6938, 0xF0, "AMD Radeon R9 200 Series"}, {0x6938, 0xF1, "AMD Radeon R9 380 Series"}, {0x6939, 0x00, "AMD Radeon R9 200 Series"}, {0x6939, 0xF0, "AMD Radeon R9 200 Series"}, {0x6939, 0xF1, "AMD Radeon R9 380 Series"}, {0x694C, 0xC0, "AMD Radeon RX Vega M GH Graphics"}, {0x694E, 0xC0, "AMD Radeon RX Vega M GL Graphics"}, {0x6980, 0x00, "AMD Radeon Pro WX 3100"}, {0x6981, 0x00, "AMD Radeon Pro WX 3200 Series"}, {0x6981, 0x01, "AMD Radeon Pro WX 3200 Series"}, {0x6981, 0x10, "AMD Radeon Pro WX 3200 Series"}, {0x6985, 0x00, "AMD Radeon Pro WX 3100"}, {0x6986, 0x00, "AMD Radeon Pro WX 2100"}, {0x6987, 0x80, "AMD Embedded Radeon E9171"}, {0x6987, 0xC0, "AMD Radeon 550X Series"}, {0x6987, 0xC1, "AMD Radeon RX 640"}, {0x6987, 0xC3, "AMD Radeon 540X Series"}, {0x6987, 0xC7, "AMD Radeon 540"}, {0x6995, 0x00, "AMD Radeon Pro WX 2100"}, {0x6997, 0x00, "AMD Radeon Pro WX 2100"}, {0x699F, 0x81, "AMD Embedded Radeon E9170 Series"}, {0x699F, 0xC0, "AMD Radeon 500 Series"}, {0x699F, 0xC1, "AMD Radeon 540 Series"}, {0x699F, 0xC3, "AMD Radeon 500 Series"}, {0x699F, 0xC7, "AMD Radeon RX 550 / 550 Series"}, {0x699F, 0xC9, "AMD Radeon 540"}, {0x6FDF, 0xE7, "AMD Radeon RX 590 GME"}, {0x6FDF, 0xEF, "AMD Radeon RX 580 2048SP"}, {0x7300, 0xC1, "AMD FirePro S9300 x2"}, {0x7300, 0xC8, "AMD Radeon R9 Fury Series"}, {0x7300, 0xC9, "AMD Radeon Pro Duo"}, {0x7300, 0xCA, "AMD Radeon R9 Fury Series"}, {0x7300, 0xCB, "AMD Radeon R9 Fury Series"}, {0x7312, 0x00, "AMD Radeon Pro W5700"}, {0x731E, 0xC6, "AMD Radeon RX 5700XTB"}, {0x731E, 0xC7, "AMD Radeon RX 5700B"}, {0x731F, 0xC0, "AMD Radeon RX 5700 XT 50th Anniversary"}, {0x731F, 0xC1, "AMD Radeon RX 5700 XT"}, {0x731F, 0xC2, "AMD Radeon RX 5600M"}, {0x731F, 0xC3, "AMD Radeon RX 5700M"}, {0x731F, 0xC4, "AMD Radeon RX 5700"}, {0x731F, 0xC5, "AMD Radeon RX 5700 XT"}, {0x731F, 0xCA, "AMD Radeon RX 5600 XT"}, {0x731F, 0xCB, "AMD Radeon RX 5600 OEM"}, {0x7340, 0xC1, "AMD Radeon RX 5500M"}, {0x7340, 0xC3, "AMD Radeon RX 5300M"}, {0x7340, 0xC5, "AMD Radeon RX 5500 XT"}, {0x7340, 0xC7, "AMD Radeon RX 5500"}, {0x7340, 0xC9, "AMD Radeon RX 5500XTB"}, {0x7340, 0xCF, "AMD Radeon RX 5300"}, {0x7341, 0x00, "AMD Radeon Pro W5500"}, {0x7347, 0x00, "AMD Radeon Pro W5500M"}, {0x7360, 0x41, "AMD Radeon Pro 5600M"}, {0x7360, 0xC3, "AMD Radeon Pro V520"}, {0x738C, 0x01, "AMD Instinct MI100"}, {0x73A3, 0x00, "AMD Radeon Pro W6800"}, {0x73A5, 0xC0, "AMD Radeon RX 6950 XT"}, {0x73AF, 0xC0, "AMD Radeon RX 6900 XT"}, {0x73BF, 0xC0, "AMD Radeon RX 6900 XT"}, {0x73BF, 0xC1, "AMD Radeon RX 6800 XT"}, {0x73BF, 0xC3, "AMD Radeon RX 6800"}, {0x73DF, 0xC0, "AMD Radeon RX 6750 XT"}, {0x73DF, 0xC1, "AMD Radeon RX 6700 XT"}, {0x73DF, 0xC2, "AMD Radeon RX 6800M"}, {0x73DF, 0xC3, "AMD Radeon RX 6800M"}, {0x73DF, 0xC5, "AMD Radeon RX 6700 XT"}, {0x73DF, 0xCF, "AMD Radeon RX 6700M"}, {0x73DF, 0xD7, "AMD TDC-235"}, {0x73E1, 0x00, "AMD Radeon Pro W6600M"}, {0x73E3, 0x00, "AMD Radeon Pro W6600"}, {0x73EF, 0xC0, "AMD Radeon RX 6800S"}, {0x73EF, 0xC1, "AMD Radeon RX 6650 XT"}, {0x73EF, 0xC2, "AMD Radeon RX 6700S"}, {0x73EF, 0xC3, "AMD Radeon RX 6650M"}, {0x73EF, 0xC4, "AMD Radeon RX 6650M XT"}, {0x73FF, 0xC1, "AMD Radeon RX 6600 XT"}, {0x73FF, 0xC3, "AMD Radeon RX 6600M"}, {0x73FF, 0xC7, "AMD Radeon RX 6600"}, {0x73FF, 0xCB, "AMD Radeon RX 6600S"}, {0x7408, 0x00, "AMD Instinct MI250X"}, {0x740C, 0x01, "AMD Instinct MI250X / MI250"}, {0x740F, 0x02, "AMD Instinct MI210"}, {0x7421, 0x00, "AMD Radeon Pro W6500M"}, {0x7422, 0x00, "AMD Radeon Pro W6400"}, {0x7423, 0x00, "AMD Radeon Pro W6300M"}, {0x7423, 0x01, "AMD Radeon Pro W6300"}, {0x7424, 0x00, "AMD Radeon RX 6300"}, {0x743F, 0xC1, "AMD Radeon RX 6500 XT"}, {0x743F, 0xC3, "AMD Radeon RX 6500"}, {0x743F, 0xC3, "AMD Radeon RX 6500M"}, {0x743F, 0xC7, "AMD Radeon RX 6400"}, {0x743F, 0xCF, "AMD Radeon RX 6300M"}, {0x9830, 0x00, "AMD Radeon HD 8400 / R3 Series"}, {0x9831, 0x00, "AMD Radeon HD 8400E"}, {0x9832, 0x00, "AMD Radeon HD 8330"}, {0x9833, 0x00, "AMD Radeon HD 8330E"}, {0x9834, 0x00, "AMD Radeon HD 8210"}, {0x9835, 0x00, "AMD Radeon HD 8210E"}, {0x9836, 0x00, "AMD Radeon HD 8200 / R3 Series"}, {0x9837, 0x00, "AMD Radeon HD 8280E"}, {0x9838, 0x00, "AMD Radeon HD 8200 / R3 series"}, {0x9839, 0x00, "AMD Radeon HD 8180"}, {0x983D, 0x00, "AMD Radeon HD 8250"}, {0x9850, 0x00, "AMD Radeon R3 Graphics"}, {0x9850, 0x03, "AMD Radeon R3 Graphics"}, {0x9850, 0x40, "AMD Radeon R2 Graphics"}, {0x9850, 0x45, "AMD Radeon R3 Graphics"}, {0x9851, 0x00, "AMD Radeon R4 Graphics"}, {0x9851, 0x01, "AMD Radeon R5E Graphics"}, {0x9851, 0x05, "AMD Radeon R5 Graphics"}, {0x9851, 0x06, "AMD Radeon R5E Graphics"}, {0x9851, 0x40, "AMD Radeon R4 Graphics"}, {0x9851, 0x45, "AMD Radeon R5 Graphics"}, {0x9852, 0x00, "AMD Radeon R2 Graphics"}, {0x9852, 0x40, "AMD Radeon E1 Graphics"}, {0x9853, 0x00, "AMD Radeon R2 Graphics"}, {0x9853, 0x01, "AMD Radeon R4E Graphics"}, {0x9853, 0x03, "AMD Radeon R2 Graphics"}, {0x9853, 0x05, "AMD Radeon R1E Graphics"}, {0x9853, 0x06, "AMD Radeon R1E Graphics"}, {0x9853, 0x07, "AMD Radeon R1E Graphics"}, {0x9853, 0x08, "AMD Radeon R1E Graphics"}, {0x9853, 0x40, "AMD Radeon R2 Graphics"}, {0x9854, 0x00, "AMD Radeon R3 Graphics"}, {0x9854, 0x01, "AMD Radeon R3E Graphics"}, {0x9854, 0x02, "AMD Radeon R3 Graphics"}, {0x9854, 0x05, "AMD Radeon R2 Graphics"}, {0x9854, 0x06, "AMD Radeon R4 Graphics"}, {0x9854, 0x07, "AMD Radeon R3 Graphics"}, {0x9855, 0x02, "AMD Radeon R6 Graphics"}, {0x9855, 0x05, "AMD Radeon R4 Graphics"}, {0x9856, 0x00, "AMD Radeon R2 Graphics"}, {0x9856, 0x01, "AMD Radeon R2E Graphics"}, {0x9856, 0x02, "AMD Radeon R2 Graphics"}, {0x9856, 0x05, "AMD Radeon R1E Graphics"}, {0x9856, 0x06, "AMD Radeon R2 Graphics"}, {0x9856, 0x07, "AMD Radeon R1E Graphics"}, {0x9856, 0x08, "AMD Radeon R1E Graphics"}, {0x9856, 0x13, "AMD Radeon R1E Graphics"}, {0x9874, 0x81, "AMD Radeon R6 Graphics"}, {0x9874, 0x84, "AMD Radeon R7 Graphics"}, {0x9874, 0x85, "AMD Radeon R6 Graphics"}, {0x9874, 0x87, "AMD Radeon R5 Graphics"}, {0x9874, 0x88, "AMD Radeon R7E Graphics"}, {0x9874, 0x89, "AMD Radeon R6E Graphics"}, {0x9874, 0xC4, "AMD Radeon R7 Graphics"}, {0x9874, 0xC5, "AMD Radeon R6 Graphics"}, {0x9874, 0xC6, "AMD Radeon R6 Graphics"}, {0x9874, 0xC7, "AMD Radeon R5 Graphics"}, {0x9874, 0xC8, "AMD Radeon R7 Graphics"}, {0x9874, 0xC9, "AMD Radeon R7 Graphics"}, {0x9874, 0xCA, "AMD Radeon R5 Graphics"}, {0x9874, 0xCB, "AMD Radeon R5 Graphics"}, {0x9874, 0xCC, "AMD Radeon R7 Graphics"}, {0x9874, 0xCD, "AMD Radeon R7 Graphics"}, {0x9874, 0xCE, "AMD Radeon R5 Graphics"}, {0x9874, 0xE1, "AMD Radeon R7 Graphics"}, {0x9874, 0xE2, "AMD Radeon R7 Graphics"}, {0x9874, 0xE3, "AMD Radeon R7 Graphics"}, {0x9874, 0xE4, "AMD Radeon R7 Graphics"}, {0x9874, 0xE5, "AMD Radeon R5 Graphics"}, {0x9874, 0xE6, "AMD Radeon R5 Graphics"}, {0x98E4, 0x80, "AMD Radeon R5E Graphics"}, {0x98E4, 0x81, "AMD Radeon R4E Graphics"}, {0x98E4, 0x83, "AMD Radeon R2E Graphics"}, {0x98E4, 0x84, "AMD Radeon R2E Graphics"}, {0x98E4, 0x86, "AMD Radeon R1E Graphics"}, {0x98E4, 0xC0, "AMD Radeon R4 Graphics"}, {0x98E4, 0xC1, "AMD Radeon R5 Graphics"}, {0x98E4, 0xC2, "AMD Radeon R4 Graphics"}, {0x98E4, 0xC4, "AMD Radeon R5 Graphics"}, {0x98E4, 0xC6, "AMD Radeon R5 Graphics"}, {0x98E4, 0xC8, "AMD Radeon R4 Graphics"}, {0x98E4, 0xC9, "AMD Radeon R4 Graphics"}, {0x98E4, 0xCA, "AMD Radeon R5 Graphics"}, {0x98E4, 0xD0, "AMD Radeon R2 Graphics"}, {0x98E4, 0xD1, "AMD Radeon R2 Graphics"}, {0x98E4, 0xD2, "AMD Radeon R2 Graphics"}, {0x98E4, 0xD4, "AMD Radeon R2 Graphics"}, {0x98E4, 0xD9, "AMD Radeon R5 Graphics"}, {0x98E4, 0xDA, "AMD Radeon R5 Graphics"}, {0x98E4, 0xDB, "AMD Radeon R3 Graphics"}, {0x98E4, 0xE1, "AMD Radeon R3 Graphics"}, {0x98E4, 0xE2, "AMD Radeon R3 Graphics"}, {0x98E4, 0xE9, "AMD Radeon R4 Graphics"}, {0x98E4, 0xEA, "AMD Radeon R4 Graphics"}, {0x98E4, 0xEB, "AMD Radeon R3 Graphics"}, {0x98E4, 0xEC, "AMD Radeon R4 Graphics"}, }; #endif nvtop-3.0.2/src/device_discovery_linux.c000066400000000000000000000301221444130114000203500ustar00rootroot00000000000000/* * Copyright (C) 2022 Maxime Schmitt * * This file is part of Nvtop and adapted from radeontop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/device_discovery.h" #include #include #include #include #if defined(USING_LIBUDEV) && defined(USING_LIBSYSTEMD) #error Cannot use libudev and libsystemd at the same time #endif #if defined(USING_LIBUDEV) #include #include #include #include typedef struct nvtop_device_enumerator { unsigned refCount; struct udev *udev; struct udev_enumerate *enumerate; unsigned num_devices; unsigned current_device; struct udev_device **devices; } nvtop_device_enumerator; nvtop_device *nvtop_device_ref(nvtop_device *device) { udev_device_ref((struct udev_device *)device); return device; } nvtop_device *nvtop_device_unref(nvtop_device *device) { udev_device_unref((struct udev_device *)device); return NULL; } int nvtop_device_new_from_syspath(nvtop_device **dev, const char *syspath) { struct udev *udev = udev_new(); if (!udev) return -ENOMEM; *dev = (nvtop_device *)udev_device_new_from_syspath(udev, syspath); udev_unref(udev); return *dev ? 1 : -ENOENT; } int nvtop_device_get_parent(nvtop_device *child, nvtop_device **parent) { *parent = (nvtop_device *)udev_device_get_parent((struct udev_device *)child); return *parent ? 0 : -ENOENT; } int nvtop_device_get_driver(nvtop_device *device, const char **driver) { *driver = udev_device_get_driver((struct udev_device *)device); return *driver ? 0 : -ENOENT; } int nvtop_device_get_devname(nvtop_device *device, const char **devname) { *devname = udev_device_get_devnode((struct udev_device *)device); return *devname ? 0 : -ENOENT; } int nvtop_device_get_property_value(nvtop_device *device, const char *key, const char **value) { *value = udev_device_get_property_value((struct udev_device *)device, key); return *value ? 0 : -ENOENT; } int nvtop_device_get_sysattr_value(nvtop_device *device, const char *sysattr, const char **value) { *value = udev_device_get_sysattr_value((struct udev_device *)device, sysattr); return *value ? 0 : -ENOENT; } int nvtop_device_get_syspath(nvtop_device *device, const char **sysPath) { *sysPath = udev_device_get_syspath((struct udev_device *)device); return *sysPath ? 0 : -ENOENT; } int nvtop_enumerator_new(nvtop_device_enumerator **enumerator) { *enumerator = calloc(1, sizeof(**enumerator)); if (!enumerator) return -1; (*enumerator)->refCount = 1; (*enumerator)->udev = udev_new(); if (!(*enumerator)->udev) goto cleanAllocErr; (*enumerator)->enumerate = udev_enumerate_new((*enumerator)->udev); if (!(*enumerator)->enumerate) goto cleanAllErr; return 0; cleanAllErr: udev_unref((*enumerator)->udev); cleanAllocErr: free(*enumerator); return -1; } static void nvtop_free_enumerator_devices(nvtop_device_enumerator *enumerator) { if (enumerator->devices) { for (unsigned i = 0; enumerator->devices && i < enumerator->num_devices; ++i) { udev_device_unref(enumerator->devices[i]); } free(enumerator->devices); enumerator->devices = NULL; } } nvtop_device_enumerator *nvtop_enumerator_ref(nvtop_device_enumerator *enumerator) { enumerator->refCount++; udev_ref(enumerator->udev); udev_enumerate_ref(enumerator->enumerate); return enumerator; } nvtop_device_enumerator *nvtop_enumerator_unref(nvtop_device_enumerator *enumerator) { enumerator->refCount--; udev_enumerate_unref(enumerator->enumerate); udev_unref(enumerator->udev); if (!enumerator->refCount) { nvtop_free_enumerator_devices(enumerator); free(enumerator); return NULL; } else { return enumerator; } } int nvtop_device_enumerator_add_match_subsystem(nvtop_device_enumerator *enumerator, const char *subsystem, int match) { assert(enumerator->refCount && "Reference at zero"); nvtop_free_enumerator_devices(enumerator); int ret = 1; if (match) { ret = udev_enumerate_add_match_subsystem(enumerator->enumerate, subsystem); } else { ret = udev_enumerate_add_nomatch_subsystem(enumerator->enumerate, subsystem); } return ret; } int nvtop_device_enumerator_add_match_property(nvtop_device_enumerator *enumerator, const char *property, const char *value) { assert(enumerator->refCount && "Reference at zero"); nvtop_free_enumerator_devices(enumerator); return udev_enumerate_add_match_property(enumerator->enumerate, property, value); } int nvtop_device_enumerator_add_match_parent(nvtop_device_enumerator *enumerator, nvtop_device *parent) { assert(enumerator->refCount && "Reference at zero"); nvtop_free_enumerator_devices(enumerator); return udev_enumerate_add_match_parent(enumerator->enumerate, (struct udev_device *)parent); } static nvtop_device *nvtop_enumerator_get_current(nvtop_device_enumerator *enumerator) { if (!enumerator->devices || enumerator->current_device >= enumerator->num_devices) return NULL; return (nvtop_device *)enumerator->devices[enumerator->current_device]; } nvtop_device *nvtop_enumerator_get_device_first(nvtop_device_enumerator *enumerator) { if (!enumerator->devices) { int err = udev_enumerate_scan_devices(enumerator->enumerate); if (err < 0) return NULL; struct udev_list_entry *list = udev_enumerate_get_list_entry(enumerator->enumerate); struct udev_list_entry *curr; enumerator->num_devices = 0; udev_list_entry_foreach(curr, list) { enumerator->num_devices++; } enumerator->devices = calloc(enumerator->num_devices, sizeof(*enumerator->devices)); if (!enumerator->devices) return NULL; unsigned idx = 0; udev_list_entry_foreach(curr, list) { const char *path = udev_list_entry_get_name(curr); enumerator->devices[idx++] = udev_device_new_from_syspath(enumerator->udev, path); } } enumerator->current_device = 0; return nvtop_enumerator_get_current(enumerator); } nvtop_device *nvtop_enumerator_get_device_next(nvtop_device_enumerator *enumerator) { enumerator->current_device++; return nvtop_enumerator_get_current(enumerator); } #elif defined(USING_LIBSYSTEMD) #include #include #include #include nvtop_device *nvtop_device_ref(nvtop_device *device) { return (nvtop_device *)sd_device_ref((sd_device *)device); } nvtop_device *nvtop_device_unref(nvtop_device *device) { return (nvtop_device *)sd_device_unref((sd_device *)device); } int nvtop_device_new_from_syspath(nvtop_device **dev, const char *syspath) { return sd_device_new_from_syspath((sd_device **)dev, syspath); } int nvtop_device_get_parent(nvtop_device *child, nvtop_device **parent) { return sd_device_get_parent((sd_device *)child, (sd_device **)parent); } int nvtop_device_get_driver(nvtop_device *device, const char **driver) { return sd_device_get_driver((sd_device *)device, driver); } int nvtop_device_get_devname(nvtop_device *device, const char **devname) { return sd_device_get_devname((sd_device *)device, devname); } int nvtop_device_get_property_value(nvtop_device *device, const char *key, const char **value) { return sd_device_get_property_value((sd_device *)device, key, value); } int nvtop_device_get_sysattr_value(nvtop_device *device, const char *sysattr, const char **value) { return sd_device_get_sysattr_value((sd_device *)device, sysattr, value); } int nvtop_device_get_syspath(nvtop_device *device, const char **sysPath) { return sd_device_get_syspath((sd_device *)device, sysPath); } int nvtop_enumerator_new(nvtop_device_enumerator **enumerator) { return sd_device_enumerator_new((sd_device_enumerator **)enumerator); } nvtop_device_enumerator *nvtop_enumerator_ref(nvtop_device_enumerator *enumerator) { return (nvtop_device_enumerator *)sd_device_enumerator_ref((sd_device_enumerator *)enumerator); } nvtop_device_enumerator *nvtop_enumerator_unref(nvtop_device_enumerator *enumerator) { return (nvtop_device_enumerator *)sd_device_enumerator_unref((sd_device_enumerator *)enumerator); } int nvtop_device_enumerator_add_match_subsystem(nvtop_device_enumerator *enumerator, const char *subsystem, int match) { return sd_device_enumerator_add_match_subsystem((sd_device_enumerator *)enumerator, subsystem, match); } int nvtop_device_enumerator_add_match_property(nvtop_device_enumerator *enumerator, const char *property, const char *value) { return sd_device_enumerator_add_match_property((sd_device_enumerator *)enumerator, property, value); } int nvtop_device_enumerator_add_match_parent(nvtop_device_enumerator *enumerator, nvtop_device *parent) { return sd_device_enumerator_add_match_parent((sd_device_enumerator *)enumerator, (sd_device *)parent); } nvtop_device *nvtop_enumerator_get_device_first(nvtop_device_enumerator *enumerator) { return (nvtop_device *)sd_device_enumerator_get_device_first((sd_device_enumerator *)enumerator); } nvtop_device *nvtop_enumerator_get_device_next(nvtop_device_enumerator *enumerator) { return (nvtop_device *)sd_device_enumerator_get_device_next((sd_device_enumerator *)enumerator); } #endif // elif USE_LIBSYSTEMD static int pcie_walker_helper(nvtop_device *dev, nvtop_pcie_link *pcie_info, const char *link_speed_attr, const char *link_width_attr) { bool valid = false; const char *driver; int ret = nvtop_device_get_driver(dev, &driver); if (ret < 0) return ret; if (!strcmp(driver, "pcieport")) { const char *speed_str, *width_str; unsigned speed, width; ret = nvtop_device_get_sysattr_value(dev, link_speed_attr, &speed_str); if (ret < 0) return ret; ret = nvtop_device_get_sysattr_value(dev, link_width_attr, &width_str); if (ret < 0) return ret; ret = sscanf(speed_str, "%u", &speed); if (ret != 1) return -1; ret = sscanf(width_str, "%u", &width); if (ret != 1) return -1; pcie_info->speed = pcie_info->speed > speed ? speed : pcie_info->speed; pcie_info->width = pcie_info->width > width ? width : pcie_info->width; valid = true; } nvtop_device *parent; ret = nvtop_device_get_parent(dev, &parent); if (ret < 0) return valid; ret = pcie_walker_helper(parent, pcie_info, link_speed_attr, link_width_attr); return valid || ret >= 0; } int nvtop_device_maximum_pcie_link(nvtop_device *dev, nvtop_pcie_link *pcie_info) { pcie_info->speed = UINT_MAX; pcie_info->width = UINT_MAX; return pcie_walker_helper(dev, pcie_info, "max_link_speed", "max_link_width"); } int nvtop_device_current_pcie_link(nvtop_device *dev, nvtop_pcie_link *pcie_info) { // We open a new device to avoid cached values const char *path; nvtop_device_get_syspath(dev, &path); nvtop_device *dev_samepath; int ret = nvtop_device_new_from_syspath(&dev_samepath, path); if (ret < 0) return ret; pcie_info->speed = UINT_MAX; pcie_info->width = UINT_MAX; ret = pcie_walker_helper(dev_samepath, pcie_info, "current_link_speed", "current_link_width"); nvtop_device_unref(dev_samepath); return ret; } nvtop_device *nvtop_device_get_hwmon(nvtop_device *dev) { nvtop_device_enumerator *enumerator; int ret = nvtop_enumerator_new(&enumerator); if (ret < 0) return NULL; ret = nvtop_device_enumerator_add_match_subsystem(enumerator, "hwmon", true); if (ret < 0) return NULL; ret = nvtop_device_enumerator_add_match_parent(enumerator, dev); if (ret < 0) return NULL; nvtop_device *hwmon = nvtop_enumerator_get_device_first(enumerator); nvtop_device_ref(hwmon); nvtop_enumerator_unref(enumerator); return hwmon; } nvtop-3.0.2/src/extract_gpuinfo.c000066400000000000000000000255041444130114000170140ustar00rootroot00000000000000/* * * Copyright (C) 2017-2022 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include #include #include #include #include #include #include "nvtop/extract_gpuinfo.h" #include "nvtop/extract_gpuinfo_common.h" #include "nvtop/extract_processinfo_fdinfo.h" #include "nvtop/get_process_info.h" #include "nvtop/time.h" #include "uthash.h" #define HASH_FIND_PID(head, key_ptr, out_ptr) HASH_FIND(hh, head, key_ptr, sizeof(*key_ptr), out_ptr) #define HASH_ADD_PID(head, in_ptr) HASH_ADD(hh, head, pid, sizeof(pid_t), in_ptr) const char drm_pdev[] = "drm-pdev"; const char drm_client_id[] = "drm-client-id"; struct process_info_cache { pid_t pid; char *cmdline; char *user_name; double last_total_consumed_cpu_time; nvtop_time last_measurement_timestamp; UT_hash_handle hh; }; struct process_info_cache *cached_process_info = NULL; struct process_info_cache *updated_process_info = NULL; static LIST_HEAD(gpu_vendors); void register_gpu_vendor(struct gpu_vendor *vendor) { list_add(&vendor->list, &gpu_vendors); } bool gpuinfo_init_info_extraction(unsigned *monitored_dev_count, struct list_head *devices) { struct gpu_vendor *vendor; *monitored_dev_count = 0; list_for_each_entry(vendor, &gpu_vendors, list) { unsigned vendor_devices_count = 0; if (vendor->init()) { bool retval = vendor->get_device_handles(devices, &vendor_devices_count); if (!retval || (retval && vendor_devices_count == 0)) { vendor->shutdown(); vendor_devices_count = 0; } } *monitored_dev_count += vendor_devices_count; } return true; } bool gpuinfo_shutdown_info_extraction(struct list_head *devices) { struct gpu_info *device, *tmp; struct gpu_vendor *vendor; list_for_each_entry_safe(device, tmp, devices, list) { free(device->processes); list_del(&device->list); } list_for_each_entry(vendor, &gpu_vendors, list) { vendor->shutdown(); } gpuinfo_clear_cache(); return true; } bool gpuinfo_populate_static_infos(struct list_head *devices) { struct gpu_info *device; list_for_each_entry(device, devices, list) { device->vendor->populate_static_info(device); } return true; } bool gpuinfo_refresh_dynamic_info(struct list_head *devices) { struct gpu_info *device; list_for_each_entry(device, devices, list) { device->vendor->refresh_dynamic_info(device); } return true; } #undef MYMIN #define MYMIN(a, b) (((a) < (b)) ? (a) : (b)) bool gpuinfo_fix_dynamic_info_from_process_info(struct list_head *devices) { struct gpu_info *device; list_for_each_entry(device, devices, list) { struct gpuinfo_dynamic_info *dynamic_info = &device->dynamic_info; // If the global GPU usage is not available, try computing it from the processes info // Some integrated AMDGPU report 100% usage while process usage is actually low bool needGpuRate = true; bool validReportedGpuRate = GPUINFO_DYNAMIC_FIELD_VALID(dynamic_info, gpu_util_rate); unsigned reportedGpuRate = dynamic_info->gpu_util_rate; RESET_GPUINFO_DYNAMIC(dynamic_info, gpu_util_rate); // AMDGPU does not provide encode and decode utilization through the DRM sensor info. // Update them here since per-process sysfs exposes this information. bool needGpuEncode = !GPUINFO_DYNAMIC_FIELD_VALID(dynamic_info, encoder_rate); bool needGpuDecode = !GPUINFO_DYNAMIC_FIELD_VALID(dynamic_info, decoder_rate); if (needGpuRate || needGpuEncode || needGpuDecode) { for (unsigned processIdx = 0; processIdx < device->processes_count; ++processIdx) { struct gpu_process *process_info = &device->processes[processIdx]; if (needGpuRate && GPUINFO_PROCESS_FIELD_VALID(process_info, gpu_usage)) { if (GPUINFO_DYNAMIC_FIELD_VALID(dynamic_info, gpu_util_rate)) { dynamic_info->gpu_util_rate = MYMIN(100, dynamic_info->gpu_util_rate + process_info->gpu_usage); } else { SET_GPUINFO_DYNAMIC(dynamic_info, gpu_util_rate, MYMIN(100, process_info->gpu_usage)); } } if (needGpuEncode && GPUINFO_PROCESS_FIELD_VALID(process_info, encode_usage)) { if (GPUINFO_DYNAMIC_FIELD_VALID(dynamic_info, encoder_rate)) { dynamic_info->encoder_rate = MYMIN(100, dynamic_info->encoder_rate + process_info->encode_usage); } else { SET_GPUINFO_DYNAMIC(dynamic_info, encoder_rate, MYMIN(100, process_info->encode_usage)); } } if (needGpuDecode && GPUINFO_PROCESS_FIELD_VALID(process_info, decode_usage)) { if (GPUINFO_DYNAMIC_FIELD_VALID(dynamic_info, decoder_rate)) { dynamic_info->decoder_rate = MYMIN(100, dynamic_info->decoder_rate + process_info->decode_usage); } else { SET_GPUINFO_DYNAMIC(dynamic_info, decoder_rate, MYMIN(100, process_info->decode_usage)); } } } } if (!GPUINFO_DYNAMIC_FIELD_VALID(dynamic_info, gpu_util_rate) && validReportedGpuRate) { SET_GPUINFO_DYNAMIC(dynamic_info, gpu_util_rate, reportedGpuRate); } else if (GPUINFO_DYNAMIC_FIELD_VALID(dynamic_info, gpu_util_rate) && validReportedGpuRate) { SET_GPUINFO_DYNAMIC( dynamic_info, gpu_util_rate, (dynamic_info->gpu_util_rate > reportedGpuRate ? dynamic_info->gpu_util_rate : reportedGpuRate)); } } return true; } #undef MYMIN static void gpuinfo_populate_process_info(struct gpu_info *device) { for (unsigned j = 0; j < device->processes_count; ++j) { pid_t current_pid = device->processes[j].pid; struct process_info_cache *cached_pid_info; HASH_FIND_PID(cached_process_info, ¤t_pid, cached_pid_info); if (!cached_pid_info) { HASH_FIND_PID(updated_process_info, ¤t_pid, cached_pid_info); if (!cached_pid_info) { // Newly encountered pid cached_pid_info = calloc(1, sizeof(*cached_pid_info)); cached_pid_info->pid = current_pid; get_username_from_pid(current_pid, &cached_pid_info->user_name); get_command_from_pid(current_pid, &cached_pid_info->cmdline); cached_pid_info->last_total_consumed_cpu_time = -1.; HASH_ADD_PID(updated_process_info, cached_pid_info); } } else { // Already encountered so delete from cached list to avoid freeing // memory at the end of this function HASH_DEL(cached_process_info, cached_pid_info); HASH_ADD_PID(updated_process_info, cached_pid_info); } if (cached_pid_info->cmdline) { SET_GPUINFO_PROCESS(&device->processes[j], cmdline, cached_pid_info->cmdline); } if (cached_pid_info->user_name) { SET_GPUINFO_PROCESS(&device->processes[j], user_name, cached_pid_info->user_name); } struct process_cpu_usage cpu_usage; if (get_process_info(current_pid, &cpu_usage)) { if (cached_pid_info->last_total_consumed_cpu_time > -1.) { double usage_percent = round( 100. * (cpu_usage.total_user_time + cpu_usage.total_kernel_time - cached_pid_info->last_total_consumed_cpu_time) / nvtop_difftime(cached_pid_info->last_measurement_timestamp, cpu_usage.timestamp)); SET_GPUINFO_PROCESS(&device->processes[j], cpu_usage, (unsigned)usage_percent); } else { SET_GPUINFO_PROCESS(&device->processes[j], cpu_usage, 0); } SET_GPUINFO_PROCESS(&device->processes[j], cpu_memory_res, cpu_usage.resident_memory); SET_GPUINFO_PROCESS(&device->processes[j], cpu_memory_virt, cpu_usage.virtual_memory); cached_pid_info->last_measurement_timestamp = cpu_usage.timestamp; cached_pid_info->last_total_consumed_cpu_time = cpu_usage.total_kernel_time + cpu_usage.total_user_time; } else { cached_pid_info->last_total_consumed_cpu_time = -1; } // Process memory usage percent of total device memory if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, total_memory) && GPUINFO_PROCESS_FIELD_VALID(&device->processes[j], gpu_memory_usage)) { float percentage = roundf(100.f * (float)device->processes[j].gpu_memory_usage / (float)device->dynamic_info.total_memory); SET_GPUINFO_PROCESS(&device->processes[j], gpu_memory_percentage, (unsigned)percentage); assert(device->processes[j].gpu_memory_percentage <= 100); } } } static void gpuinfo_clean_old_cache(void) { struct process_info_cache *pid_not_encountered, *tmp; HASH_ITER(hh, cached_process_info, pid_not_encountered, tmp) { HASH_DEL(cached_process_info, pid_not_encountered); free(pid_not_encountered->cmdline); free(pid_not_encountered->user_name); free(pid_not_encountered); } cached_process_info = updated_process_info; updated_process_info = NULL; } bool gpuinfo_refresh_processes(struct list_head *devices) { struct gpu_info *device; list_for_each_entry(device, devices, list) { device->processes_count = 0; } // Go through the /proc hierarchy once and populate the processes for all registered GPUs processinfo_sweep_fdinfos(); list_for_each_entry(device, devices, list) { device->vendor->refresh_running_processes(device); gpuinfo_populate_process_info(device); } gpuinfo_clean_old_cache(); return true; } void gpuinfo_clear_cache(void) { if (cached_process_info) { struct process_info_cache *pid_cached, *tmp; HASH_ITER(hh, cached_process_info, pid_cached, tmp) { HASH_DEL(cached_process_info, pid_cached); free(pid_cached->cmdline); free(pid_cached->user_name); free(pid_cached); } } } bool extract_drm_fdinfo_key_value(char *buf, char **key, char **val) { char *p = buf; p = index(buf, ':'); if (!p || p == buf) return false; *p = '\0'; while (*++p && isspace(*p)) ; if (!*p) return false; *key = buf; *val = p; return true; } extern inline unsigned busy_usage_from_time_usage_round(uint64_t current_use_ns, uint64_t previous_use_ns, uint64_t time_between_measurement); unsigned nvtop_pcie_gen_from_link_speed(unsigned linkSpeed) { unsigned pcieGen = 0; switch (linkSpeed) { case 2: pcieGen = 1; break; case 5: pcieGen = 2; break; case 8: pcieGen = 3; break; case 16: pcieGen = 4; break; case 32: pcieGen = 5; break; case 64: pcieGen = 6; break; } return pcieGen; } nvtop-3.0.2/src/extract_gpuinfo_amdgpu.c000066400000000000000000001132351444130114000203500ustar00rootroot00000000000000/* * Copyright (C) 2012 Lauri Kasanen * Copyright (C) 2018 Genesis Cloud Ltd. * Copyright (C) 2022 YiFei Zhu * Copyright (C) 2022 Maxime Schmitt * Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. * * This file is part of Nvtop and adapted from radeontop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/common.h" #include "nvtop/device_discovery.h" #include "nvtop/extract_gpuinfo_common.h" #include "nvtop/extract_processinfo_fdinfo.h" #include "nvtop/time.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // extern const char *amdgpu_parse_marketing_name(struct amdgpu_gpu_info *info); // Local function pointers to DRM interface static typeof(drmGetDevices) *_drmGetDevices; static typeof(drmGetDevices2) *_drmGetDevices2; static typeof(drmFreeDevices) *_drmFreeDevices; static typeof(drmGetVersion) *_drmGetVersion; static typeof(drmFreeVersion) *_drmFreeVersion; static typeof(drmGetMagic) *_drmGetMagic; static typeof(drmAuthMagic) *_drmAuthMagic; static typeof(drmDropMaster) *_drmDropMaster; // Local function pointers to amdgpu DRM interface static typeof(amdgpu_device_initialize) *_amdgpu_device_initialize; static typeof(amdgpu_device_deinitialize) *_amdgpu_device_deinitialize; static typeof(amdgpu_get_marketing_name) *_amdgpu_get_marketing_name; static typeof(amdgpu_query_gpu_info) *_amdgpu_query_gpu_info; static typeof(amdgpu_query_info) *_amdgpu_query_info; static typeof(amdgpu_query_sensor_info) *_amdgpu_query_sensor_info; static void *libdrm_handle; static void *libdrm_amdgpu_handle; static int last_libdrm_return_status = 0; static char didnt_call_gpuinfo_init[] = "uninitialized"; static const char *local_error_string = didnt_call_gpuinfo_init; #define HASH_FIND_CLIENT(head, key_ptr, out_ptr) HASH_FIND(hh, head, key_ptr, sizeof(unsigned), out_ptr) #define HASH_ADD_CLIENT(head, in_ptr) HASH_ADD(hh, head, client_id, sizeof(unsigned), in_ptr) #define SET_AMDGPU_CACHE(cachePtr, field, value) SET_VALUE(cachePtr, field, value, amdgpu_cache_) #define RESET_AMDGPU_CACHE(cachePtr, field) INVALIDATE_VALUE(cachePtr, field, amdgpu_cache_) #define AMDGPU_CACHE_FIELD_VALID(cachePtr, field) VALUE_IS_VALID(cachePtr, field, amdgpu_cache_) enum amdgpu_process_info_cache_valid { amdgpu_cache_gfx_engine_used_valid = 0, amdgpu_cache_compute_engine_used_valid, amdgpu_cache_enc_engine_used_valid, amdgpu_cache_dec_engine_used_valid, amdgpu_cache_process_info_cache_valid_count }; struct __attribute__((__packed__)) unique_cache_id { unsigned client_id; pid_t pid; char *pdev; }; struct amdgpu_process_info_cache { struct unique_cache_id client_id; uint64_t gfx_engine_used; uint64_t compute_engine_used; uint64_t enc_engine_used; uint64_t dec_engine_used; nvtop_time last_measurement_tstamp; unsigned char valid[(amdgpu_cache_process_info_cache_valid_count + CHAR_BIT - 1) / CHAR_BIT]; UT_hash_handle hh; }; struct gpu_info_amdgpu { struct gpu_info base; drmVersionPtr drmVersion; int fd; amdgpu_device_handle amdgpu_device; // We poll the fan frequently enough and want to avoid the open/close overhead of the sysfs file FILE *fanSpeedFILE; // FILE* for this device current fan speed FILE *PCIeBW; // FILE* for this device PCIe bandwidth over one second FILE *powerCap; // FILE* for this device power cap nvtop_device *amdgpuDevice; // The AMDGPU driver device nvtop_device *hwmonDevice; // The AMDGPU driver hwmon device struct amdgpu_process_info_cache *last_update_process_cache, *current_update_process_cache; // Cached processes info // Used to compute the actual fan speed unsigned maxFanValue; }; unsigned amdgpu_count; static struct gpu_info_amdgpu *gpu_infos; static bool gpuinfo_amdgpu_init(void); static void gpuinfo_amdgpu_shutdown(void); static const char *gpuinfo_amdgpu_last_error_string(void); static bool gpuinfo_amdgpu_get_device_handles(struct list_head *devices, unsigned *count); static void gpuinfo_amdgpu_populate_static_info(struct gpu_info *_gpu_info); static void gpuinfo_amdgpu_refresh_dynamic_info(struct gpu_info *_gpu_info); static void gpuinfo_amdgpu_get_running_processes(struct gpu_info *_gpu_info); struct gpu_vendor gpu_vendor_amdgpu = { .init = gpuinfo_amdgpu_init, .shutdown = gpuinfo_amdgpu_shutdown, .last_error_string = gpuinfo_amdgpu_last_error_string, .get_device_handles = gpuinfo_amdgpu_get_device_handles, .populate_static_info = gpuinfo_amdgpu_populate_static_info, .refresh_dynamic_info = gpuinfo_amdgpu_refresh_dynamic_info, .refresh_running_processes = gpuinfo_amdgpu_get_running_processes, .name = "AMD", }; static int readAttributeFromDevice(nvtop_device *dev, const char *sysAttr, const char *format, ...); __attribute__((constructor)) static void init_extract_gpuinfo_amdgpu(void) { register_gpu_vendor(&gpu_vendor_amdgpu); } static int wrap_drmGetDevices(drmDevicePtr devices[], int max_devices) { assert(_drmGetDevices2 || _drmGetDevices); if (_drmGetDevices2) return _drmGetDevices2(0, devices, max_devices); return _drmGetDevices(devices, max_devices); } static bool parse_drm_fdinfo_amd(struct gpu_info *info, FILE *fdinfo_file, struct gpu_process *process_info); static bool gpuinfo_amdgpu_init(void) { libdrm_handle = dlopen("libdrm.so", RTLD_LAZY); if (!libdrm_handle) libdrm_handle = dlopen("libdrm.so.2", RTLD_LAZY); if (!libdrm_handle) libdrm_handle = dlopen("libdrm.so.1", RTLD_LAZY); if (!libdrm_handle) { local_error_string = dlerror(); return false; } _drmGetDevices2 = dlsym(libdrm_handle, "drmGetDevices2"); if (!_drmGetDevices2) _drmGetDevices = dlsym(libdrm_handle, "drmGetDevices"); if (!_drmGetDevices2 && !_drmGetDevices) goto init_error_clean_exit; _drmFreeDevices = dlsym(libdrm_handle, "drmFreeDevices"); if (!_drmFreeDevices) goto init_error_clean_exit; _drmGetVersion = dlsym(libdrm_handle, "drmGetVersion"); if (!_drmGetVersion) goto init_error_clean_exit; _drmFreeVersion = dlsym(libdrm_handle, "drmFreeVersion"); if (!_drmFreeVersion) goto init_error_clean_exit; _drmGetMagic = dlsym(libdrm_handle, "drmGetMagic"); if (!_drmGetMagic) goto init_error_clean_exit; _drmAuthMagic = dlsym(libdrm_handle, "drmAuthMagic"); if (!_drmAuthMagic) goto init_error_clean_exit; _drmDropMaster = dlsym(libdrm_handle, "drmDropMaster"); if (!_drmDropMaster) goto init_error_clean_exit; libdrm_amdgpu_handle = dlopen("libdrm_amdgpu.so", RTLD_LAZY); if (!libdrm_amdgpu_handle) libdrm_amdgpu_handle = dlopen("libdrm_amdgpu.so.1", RTLD_LAZY); if (libdrm_amdgpu_handle) { _amdgpu_device_initialize = dlsym(libdrm_amdgpu_handle, "amdgpu_device_initialize"); _amdgpu_device_deinitialize = dlsym(libdrm_amdgpu_handle, "amdgpu_device_deinitialize"); _amdgpu_get_marketing_name = dlsym(libdrm_amdgpu_handle, "amdgpu_get_marketing_name"); _amdgpu_query_info = dlsym(libdrm_amdgpu_handle, "amdgpu_query_info"); _amdgpu_query_gpu_info = dlsym(libdrm_amdgpu_handle, "amdgpu_query_gpu_info"); _amdgpu_query_sensor_info = dlsym(libdrm_amdgpu_handle, "amdgpu_query_sensor_info"); } local_error_string = NULL; return true; init_error_clean_exit: dlclose(libdrm_handle); libdrm_handle = NULL; return false; } static void gpuinfo_amdgpu_shutdown(void) { for (unsigned i = 0; i < amdgpu_count; ++i) { struct gpu_info_amdgpu *gpu_info = &gpu_infos[i]; if (gpu_info->fanSpeedFILE) fclose(gpu_info->fanSpeedFILE); if (gpu_info->PCIeBW) fclose(gpu_info->PCIeBW); if (gpu_info->powerCap) fclose(gpu_info->powerCap); nvtop_device_unref(gpu_info->amdgpuDevice); nvtop_device_unref(gpu_info->hwmonDevice); _drmFreeVersion(gpu_info->drmVersion); _amdgpu_device_deinitialize(gpu_info->amdgpu_device); // Clean the process cache struct amdgpu_process_info_cache *cache_entry, *cache_tmp; HASH_ITER(hh, gpu_info->last_update_process_cache, cache_entry, cache_tmp) { HASH_DEL(gpu_info->last_update_process_cache, cache_entry); free(cache_entry); } } free(gpu_infos); gpu_infos = NULL; amdgpu_count = 0; if (libdrm_handle) { dlclose(libdrm_handle); libdrm_handle = NULL; local_error_string = didnt_call_gpuinfo_init; } if (libdrm_amdgpu_handle) { dlclose(libdrm_amdgpu_handle); libdrm_amdgpu_handle = NULL; } } static const char *gpuinfo_amdgpu_last_error_string(void) { if (local_error_string) { return local_error_string; } else if (last_libdrm_return_status < 0) { switch (last_libdrm_return_status) { case DRM_ERR_NO_DEVICE: return "no device\n"; case DRM_ERR_NO_ACCESS: return "no access\n"; case DRM_ERR_NOT_ROOT: return "not root\n"; case DRM_ERR_INVALID: return "invalid args\n"; case DRM_ERR_NO_FD: return "no fd\n"; default: return "unknown error\n"; } } else { return "An unanticipated error occurred while accessing AMDGPU " "information\n"; } } static void authenticate_drm(int fd) { drm_magic_t magic; if (_drmGetMagic(fd, &magic) < 0) { return; } if (_drmAuthMagic(fd, magic) == 0) { if (_drmDropMaster(fd)) { perror("Failed to drop DRM master"); fprintf( stderr, "\nWARNING: other DRM clients will crash on VT switch while nvtop is running!\npress ENTER to continue\n"); fgetc(stdin); } return; } // XXX: Ideally I'd implement this too, but I'd need to pull in libxcb and yet // more functions and structs that may break ABI compatibility. // See radeontop auth_xcb.c for what is involved here fprintf(stderr, "Failed to authenticate to DRM; XCB authentication unimplemented\n"); } static void initDeviceSysfsPaths(struct gpu_info_amdgpu *gpu_info) { // Open the device sys folder to gather information not available through the DRM driver char devicePath[22 + PDEV_LEN]; snprintf(devicePath, sizeof(devicePath), "/sys/bus/pci/devices/%s", gpu_info->base.pdev); nvtop_device_new_from_syspath(&gpu_info->amdgpuDevice, devicePath); assert(gpu_info->amdgpuDevice != NULL); int sysfsFD = open(devicePath, O_RDONLY); gpu_info->hwmonDevice = nvtop_device_get_hwmon(gpu_info->amdgpuDevice); assert(gpu_info->hwmonDevice != NULL); // Open the device hwmon folder (Fan speed are available there) const char *hwmonPath; nvtop_device_get_syspath(gpu_info->hwmonDevice, &hwmonPath); int hwmonFD = open(hwmonPath, O_RDONLY); // Look for which fan to use (PWM or RPM) gpu_info->fanSpeedFILE = NULL; unsigned pwmIsEnabled; int NreadPatterns = readAttributeFromDevice(gpu_info->hwmonDevice, "pwm1_enable", "%u", &pwmIsEnabled); bool usePWMSensor = NreadPatterns == 1 && pwmIsEnabled > 0; bool useRPMSensor = false; if (!usePWMSensor) { unsigned rpmIsEnabled; NreadPatterns = readAttributeFromDevice(gpu_info->hwmonDevice, "fan1_enable", "%u", &rpmIsEnabled); useRPMSensor = NreadPatterns && rpmIsEnabled > 0; } // Either RPM or PWM or neither assert((useRPMSensor ^ usePWMSensor) || (!useRPMSensor && !usePWMSensor)); if (usePWMSensor || useRPMSensor) { char *maxFanSpeedFile = usePWMSensor ? "pwm1_max" : "fan1_max"; char *fanSensorFile = usePWMSensor ? "pwm1" : "fan1_input"; unsigned maxSpeedVal; NreadPatterns = readAttributeFromDevice(gpu_info->hwmonDevice, maxFanSpeedFile, "%u", &maxSpeedVal); if (NreadPatterns == 1) { gpu_info->maxFanValue = maxSpeedVal; // Open the fan file for dynamic info gathering int fanSpeedFD = openat(hwmonFD, fanSensorFile, O_RDONLY); if (fanSpeedFD >= 0) { gpu_info->fanSpeedFILE = fdopen(fanSpeedFD, "r"); if (!gpu_info->fanSpeedFILE) close(fanSpeedFD); } } } // Open the PCIe bandwidth file for dynamic info gathering gpu_info->PCIeBW = NULL; int pcieBWFD = openat(sysfsFD, "pcie_bw", O_RDONLY); if (pcieBWFD) { gpu_info->PCIeBW = fdopen(pcieBWFD, "r"); } // Open the power cap file for dynamic info gathering gpu_info->powerCap = NULL; int powerCapFD = openat(hwmonFD, "power1_cap", O_RDONLY); if (powerCapFD) { gpu_info->powerCap = fdopen(powerCapFD, "r"); } close(hwmonFD); close(sysfsFD); } #define VENDOR_AMD 0x1002 static bool gpuinfo_amdgpu_get_device_handles(struct list_head *devices, unsigned *count) { if (!libdrm_handle) return false; last_libdrm_return_status = wrap_drmGetDevices(NULL, 0); if (last_libdrm_return_status <= 0) return false; drmDevicePtr devs[last_libdrm_return_status]; last_libdrm_return_status = wrap_drmGetDevices(devs, last_libdrm_return_status); if (last_libdrm_return_status <= 0) return false; unsigned int libdrm_count = last_libdrm_return_status; gpu_infos = calloc(libdrm_count, sizeof(*gpu_infos)); if (!gpu_infos) { local_error_string = strerror(errno); return false; } for (unsigned int i = 0; i < libdrm_count; i++) { if (devs[i]->bustype != DRM_BUS_PCI || devs[i]->deviceinfo.pci->vendor_id != VENDOR_AMD) continue; int fd = -1; // Try render node first if (1 << DRM_NODE_RENDER & devs[i]->available_nodes) { fd = open(devs[i]->nodes[DRM_NODE_RENDER], O_RDWR); } if (fd < 0) { // Fallback to primary node (control nodes are unused according to the DRM documentation) if (1 << DRM_NODE_PRIMARY & devs[i]->available_nodes) { fd = open(devs[i]->nodes[DRM_NODE_PRIMARY], O_RDWR); } } if (fd < 0) continue; drmVersionPtr ver = _drmGetVersion(fd); if (!ver) { close(fd); continue; } bool is_radeon = false; // TODO: !strcmp(ver->name, "radeon"); bool is_amdgpu = !strcmp(ver->name, "amdgpu"); if (!is_amdgpu && !is_radeon) { _drmFreeVersion(ver); close(fd); continue; } authenticate_drm(fd); if (is_amdgpu) { if (!libdrm_amdgpu_handle || !_amdgpu_device_initialize) { _drmFreeVersion(ver); close(fd); continue; } uint32_t drm_major, drm_minor; last_libdrm_return_status = _amdgpu_device_initialize(fd, &drm_major, &drm_minor, &gpu_infos[amdgpu_count].amdgpu_device); } else { // TODO: radeon suppport here assert(false); } if (!last_libdrm_return_status) { gpu_infos[amdgpu_count].drmVersion = ver; gpu_infos[amdgpu_count].fd = fd; gpu_infos[amdgpu_count].base.vendor = &gpu_vendor_amdgpu; snprintf(gpu_infos[amdgpu_count].base.pdev, PDEV_LEN - 1, "%04x:%02x:%02x.%d", devs[i]->businfo.pci->domain, devs[i]->businfo.pci->bus, devs[i]->businfo.pci->dev, devs[i]->businfo.pci->func); initDeviceSysfsPaths(&gpu_infos[amdgpu_count]); list_add_tail(&gpu_infos[amdgpu_count].base.list, devices); // Register a fdinfo callback for this GPU processinfo_register_fdinfo_callback(parse_drm_fdinfo_amd, &gpu_infos[amdgpu_count].base); amdgpu_count++; } else { _drmFreeVersion(ver); close(fd); continue; } } _drmFreeDevices(devs, libdrm_count); *count = amdgpu_count; return true; } static int rewindAndReadPattern(FILE *file, const char *format, ...) { if (!file) return 0; va_list args; va_start(args, format); rewind(file); fflush(file); int matches = vfscanf(file, format, args); va_end(args); return matches; } static int readAttributeFromDevice(nvtop_device *dev, const char *sysAttr, const char *format, ...) { va_list args; va_start(args, format); const char *val; int ret = nvtop_device_get_sysattr_value(dev, sysAttr, &val); if (ret < 0) return ret; // Read the pattern int nread = vsscanf(val, format, args); va_end(args); return nread; } static void gpuinfo_amdgpu_populate_static_info(struct gpu_info *_gpu_info) { struct gpu_info_amdgpu *gpu_info = container_of(_gpu_info, struct gpu_info_amdgpu, base); struct gpuinfo_static_info *static_info = &gpu_info->base.static_info; bool info_query_success = false; struct amdgpu_gpu_info info; const char *name = NULL; static_info->integrated_graphics = false; RESET_ALL(static_info->valid); if (libdrm_amdgpu_handle && _amdgpu_get_marketing_name) name = _amdgpu_get_marketing_name(gpu_info->amdgpu_device); if (libdrm_amdgpu_handle && _amdgpu_query_gpu_info) info_query_success = !_amdgpu_query_gpu_info(gpu_info->amdgpu_device, &info); /* check name again. * the previous name is from libdrm, which may not be the latest version. * it may not contain latest AMD GPU types/names * * the libdrm is from vendor, Linux and a Linux distribution. * It may take long time for a Linux distribution to get latest GPU info. * here a GPU IDS is maintained, which allows to support GPU info faster. */ if (!name) { name = amdgpu_parse_marketing_name(&info); } static_info->device_name[MAX_DEVICE_NAME - 1] = '\0'; if (name && strlen(name)) { strncpy(static_info->device_name, name, MAX_DEVICE_NAME - 1); SET_VALID(gpuinfo_device_name_valid, static_info->valid); } else if (gpu_info->drmVersion->desc && strlen(gpu_info->drmVersion->desc)) { strncpy(static_info->device_name, gpu_info->drmVersion->desc, MAX_DEVICE_NAME - 1); SET_VALID(gpuinfo_device_name_valid, static_info->valid); if (info_query_success) { size_t len = strlen(static_info->device_name); assert(len < MAX_DEVICE_NAME); char *dst = static_info->device_name + len; size_t remaining_len = MAX_DEVICE_NAME - 1 - len; switch (info.family_id) { #ifdef AMDGPU_FAMILY_SI case AMDGPU_FAMILY_SI: strncpy(dst, " (Hainan / Oland / Verde / Pitcairn / Tahiti)", remaining_len); break; #endif #ifdef AMDGPU_FAMILY_CI case AMDGPU_FAMILY_CI: strncpy(dst, " (Bonaire / Hawaii)", remaining_len); break; #endif #ifdef AMDGPU_FAMILY_KV case AMDGPU_FAMILY_KV: strncpy(dst, " (Kaveri / Kabini / Mullins)", remaining_len); break; #endif #ifdef AMDGPU_FAMILY_VI case AMDGPU_FAMILY_VI: strncpy(dst, " (Iceland / Tonga)", remaining_len); break; #endif #ifdef AMDGPU_FAMILY_CZ case AMDGPU_FAMILY_CZ: strncpy(dst, " (Carrizo / Stoney)", remaining_len); break; #endif #ifdef AMDGPU_FAMILY_AI case AMDGPU_FAMILY_AI: strncpy(dst, " (Vega10)", remaining_len); break; #endif #ifdef AMDGPU_FAMILY_RV case AMDGPU_FAMILY_RV: strncpy(dst, " (Raven)", remaining_len); break; #endif #ifdef AMDGPU_FAMILY_NV case AMDGPU_FAMILY_NV: strncpy(dst, " (Navi10)", remaining_len); break; #endif #ifdef AMDGPU_FAMILY_VGH case AMDGPU_FAMILY_VGH: strncpy(dst, " (Van Gogh)", remaining_len); break; #endif #ifdef AMDGPU_FAMILY_YC case AMDGPU_FAMILY_YC: strncpy(dst, " (Yellow Carp)", remaining_len); break; #endif default: break; } } } // Retrieve infos from sysfs. // 1) Fan // If multiple fans are present, use the first one. Some hardware do not wire // the sensor for the second fan, or use the same value as the first fan. // Critical temparature // temp1_* files should always be the GPU die in millidegrees Celsius unsigned criticalTemp; int NreadPatterns = readAttributeFromDevice(gpu_info->hwmonDevice, "temp1_crit", "%u", &criticalTemp); if (NreadPatterns == 1) { SET_GPUINFO_STATIC(static_info, temperature_slowdown_threshold, criticalTemp); } // Emergency/shutdown temparature unsigned emergemcyTemp; NreadPatterns = readAttributeFromDevice(gpu_info->hwmonDevice, "temp1_emergency", "%u", &emergemcyTemp); if (NreadPatterns == 1) { SET_GPUINFO_STATIC(static_info, temperature_shutdown_threshold, emergemcyTemp); } nvtop_pcie_link max_link_characteristics; int ret = nvtop_device_maximum_pcie_link(gpu_info->amdgpuDevice, &max_link_characteristics); if (ret >= 0) { SET_GPUINFO_STATIC(static_info, max_pcie_link_width, max_link_characteristics.width); unsigned pcieGen = nvtop_pcie_gen_from_link_speed(max_link_characteristics.speed); SET_GPUINFO_STATIC(static_info, max_pcie_gen, pcieGen); } // Mark integrated graphics if (info_query_success && (info.ids_flags & AMDGPU_IDS_FLAGS_FUSION)) { static_info->integrated_graphics = true; } } static void gpuinfo_amdgpu_refresh_dynamic_info(struct gpu_info *_gpu_info) { struct gpu_info_amdgpu *gpu_info = container_of(_gpu_info, struct gpu_info_amdgpu, base); struct gpuinfo_dynamic_info *dynamic_info = &gpu_info->base.dynamic_info; bool info_query_success = false; struct amdgpu_gpu_info info; uint32_t out32; RESET_ALL(dynamic_info->valid); dynamic_info->encode_decode_shared = false; if (libdrm_amdgpu_handle && _amdgpu_query_gpu_info) info_query_success = !_amdgpu_query_gpu_info(gpu_info->amdgpu_device, &info); // GPU current speed if (libdrm_amdgpu_handle && _amdgpu_query_sensor_info) last_libdrm_return_status = _amdgpu_query_sensor_info(gpu_info->amdgpu_device, AMDGPU_INFO_SENSOR_GFX_SCLK, sizeof(out32), &out32); else last_libdrm_return_status = 1; if (!last_libdrm_return_status) { SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed, out32); } // GPU max speed if (info_query_success) { SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed_max, info.max_engine_clk / 1000); } // Memory current speed if (libdrm_amdgpu_handle && _amdgpu_query_sensor_info) last_libdrm_return_status = _amdgpu_query_sensor_info(gpu_info->amdgpu_device, AMDGPU_INFO_SENSOR_GFX_MCLK, sizeof(out32), &out32); else last_libdrm_return_status = 1; if (!last_libdrm_return_status) { SET_GPUINFO_DYNAMIC(dynamic_info, mem_clock_speed, out32); } // Memory max speed if (info_query_success) { SET_GPUINFO_DYNAMIC(dynamic_info, mem_clock_speed_max, info.max_memory_clk / 1000); } // Load if (libdrm_amdgpu_handle && _amdgpu_query_sensor_info) last_libdrm_return_status = _amdgpu_query_sensor_info(gpu_info->amdgpu_device, AMDGPU_INFO_SENSOR_GPU_LOAD, sizeof(out32), &out32); else last_libdrm_return_status = 1; if (!last_libdrm_return_status) { SET_GPUINFO_DYNAMIC(dynamic_info, gpu_util_rate, out32); } // Memory usage struct drm_amdgpu_memory_info memory_info; if (libdrm_amdgpu_handle && _amdgpu_query_info) last_libdrm_return_status = _amdgpu_query_info(gpu_info->amdgpu_device, AMDGPU_INFO_MEMORY, sizeof(memory_info), &memory_info); else last_libdrm_return_status = 1; if (!last_libdrm_return_status) { // TODO: Determine if we want to include GTT (GPU accessible system memory) SET_GPUINFO_DYNAMIC(dynamic_info, total_memory, memory_info.vram.total_heap_size); SET_GPUINFO_DYNAMIC(dynamic_info, used_memory, memory_info.vram.heap_usage); SET_GPUINFO_DYNAMIC(dynamic_info, free_memory, memory_info.vram.usable_heap_size - dynamic_info->used_memory); SET_GPUINFO_DYNAMIC(dynamic_info, mem_util_rate, (dynamic_info->total_memory - dynamic_info->free_memory) * 100 / dynamic_info->total_memory); } // GPU temperature if (libdrm_amdgpu_handle && _amdgpu_query_sensor_info) last_libdrm_return_status = _amdgpu_query_sensor_info(gpu_info->amdgpu_device, AMDGPU_INFO_SENSOR_GPU_TEMP, sizeof(out32), &out32); else last_libdrm_return_status = 1; if (!last_libdrm_return_status) { SET_GPUINFO_DYNAMIC(dynamic_info, gpu_temp, out32 / 1000); } // Fan speed unsigned currentFanSpeed; int patternsMatched = rewindAndReadPattern(gpu_info->fanSpeedFILE, "%u", ¤tFanSpeed); if (patternsMatched == 1) { SET_GPUINFO_DYNAMIC(dynamic_info, fan_speed, currentFanSpeed * 100 / gpu_info->maxFanValue); } // Device power usage if (libdrm_amdgpu_handle && _amdgpu_query_sensor_info) last_libdrm_return_status = _amdgpu_query_sensor_info(gpu_info->amdgpu_device, AMDGPU_INFO_SENSOR_GPU_AVG_POWER, sizeof(out32), &out32); else last_libdrm_return_status = 1; if (!last_libdrm_return_status) { SET_GPUINFO_DYNAMIC(dynamic_info, power_draw, out32 * 1000); } nvtop_pcie_link curr_link_characteristics; int ret = nvtop_device_current_pcie_link(gpu_info->amdgpuDevice, &curr_link_characteristics); if (ret >= 0) { SET_GPUINFO_DYNAMIC(dynamic_info, pcie_link_width, curr_link_characteristics.width); unsigned pcieGen = nvtop_pcie_gen_from_link_speed(curr_link_characteristics.speed); SET_GPUINFO_DYNAMIC(dynamic_info, pcie_link_gen, pcieGen); } // PCIe bandwidth if (gpu_info->PCIeBW) { // According to https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/pm/amdgpu_pm.c, under the pcie_bw // section, we should be able to read the number of packets received and sent by the GPU and get the maximum payload // size during the last second. This is untested but should work when the file is populated by the driver. uint64_t received, transmitted; int maxPayloadSize; int NreadPatterns = rewindAndReadPattern(gpu_info->PCIeBW, "%" SCNu64 " %" SCNu64 " %i", &received, &transmitted, &maxPayloadSize); if (NreadPatterns == 3) { // Compute received/transmitter in KiB received *= maxPayloadSize / 1024; transmitted *= maxPayloadSize / 1024; SET_GPUINFO_DYNAMIC(dynamic_info, pcie_rx, received); SET_GPUINFO_DYNAMIC(dynamic_info, pcie_tx, transmitted); } } if (gpu_info->powerCap) { // The power cap in microwatts unsigned powerCap; int NreadPatterns = rewindAndReadPattern(gpu_info->powerCap, "%u", &powerCap); if (NreadPatterns == 1) { SET_GPUINFO_DYNAMIC(dynamic_info, power_draw_max, powerCap / 1000); } } } static const char drm_amdgpu_pdev_old[] = "pdev"; static const char drm_amdgpu_vram_old[] = "vram mem"; static const char drm_amdgpu_vram[] = "drm-memory-vram"; static const char drm_amdgpu_gfx_old[] = "gfx"; static const char drm_amdgpu_gfx[] = "drm-engine-gfx"; static const char drm_amdgpu_compute_old[] = "compute"; static const char drm_amdgpu_compute[] = "drm-engine-compute"; static const char drm_amdgpu_dec_old[] = "dec"; static const char drm_amdgpu_dec[] = "drm-engine-dec"; static const char drm_amdgpu_enc_old[] = "enc"; static const char drm_amdgpu_enc[] = "drm-engine-enc"; static bool parse_drm_fdinfo_amd(struct gpu_info *info, FILE *fdinfo_file, struct gpu_process *process_info) { struct gpu_info_amdgpu *gpu_info = container_of(info, struct gpu_info_amdgpu, base); static char *line = NULL; static size_t line_buf_size = 0; ssize_t count = 0; bool client_id_set = false; unsigned cid; nvtop_time current_time; nvtop_get_current_time(¤t_time); while ((count = getline(&line, &line_buf_size, fdinfo_file)) != -1) { char *key, *val; // Get rid of the newline if present if (line[count - 1] == '\n') { line[--count] = '\0'; } if (!extract_drm_fdinfo_key_value(line, &key, &val)) continue; // see drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c amdgpu_show_fdinfo() if (!strcmp(key, drm_amdgpu_pdev_old) || !strcmp(key, drm_pdev)) { if (strcmp(val, gpu_info->base.pdev)) { return false; } } else if (!strcmp(key, drm_client_id)) { // Client id is a unique identifier. From the DRM documentation "Unique value relating to the open DRM // file descriptor used to distinguish duplicated and shared file descriptors. Conceptually the value should map // 1:1 to the in kernel representation of struct drm_file instances." // This information is available for the AMDGPU driver shipping with // the kernel >= 5.19. We still have to use the kcmp syscall to // distinguish duplicated file descriptors for older kernels. char *endptr; cid = strtoul(val, &endptr, 10); if (*endptr) continue; client_id_set = true; } else if (!strcmp(key, drm_amdgpu_vram_old) || !strcmp(key, drm_amdgpu_vram)) { // TODO: do we count "gtt mem" too? unsigned long mem_int; char *endptr; mem_int = strtoul(val, &endptr, 10); if (endptr == val || (strcmp(endptr, " kB") && strcmp(endptr, " KiB"))) continue; SET_GPUINFO_PROCESS(process_info, gpu_memory_usage, mem_int * 1024); } else { bool is_gfx_old = !strncmp(key, drm_amdgpu_gfx_old, sizeof(drm_amdgpu_gfx_old) - 1); bool is_compute_old = !strncmp(key, drm_amdgpu_compute_old, sizeof(drm_amdgpu_compute_old) - 1); bool is_dec_old = !strncmp(key, drm_amdgpu_dec_old, sizeof(drm_amdgpu_dec_old) - 1); bool is_enc_old = !strncmp(key, drm_amdgpu_enc_old, sizeof(drm_amdgpu_enc_old) - 1); bool is_gfx_new = !strncmp(key, drm_amdgpu_gfx, sizeof(drm_amdgpu_gfx) - 1); bool is_dec_new = !strncmp(key, drm_amdgpu_dec, sizeof(drm_amdgpu_dec) - 1); bool is_enc_new = !strncmp(key, drm_amdgpu_enc, sizeof(drm_amdgpu_enc) - 1); bool is_compute_new = !strncmp(key, drm_amdgpu_compute, sizeof(drm_amdgpu_compute) - 1); if (is_gfx_old || is_compute_old || is_dec_old || is_enc_old) { // The old interface exposes a usage percentage with an unknown update interval unsigned int usage_percent_int; char *key_off, *endptr; double usage_percent; if (is_gfx_old) key_off = key + sizeof(drm_amdgpu_gfx_old) - 1; else if (is_compute_old) key_off = key + sizeof(drm_amdgpu_compute_old) - 1; else if (is_dec_old) key_off = key + sizeof(drm_amdgpu_dec_old) - 1; else if (is_enc_old) key_off = key + sizeof(drm_amdgpu_enc_old) - 1; else continue; // The prefix should be followed by a number and only a number if (!*key_off) continue; strtoul(key_off, &endptr, 10); if (*endptr) continue; usage_percent_int = (unsigned int)(usage_percent = round(strtod(val, &endptr))); if (endptr == val || strcmp(endptr, "%")) continue; if (is_gfx_old) { process_info->type |= gpu_process_graphical; SET_GPUINFO_PROCESS(process_info, gpu_usage, process_info->gpu_usage + usage_percent_int); } else if (is_compute_old) { process_info->type |= gpu_process_compute; SET_GPUINFO_PROCESS(process_info, gpu_usage, process_info->gpu_usage + usage_percent_int); } else if (is_dec_old) { SET_GPUINFO_PROCESS(process_info, decode_usage, process_info->decode_usage + usage_percent_int); } else if (is_enc_old) { SET_GPUINFO_PROCESS(process_info, encode_usage, process_info->encode_usage + usage_percent_int); } } else if (is_gfx_new || is_compute_new || is_dec_new || is_enc_new) { char *endptr; uint64_t time_spent = strtoull(val, &endptr, 10); if (endptr == val || strcmp(endptr, " ns")) continue; if (is_gfx_new) { process_info->type |= gpu_process_graphical; SET_GPUINFO_PROCESS(process_info, gfx_engine_used, time_spent); } else if (is_compute_new) { process_info->type |= gpu_process_compute; SET_GPUINFO_PROCESS(process_info, compute_engine_used, time_spent); } else if (is_enc_new) { SET_GPUINFO_PROCESS(process_info, enc_engine_used, time_spent); } else if (is_dec_new) { SET_GPUINFO_PROCESS(process_info, dec_engine_used, time_spent); } } } } // The AMDGPU fdinfo interface in kernels >=5.19 is way nicer; it provides the // cumulative GPU engines (e.g., gfx, enc, dec) usage in nanoseconds. // Previously, we displayed the usage provided in fdinfo by the kernel/driver // which uses an internal update interval. Now, we can compute an accurate // busy percentage since the last measurement. if (client_id_set) { struct amdgpu_process_info_cache *cache_entry; struct unique_cache_id ucid = {.client_id = cid, .pid = process_info->pid, .pdev = gpu_info->base.pdev}; HASH_FIND_CLIENT(gpu_info->last_update_process_cache, &ucid, cache_entry); if (cache_entry) { uint64_t time_elapsed = nvtop_difftime_u64(cache_entry->last_measurement_tstamp, current_time); HASH_DEL(gpu_info->last_update_process_cache, cache_entry); if (GPUINFO_PROCESS_FIELD_VALID(process_info, gfx_engine_used) && AMDGPU_CACHE_FIELD_VALID(cache_entry, gfx_engine_used) && // In some rare occasions, the gfx engine usage reported by the driver is lowering (might be a driver bug) process_info->gfx_engine_used >= cache_entry->gfx_engine_used && process_info->gfx_engine_used - cache_entry->gfx_engine_used <= time_elapsed) { SET_GPUINFO_PROCESS(process_info, gpu_usage, busy_usage_from_time_usage_round(process_info->gfx_engine_used, cache_entry->gfx_engine_used, time_elapsed)); } if (GPUINFO_PROCESS_FIELD_VALID(process_info, compute_engine_used) && AMDGPU_CACHE_FIELD_VALID(cache_entry, compute_engine_used) && process_info->compute_engine_used >= cache_entry->compute_engine_used && process_info->compute_engine_used - cache_entry->compute_engine_used <= time_elapsed) { unsigned gfx_usage = GPUINFO_PROCESS_FIELD_VALID(process_info, gpu_usage) ? process_info->gpu_usage : 0; SET_GPUINFO_PROCESS(process_info, gpu_usage, gfx_usage + busy_usage_from_time_usage_round(process_info->compute_engine_used, cache_entry->compute_engine_used, time_elapsed)); } if (GPUINFO_PROCESS_FIELD_VALID(process_info, dec_engine_used) && AMDGPU_CACHE_FIELD_VALID(cache_entry, dec_engine_used) && process_info->dec_engine_used >= cache_entry->dec_engine_used && process_info->dec_engine_used - cache_entry->dec_engine_used <= time_elapsed) { SET_GPUINFO_PROCESS(process_info, decode_usage, busy_usage_from_time_usage_round(process_info->dec_engine_used, cache_entry->dec_engine_used, time_elapsed)); } if (GPUINFO_PROCESS_FIELD_VALID(process_info, enc_engine_used) && AMDGPU_CACHE_FIELD_VALID(cache_entry, enc_engine_used) && process_info->enc_engine_used >= cache_entry->enc_engine_used && process_info->enc_engine_used - cache_entry->enc_engine_used <= time_elapsed) { SET_GPUINFO_PROCESS(process_info, encode_usage, busy_usage_from_time_usage_round(process_info->enc_engine_used, cache_entry->enc_engine_used, time_elapsed)); } } else { cache_entry = calloc(1, sizeof(*cache_entry)); if (!cache_entry) goto parse_fdinfo_exit; cache_entry->client_id.client_id = cid; cache_entry->client_id.pid = process_info->pid; cache_entry->client_id.pdev = gpu_info->base.pdev; } #ifndef NDEBUG // We should only process one fdinfo entry per client id per update struct amdgpu_process_info_cache *cache_entry_check; HASH_FIND_CLIENT(gpu_info->current_update_process_cache, &cid, cache_entry_check); assert(!cache_entry_check && "We should not be processing a client id twice per update"); #endif // Store this measurement data RESET_ALL(cache_entry->valid); if (GPUINFO_PROCESS_FIELD_VALID(process_info, gfx_engine_used)) SET_AMDGPU_CACHE(cache_entry, gfx_engine_used, process_info->gfx_engine_used); if (GPUINFO_PROCESS_FIELD_VALID(process_info, compute_engine_used)) SET_AMDGPU_CACHE(cache_entry, compute_engine_used, process_info->compute_engine_used); if (GPUINFO_PROCESS_FIELD_VALID(process_info, dec_engine_used)) SET_AMDGPU_CACHE(cache_entry, dec_engine_used, process_info->dec_engine_used); if (GPUINFO_PROCESS_FIELD_VALID(process_info, enc_engine_used)) SET_AMDGPU_CACHE(cache_entry, enc_engine_used, process_info->enc_engine_used); cache_entry->last_measurement_tstamp = current_time; HASH_ADD_CLIENT(gpu_info->current_update_process_cache, cache_entry); } parse_fdinfo_exit: return true; } static void swap_process_cache_for_next_update(struct gpu_info_amdgpu *gpu_info) { // Free old cache data and set the cache for the next update if (gpu_info->last_update_process_cache) { struct amdgpu_process_info_cache *cache_entry, *tmp; HASH_ITER(hh, gpu_info->last_update_process_cache, cache_entry, tmp) { HASH_DEL(gpu_info->last_update_process_cache, cache_entry); free(cache_entry); } } gpu_info->last_update_process_cache = gpu_info->current_update_process_cache; gpu_info->current_update_process_cache = NULL; } static void gpuinfo_amdgpu_get_running_processes(struct gpu_info *_gpu_info) { // For AMDGPU, we register a fdinfo callback that will fill the gpu_process datastructure of the gpu_info structure // for us. This avoids going through /proc multiple times per update for multiple GPUs. struct gpu_info_amdgpu *gpu_info = container_of(_gpu_info, struct gpu_info_amdgpu, base); swap_process_cache_for_next_update(gpu_info); } nvtop-3.0.2/src/extract_gpuinfo_amdgpu_utils.c000066400000000000000000000014411444130114000215630ustar00rootroot00000000000000/* * Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. * * MIT License. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "amdgpu_ids.h" const char * amdgpu_parse_marketing_name(struct amdgpu_gpu_info *info) { int i; int ntypes = sizeof(amdgpu_ids) / sizeof(amdgpu_ids[0]); if (!info) return NULL; for (i = 0; i < ntypes; i++) { if (info->asic_id == amdgpu_ids[i].asic_id && info->pci_rev_id == amdgpu_ids[i].pci_rev_id) { return amdgpu_ids[i].name; } } return NULL; } nvtop-3.0.2/src/extract_gpuinfo_intel.c000066400000000000000000000412261444130114000202060ustar00rootroot00000000000000/* * * Copyright (C) 2022 Maxime Schmitt * * This file is part of Nvtop and adapted from igt-gpu-tools from Intel Corporation. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/device_discovery.h" #include "nvtop/extract_gpuinfo_common.h" #include "nvtop/extract_processinfo_fdinfo.h" #include "nvtop/time.h" #include #include #include #include #define HASH_FIND_CLIENT(head, key_ptr, out_ptr) HASH_FIND(hh, head, key_ptr, sizeof(unsigned), out_ptr) #define HASH_ADD_CLIENT(head, in_ptr) HASH_ADD(hh, head, client_id, sizeof(unsigned), in_ptr) #define SET_INTEL_CACHE(cachePtr, field, value) SET_VALUE(cachePtr, field, value, intel_cache_) #define RESET_INTEL_CACHE(cachePtr, field) INVALIDATE_VALUE(cachePtr, field, intel_cache_) #define INTEL_CACHE_FIELD_VALID(cachePtr, field) VALUE_IS_VALID(cachePtr, field, intel_cache_) enum intel_process_info_cache_valid { intel_cache_engine_render_valid = 0, intel_cache_engine_copy_valid, intel_cache_engine_video_valid, intel_cache_engine_video_enhance_valid, intel_cache_process_info_cache_valid_count }; struct __attribute__((__packed__)) unique_cache_id { unsigned client_id; pid_t pid; char *pdev; }; struct intel_process_info_cache { struct unique_cache_id client_id; uint64_t engine_render; uint64_t engine_copy; uint64_t engine_video; uint64_t engine_video_enhance; nvtop_time last_measurement_tstamp; unsigned char valid[(intel_cache_process_info_cache_valid_count + CHAR_BIT - 1) / CHAR_BIT]; UT_hash_handle hh; }; struct gpu_info_intel { struct gpu_info base; struct nvtop_device *card_device; struct nvtop_device *driver_device; struct intel_process_info_cache *last_update_process_cache, *current_update_process_cache; // Cached processes info }; static bool gpuinfo_intel_init(void); static void gpuinfo_intel_shutdown(void); static const char *gpuinfo_intel_last_error_string(void); static bool gpuinfo_intel_get_device_handles(struct list_head *devices, unsigned *count); static void gpuinfo_intel_populate_static_info(struct gpu_info *_gpu_info); static void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info); static void gpuinfo_intel_get_running_processes(struct gpu_info *_gpu_info); struct gpu_vendor gpu_vendor_intel = { .init = gpuinfo_intel_init, .shutdown = gpuinfo_intel_shutdown, .last_error_string = gpuinfo_intel_last_error_string, .get_device_handles = gpuinfo_intel_get_device_handles, .populate_static_info = gpuinfo_intel_populate_static_info, .refresh_dynamic_info = gpuinfo_intel_refresh_dynamic_info, .refresh_running_processes = gpuinfo_intel_get_running_processes, .name = "Intel", }; unsigned intel_gpu_count; static struct gpu_info_intel *gpu_infos; #define STRINGIFY(x) STRINGIFY_HELPER_(x) #define STRINGIFY_HELPER_(x) #x #define VENDOR_INTEL 0x8086 #define VENDOR_INTEL_STR STRINGIFY(VENDOR_INTEL) // The integrated Intel GPU is always this device // Discrete GPU are others #define INTEGRATED_I915_GPU_PCI_ID "0000:00:02.0" __attribute__((constructor)) static void init_extract_gpuinfo_intel(void) { register_gpu_vendor(&gpu_vendor_intel); } bool gpuinfo_intel_init(void) { return true; } void gpuinfo_intel_shutdown(void) { for (unsigned i = 0; i < intel_gpu_count; ++i) { struct gpu_info_intel *current = &gpu_infos[i]; nvtop_device_unref(current->card_device); nvtop_device_unref(current->driver_device); } } const char *gpuinfo_intel_last_error_string(void) { return "Err"; } static const char drm_intel_render[] = "drm-engine-render"; static const char drm_intel_copy[] = "drm-engine-copy"; static const char drm_intel_video[] = "drm-engine-video"; static const char drm_intel_video_enhance[] = "drm-engine-video-enhance"; static bool parse_drm_fdinfo_intel(struct gpu_info *info, FILE *fdinfo_file, struct gpu_process *process_info) { struct gpu_info_intel *gpu_info = container_of(info, struct gpu_info_intel, base); static char *line = NULL; static size_t line_buf_size = 0; ssize_t count = 0; bool client_id_set = false; unsigned cid; nvtop_time current_time; nvtop_get_current_time(¤t_time); while ((count = getline(&line, &line_buf_size, fdinfo_file)) != -1) { char *key, *val; // Get rid of the newline if present if (line[count - 1] == '\n') { line[--count] = '\0'; } if (!extract_drm_fdinfo_key_value(line, &key, &val)) continue; if (!strcmp(key, drm_pdev)) { if (strcmp(val, gpu_info->base.pdev)) { return false; } } else if (!strcmp(key, drm_client_id)) { char *endptr; cid = strtoul(val, &endptr, 10); if (*endptr) continue; client_id_set = true; } else { bool is_render = !strcmp(key, drm_intel_render); bool is_copy = !strcmp(key, drm_intel_copy); bool is_video = !strcmp(key, drm_intel_video); bool is_video_enhance = !strcmp(key, drm_intel_video_enhance); if (is_render || is_copy || is_video || is_video_enhance) { char *endptr; uint64_t time_spent = strtoull(val, &endptr, 10); if (endptr == val || strcmp(endptr, " ns")) continue; if (is_render) { SET_GPUINFO_PROCESS(process_info, gfx_engine_used, time_spent); } if (is_copy) { // TODO: what is copy? (void)time_spent; } if (is_video) { // Video represents encode and decode SET_GPUINFO_PROCESS(process_info, dec_engine_used, time_spent); SET_GPUINFO_PROCESS(process_info, enc_engine_used, time_spent); } if (is_video_enhance) { // TODO: what is this } } } } if (!client_id_set) return false; // The intel driver does not expose compute engine metrics as of yet process_info->type |= gpu_process_graphical; struct intel_process_info_cache *cache_entry; struct unique_cache_id ucid = {.client_id = cid, .pid = process_info->pid, .pdev = gpu_info->base.pdev}; HASH_FIND_CLIENT(gpu_info->last_update_process_cache, &ucid, cache_entry); if (cache_entry) { uint64_t time_elapsed = nvtop_difftime_u64(cache_entry->last_measurement_tstamp, current_time); HASH_DEL(gpu_info->last_update_process_cache, cache_entry); if (GPUINFO_PROCESS_FIELD_VALID(process_info, gfx_engine_used) && INTEL_CACHE_FIELD_VALID(cache_entry, engine_render) && // In some rare occasions, the gfx engine usage reported by the driver is lowering (might be a driver bug) process_info->gfx_engine_used >= cache_entry->engine_render && process_info->gfx_engine_used - cache_entry->engine_render <= time_elapsed) { SET_GPUINFO_PROCESS( process_info, gpu_usage, busy_usage_from_time_usage_round(process_info->gfx_engine_used, cache_entry->engine_render, time_elapsed)); } if (GPUINFO_PROCESS_FIELD_VALID(process_info, dec_engine_used) && INTEL_CACHE_FIELD_VALID(cache_entry, engine_video) && process_info->dec_engine_used >= cache_entry->engine_video && process_info->dec_engine_used - cache_entry->engine_video <= time_elapsed) { SET_GPUINFO_PROCESS( process_info, decode_usage, busy_usage_from_time_usage_round(process_info->dec_engine_used, cache_entry->engine_video, time_elapsed)); } if (GPUINFO_PROCESS_FIELD_VALID(process_info, enc_engine_used) && INTEL_CACHE_FIELD_VALID(cache_entry, engine_video_enhance) && process_info->enc_engine_used >= cache_entry->engine_video_enhance && process_info->enc_engine_used - cache_entry->engine_video_enhance <= time_elapsed) { SET_GPUINFO_PROCESS(process_info, encode_usage, busy_usage_from_time_usage_round(process_info->enc_engine_used, cache_entry->engine_video_enhance, time_elapsed)); } } else { cache_entry = calloc(1, sizeof(*cache_entry)); if (!cache_entry) goto parse_fdinfo_exit; cache_entry->client_id.client_id = cid; cache_entry->client_id.pid = process_info->pid; cache_entry->client_id.pdev = gpu_info->base.pdev; } #ifndef NDEBUG // We should only process one fdinfo entry per client id per update struct intel_process_info_cache *cache_entry_check; HASH_FIND_CLIENT(gpu_info->current_update_process_cache, &cid, cache_entry_check); assert(!cache_entry_check && "We should not be processing a client id twice per update"); #endif RESET_ALL(cache_entry->valid); if (GPUINFO_PROCESS_FIELD_VALID(process_info, gfx_engine_used)) SET_INTEL_CACHE(cache_entry, engine_render, process_info->gfx_engine_used); if (GPUINFO_PROCESS_FIELD_VALID(process_info, dec_engine_used)) SET_INTEL_CACHE(cache_entry, engine_video, process_info->dec_engine_used); if (GPUINFO_PROCESS_FIELD_VALID(process_info, enc_engine_used)) SET_INTEL_CACHE(cache_entry, engine_video_enhance, process_info->enc_engine_used); cache_entry->last_measurement_tstamp = current_time; HASH_ADD_CLIENT(gpu_info->current_update_process_cache, cache_entry); parse_fdinfo_exit: return true; } static void add_intel_cards(struct nvtop_device *dev, struct list_head *devices, unsigned *count) { struct nvtop_device *parent; if (nvtop_device_get_parent(dev, &parent) < 0) return; // Consider enabled Intel cards using the i915 driver const char *vendor, *driver, *enabled; if (nvtop_device_get_sysattr_value(parent, "vendor", &vendor) < 0 || strcmp(vendor, VENDOR_INTEL_STR)) return; if (nvtop_device_get_driver(parent, &driver) < 0 || strcmp(driver, "i915")) return; if (nvtop_device_get_sysattr_value(parent, "enable", &enabled) < 0 || strcmp(enabled, "1")) return; struct gpu_info_intel *thisGPU = &gpu_infos[intel_gpu_count++]; thisGPU->base.vendor = &gpu_vendor_intel; thisGPU->card_device = nvtop_device_ref(dev); thisGPU->driver_device = nvtop_device_ref(parent); const char *pdev_val; int retval = nvtop_device_get_property_value(thisGPU->driver_device, "PCI_SLOT_NAME", &pdev_val); assert(retval >= 0 && pdev_val != NULL && "Could not retrieve device PCI slot name"); strncpy(thisGPU->base.pdev, pdev_val, PDEV_LEN); list_add_tail(&thisGPU->base.list, devices); // Register a fdinfo callback for this GPU processinfo_register_fdinfo_callback(parse_drm_fdinfo_intel, &thisGPU->base); (*count)++; } bool gpuinfo_intel_get_device_handles(struct list_head *devices_list, unsigned *count) { *count = 0; nvtop_device_enumerator *enumerator; if (nvtop_enumerator_new(&enumerator) < 0) return false; if (nvtop_device_enumerator_add_match_subsystem(enumerator, "drm", true) < 0) return false; if (nvtop_device_enumerator_add_match_property(enumerator, "DEVNAME", "/dev/dri/*") < 0) return false; unsigned num_devices = 0; for (nvtop_device *device = nvtop_enumerator_get_device_first(enumerator); device; device = nvtop_enumerator_get_device_next(enumerator)) { num_devices++; } gpu_infos = calloc(num_devices, sizeof(*gpu_infos)); if (!gpu_infos) return false; for (nvtop_device *device = nvtop_enumerator_get_device_first(enumerator); device; device = nvtop_enumerator_get_device_next(enumerator)) { num_devices++; const char *devname; if (nvtop_device_get_devname(device, &devname) < 0) continue; if (strstr(devname, "/dev/dri/card")) { add_intel_cards(device, devices_list, count); } } nvtop_enumerator_unref(enumerator); return true; } void gpuinfo_intel_populate_static_info(struct gpu_info *_gpu_info) { struct gpu_info_intel *gpu_info = container_of(_gpu_info, struct gpu_info_intel, base); struct gpuinfo_static_info *static_info = &gpu_info->base.static_info; const char *dev_name; static_info->integrated_graphics = false; RESET_ALL(static_info->valid); if (nvtop_device_get_property_value(gpu_info->driver_device, "ID_MODEL_FROM_DATABASE", &dev_name) >= 0) { snprintf(static_info->device_name, sizeof(static_info->device_name), "%s", dev_name); SET_VALID(gpuinfo_device_name_valid, static_info->valid); for (size_t idx = 0; idx < sizeof(static_info->device_name) && static_info->device_name[idx] != '\0'; ++idx) { if (static_info->device_name[idx] == '[') static_info->device_name[idx] = '('; if (static_info->device_name[idx] == ']') static_info->device_name[idx] = ')'; } } nvtop_pcie_link max_link_characteristics; int ret = nvtop_device_maximum_pcie_link(gpu_info->driver_device, &max_link_characteristics); if (ret >= 0) { SET_GPUINFO_STATIC(static_info, max_pcie_link_width, max_link_characteristics.width); unsigned pcieGen = nvtop_pcie_gen_from_link_speed(max_link_characteristics.speed); SET_GPUINFO_STATIC(static_info, max_pcie_gen, pcieGen); } // Mark integrated GPUs if (strcmp(gpu_info->base.pdev, INTEGRATED_I915_GPU_PCI_ID) == 0) { static_info->integrated_graphics = true; } } void gpuinfo_intel_refresh_dynamic_info(struct gpu_info *_gpu_info) { struct gpu_info_intel *gpu_info = container_of(_gpu_info, struct gpu_info_intel, base); struct gpuinfo_static_info *static_info = &gpu_info->base.static_info; struct gpuinfo_dynamic_info *dynamic_info = &gpu_info->base.dynamic_info; RESET_ALL(dynamic_info->valid); dynamic_info->encode_decode_shared = true; nvtop_device *card_dev_copy; const char *syspath; nvtop_device_get_syspath(gpu_info->card_device, &syspath); nvtop_device_new_from_syspath(&card_dev_copy, syspath); // GPU clock const char *gt_cur_freq; if (nvtop_device_get_sysattr_value(card_dev_copy, "gt_cur_freq_mhz", >_cur_freq) >= 0) { unsigned val = strtoul(gt_cur_freq, NULL, 10); SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed, val); } const char *gt_max_freq; if (nvtop_device_get_sysattr_value(card_dev_copy, "gt_max_freq_mhz", >_max_freq) >= 0) { unsigned val = strtoul(gt_max_freq, NULL, 10); SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed_max, val); } // Mem clock // TODO: the attribute mem_cur_freq_mhz and mem_max_freq_mhz are speculative (not present on integrated graphics) const char *mem_cur_freq; if (nvtop_device_get_sysattr_value(card_dev_copy, "mem_cur_freq_mhz", &mem_cur_freq) >= 0) { unsigned val = strtoul(mem_cur_freq, NULL, 10); SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed, val); } const char *mem_max_freq; if (nvtop_device_get_sysattr_value(card_dev_copy, "mem_max_freq_mhz", &mem_max_freq) >= 0) { unsigned val = strtoul(mem_max_freq, NULL, 10); SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed, val); } // TODO: find how to extract global utilization // gpu util will be computed as the sum of all the processes utilization for now if (!static_info->integrated_graphics) { nvtop_pcie_link curr_link_characteristics; int ret = nvtop_device_current_pcie_link(card_dev_copy, &curr_link_characteristics); if (ret >= 0) { SET_GPUINFO_DYNAMIC(dynamic_info, pcie_link_width, curr_link_characteristics.width); unsigned pcieGen = nvtop_pcie_gen_from_link_speed(curr_link_characteristics.speed); SET_GPUINFO_DYNAMIC(dynamic_info, pcie_link_gen, pcieGen); } } // TODO: Attributes such as memory, fan, temperature, power info should be available once the hwmon patch lands nvtop_device_unref(card_dev_copy); } static void swap_process_cache_for_next_update(struct gpu_info_intel *gpu_info) { // Free old cache data and set the cache for the next update if (gpu_info->last_update_process_cache) { struct intel_process_info_cache *cache_entry, *tmp; HASH_ITER(hh, gpu_info->last_update_process_cache, cache_entry, tmp) { HASH_DEL(gpu_info->last_update_process_cache, cache_entry); free(cache_entry); } } gpu_info->last_update_process_cache = gpu_info->current_update_process_cache; gpu_info->current_update_process_cache = NULL; } void gpuinfo_intel_get_running_processes(struct gpu_info *_gpu_info) { // For Intel, we register a fdinfo callback that will fill the gpu_process datastructure of the gpu_info structure // for us. This avoids going through /proc multiple times per update for multiple GPUs. struct gpu_info_intel *gpu_info = container_of(_gpu_info, struct gpu_info_intel, base); swap_process_cache_for_next_update(gpu_info); } nvtop-3.0.2/src/extract_gpuinfo_msm.c000066400000000000000000000414561444130114000176740ustar00rootroot00000000000000/* * * Copyright (C) 2023 Ryan Houdek * * This file is part of Nvtop and adapted from the amdgpu implementation. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/device_discovery.h" #include "nvtop/extract_gpuinfo_common.h" #include "nvtop/extract_processinfo_fdinfo.h" #include "nvtop/time.h" #include #include #include #include #include #include #include #include #include #include #include // extern const char * msm_parse_marketing_name(uint64_t gpu_id); #define HASH_FIND_CLIENT(head, key_ptr, out_ptr) HASH_FIND(hh, head, key_ptr, sizeof(unsigned), out_ptr) #define HASH_ADD_CLIENT(head, in_ptr) HASH_ADD(hh, head, client_id, sizeof(unsigned), in_ptr) #define SET_MSM_CACHE(cachePtr, field, value) SET_VALUE(cachePtr, field, value, msm_cache_) #define RESET_MSM_CACHE(cachePtr, field) INVALIDATE_VALUE(cachePtr, field, msm_cache_) #define MSM_CACHE_FIELD_VALID(cachePtr, field) VALUE_IS_VALID(cachePtr, field, msm_cache_) enum intel_process_info_cache_valid { msm_cache_engine_render_valid = 0, msm_cache_process_info_cache_valid_count }; struct __attribute__((__packed__)) unique_cache_id { unsigned client_id; pid_t pid; }; struct msm_process_info_cache { struct unique_cache_id client_id; uint64_t engine_render; nvtop_time last_measurement_tstamp; unsigned char valid[(msm_cache_process_info_cache_valid_count + CHAR_BIT - 1) / CHAR_BIT]; UT_hash_handle hh; }; struct gpu_info_msm { drmVersionPtr drmVersion; struct gpu_info base; int fd; struct msm_process_info_cache *last_update_process_cache, *current_update_process_cache; // Cached processes info }; static bool gpuinfo_msm_init(void); static void gpuinfo_msm_shutdown(void); static const char *gpuinfo_msm_last_error_string(void); static bool gpuinfo_msm_get_device_handles(struct list_head *devices, unsigned *count); static void gpuinfo_msm_populate_static_info(struct gpu_info *_gpu_info); static void gpuinfo_msm_refresh_dynamic_info(struct gpu_info *_gpu_info); static void gpuinfo_msm_get_running_processes(struct gpu_info *_gpu_info); struct gpu_vendor gpu_vendor_msm = { .init = gpuinfo_msm_init, .shutdown = gpuinfo_msm_shutdown, .last_error_string = gpuinfo_msm_last_error_string, .get_device_handles = gpuinfo_msm_get_device_handles, .populate_static_info = gpuinfo_msm_populate_static_info, .refresh_dynamic_info = gpuinfo_msm_refresh_dynamic_info, .refresh_running_processes = gpuinfo_msm_get_running_processes, .name = "msm", }; unsigned msm_gpu_count; static struct gpu_info_msm *gpu_infos; static void *libdrm_handle; static int last_libdrm_return_status = 0; static char didnt_call_gpuinfo_init[] = "uninitialized"; static const char *local_error_string = didnt_call_gpuinfo_init; // Local function pointers to DRM interface static typeof(drmGetDevices) *_drmGetDevices; static typeof(drmGetDevices2) *_drmGetDevices2; static typeof(drmFreeDevices) *_drmFreeDevices; static typeof(drmGetVersion) *_drmGetVersion; static typeof(drmFreeVersion) *_drmFreeVersion; static typeof(drmGetMagic) *_drmGetMagic; static typeof(drmAuthMagic) *_drmAuthMagic; static typeof(drmDropMaster) *_drmDropMaster; static typeof(drmCommandWriteRead) *_drmCommandWriteRead; static int wrap_drmGetDevices(drmDevicePtr devices[], int max_devices) { assert(_drmGetDevices2 || _drmGetDevices); if (_drmGetDevices2) return _drmGetDevices2(0, devices, max_devices); return _drmGetDevices(devices, max_devices); } static void authenticate_drm(int fd) { drm_magic_t magic; if (_drmGetMagic(fd, &magic) < 0) { return; } if (_drmAuthMagic(fd, magic) == 0) { if (_drmDropMaster(fd)) { perror("Failed to drop DRM master"); fprintf( stderr, "\nWARNING: other DRM clients will crash on VT switch while nvtop is running!\npress ENTER to continue\n"); fgetc(stdin); } return; } // XXX: Ideally I'd implement this too, but I'd need to pull in libxcb and yet // more functions and structs that may break ABI compatibility. // See radeontop auth_xcb.c for what is involved here fprintf(stderr, "Failed to authenticate to DRM; XCB authentication unimplemented\n"); } #define STRINGIFY(x) STRINGIFY_HELPER_(x) #define STRINGIFY_HELPER_(x) #x __attribute__((constructor)) static void init_extract_gpuinfo_msm(void) { register_gpu_vendor(&gpu_vendor_msm); } bool gpuinfo_msm_init(void) { libdrm_handle = dlopen("libdrm.so", RTLD_LAZY); if (!libdrm_handle) libdrm_handle = dlopen("libdrm.so.2", RTLD_LAZY); if (!libdrm_handle) libdrm_handle = dlopen("libdrm.so.1", RTLD_LAZY); if (!libdrm_handle) { local_error_string = dlerror(); return false; } _drmGetDevices2 = dlsym(libdrm_handle, "drmGetDevices2"); if (!_drmGetDevices2) _drmGetDevices = dlsym(libdrm_handle, "drmGetDevices"); if (!_drmGetDevices2 && !_drmGetDevices) goto init_error_clean_exit; _drmFreeDevices = dlsym(libdrm_handle, "drmFreeDevices"); if (!_drmFreeDevices) goto init_error_clean_exit; _drmGetVersion = dlsym(libdrm_handle, "drmGetVersion"); if (!_drmGetVersion) goto init_error_clean_exit; _drmFreeVersion = dlsym(libdrm_handle, "drmFreeVersion"); if (!_drmFreeVersion) goto init_error_clean_exit; _drmGetMagic = dlsym(libdrm_handle, "drmGetMagic"); if (!_drmGetMagic) goto init_error_clean_exit; _drmAuthMagic = dlsym(libdrm_handle, "drmAuthMagic"); if (!_drmAuthMagic) goto init_error_clean_exit; _drmDropMaster = dlsym(libdrm_handle, "drmDropMaster"); if (!_drmDropMaster) goto init_error_clean_exit; _drmCommandWriteRead = dlsym(libdrm_handle, "drmCommandWriteRead"); if (!_drmCommandWriteRead) goto init_error_clean_exit; local_error_string = NULL; return true; init_error_clean_exit: dlclose(libdrm_handle); libdrm_handle = NULL; return false; } void gpuinfo_msm_shutdown(void) { for (unsigned i = 0; i < msm_gpu_count; ++i) { struct gpu_info_msm *current = &gpu_infos[i]; _drmFreeVersion(current->drmVersion); } free(gpu_infos); gpu_infos = NULL; msm_gpu_count = 0; if (libdrm_handle) { dlclose(libdrm_handle); libdrm_handle = NULL; local_error_string = didnt_call_gpuinfo_init; } } static const char *gpuinfo_msm_last_error_string(void) { if (local_error_string) { return local_error_string; } else if (last_libdrm_return_status < 0) { switch (last_libdrm_return_status) { case DRM_ERR_NO_DEVICE: return "no device\n"; case DRM_ERR_NO_ACCESS: return "no access\n"; case DRM_ERR_NOT_ROOT: return "not root\n"; case DRM_ERR_INVALID: return "invalid args\n"; case DRM_ERR_NO_FD: return "no fd\n"; default: return "unknown error\n"; } } else { return "An unanticipated error occurred while accessing AMDGPU " "information\n"; } } static const char drm_msm_engine_gpu[] = "drm-engine-gpu"; static const char drm_msm_cycles_gpu[] = "drm-cycles-gpu"; static const char drm_msm_maxfreq_gpu[] = "drm-maxfreq-gpu"; static const char drm_msm_resident_mem[] = "drm-resident-memory"; static bool parse_drm_fdinfo_msm(struct gpu_info *info, FILE *fdinfo_file, struct gpu_process *process_info) { struct gpu_info_msm *gpu_info = container_of(info, struct gpu_info_msm, base); static char *line = NULL; static size_t line_buf_size = 0; ssize_t count = 0; bool client_id_set = false; unsigned cid; nvtop_time current_time; nvtop_get_current_time(¤t_time); while ((count = getline(&line, &line_buf_size, fdinfo_file)) != -1) { char *key, *val; // Get rid of the newline if present if (line[count - 1] == '\n') { line[--count] = '\0'; } if (!extract_drm_fdinfo_key_value(line, &key, &val)) continue; if (!strcmp(key, drm_client_id)) { char *endptr; cid = strtoul(val, &endptr, 10); if (*endptr) continue; client_id_set = true; } else { bool is_engine = !strcmp(key, drm_msm_engine_gpu); bool is_cycles = !strcmp(key, drm_msm_cycles_gpu); bool is_maxfreq = !strcmp(key, drm_msm_maxfreq_gpu); bool is_resident = !strcmp(key, drm_msm_resident_mem); if (is_engine || is_cycles || is_maxfreq) { char *endptr; uint64_t time_spent = strtoull(val, &endptr, 10); if (endptr == val || strcmp(endptr, " ns")) continue; if (is_engine) { SET_GPUINFO_PROCESS(process_info, gfx_engine_used, time_spent); } } else if (is_resident) { uint64_t mem_int; char *endptr; mem_int = strtoull(val, &endptr, 10); if (endptr == val) continue; uint64_t multiplier = 1; if (strcmp(endptr, " B") == 0) { multiplier = 1; } else if (strcmp(endptr, " KiB") == 0) { multiplier = 1024; } else if (strcmp(endptr, " MiB") == 0) { multiplier = 1024 * 1024; } else if (strcmp(endptr, " GiB") == 0) { multiplier = 1024 * 1024 * 1024; } SET_GPUINFO_PROCESS(process_info, gpu_memory_usage, mem_int * multiplier); } } } if (!client_id_set) return false; // The msm driver does not expose compute engine metrics as of yet process_info->type |= gpu_process_graphical; struct msm_process_info_cache *cache_entry; struct unique_cache_id ucid = {.client_id = cid, .pid = process_info->pid}; HASH_FIND_CLIENT(gpu_info->last_update_process_cache, &ucid, cache_entry); if (cache_entry) { uint64_t time_elapsed = nvtop_difftime_u64(cache_entry->last_measurement_tstamp, current_time); HASH_DEL(gpu_info->last_update_process_cache, cache_entry); if (GPUINFO_PROCESS_FIELD_VALID(process_info, gfx_engine_used) && MSM_CACHE_FIELD_VALID(cache_entry, engine_render) && // In some rare occasions, the gfx engine usage reported by the driver is lowering (might be a driver bug) process_info->gfx_engine_used >= cache_entry->engine_render && process_info->gfx_engine_used - cache_entry->engine_render <= time_elapsed) { SET_GPUINFO_PROCESS( process_info, gpu_usage, busy_usage_from_time_usage_round(process_info->gfx_engine_used, cache_entry->engine_render, time_elapsed)); } } else { cache_entry = calloc(1, sizeof(*cache_entry)); if (!cache_entry) goto parse_fdinfo_exit; cache_entry->client_id.client_id = cid; cache_entry->client_id.pid = process_info->pid; } #ifndef NDEBUG // We should only process one fdinfo entry per client id per update struct msm_process_info_cache *cache_entry_check; HASH_FIND_CLIENT(gpu_info->current_update_process_cache, &cid, cache_entry_check); assert(!cache_entry_check && "We should not be processing a client id twice per update"); #endif RESET_ALL(cache_entry->valid); if (GPUINFO_PROCESS_FIELD_VALID(process_info, gfx_engine_used)) SET_MSM_CACHE(cache_entry, engine_render, process_info->gfx_engine_used); cache_entry->last_measurement_tstamp = current_time; HASH_ADD_CLIENT(gpu_info->current_update_process_cache, cache_entry); parse_fdinfo_exit: return true; } static bool gpuinfo_msm_get_device_handles(struct list_head *devices, unsigned *count) { if (!libdrm_handle) return false; last_libdrm_return_status = wrap_drmGetDevices(NULL, 0); if (last_libdrm_return_status <= 0) return false; drmDevicePtr devs[last_libdrm_return_status]; last_libdrm_return_status = wrap_drmGetDevices(devs, last_libdrm_return_status); if (last_libdrm_return_status <= 0) return false; unsigned int libdrm_count = last_libdrm_return_status; gpu_infos = calloc(libdrm_count, sizeof(*gpu_infos)); if (!gpu_infos) { local_error_string = strerror(errno); return false; } for (unsigned int i = 0; i < libdrm_count; i++) { int fd = -1; // Try render node first if (1 << DRM_NODE_RENDER & devs[i]->available_nodes) { fd = open(devs[i]->nodes[DRM_NODE_RENDER], O_RDWR); } if (fd < 0) { // Fallback to primary node (control nodes are unused according to the DRM documentation) if (1 << DRM_NODE_PRIMARY & devs[i]->available_nodes) { fd = open(devs[i]->nodes[DRM_NODE_PRIMARY], O_RDWR); } } if (fd < 0) continue; drmVersionPtr ver = _drmGetVersion(fd); if (!ver) { close(fd); continue; } bool is_msm = !strcmp(ver->name, "msm"); if (!is_msm) { _drmFreeVersion(ver); close(fd); continue; } authenticate_drm(fd); gpu_infos[msm_gpu_count].drmVersion = ver; gpu_infos[msm_gpu_count].fd = fd; gpu_infos[msm_gpu_count].base.vendor = &gpu_vendor_msm; list_add_tail(&gpu_infos[msm_gpu_count].base.list, devices); // Register a fdinfo callback for this GPU processinfo_register_fdinfo_callback(parse_drm_fdinfo_msm, &gpu_infos[msm_gpu_count].base); msm_gpu_count++; } _drmFreeDevices(devs, libdrm_count); *count = msm_gpu_count; return true; } static int gpuinfo_msm_query_param(int gpu, uint32_t param, uint64_t *value) { struct drm_msm_param req = { .pipe = MSM_PIPE_3D0, // Only the 3D pipe. .param = param, }; int ret = _drmCommandWriteRead(gpu, DRM_MSM_GET_PARAM, &req, sizeof(req)); if (ret) return ret; *value = req.value; return 0; } void gpuinfo_msm_populate_static_info(struct gpu_info *_gpu_info) { struct gpu_info_msm *gpu_info = container_of(_gpu_info, struct gpu_info_msm, base); struct gpuinfo_static_info *static_info = &gpu_info->base.static_info; const char *dev_name; static_info->integrated_graphics = true; RESET_ALL(static_info->valid); uint64_t gpuid; if (gpuinfo_msm_query_param(gpu_info->fd, MSM_PARAM_CHIP_ID, &gpuid) == 0) { const char* name = msm_parse_marketing_name(gpuid); if (name) { strncpy(static_info->device_name, name, sizeof(static_info->device_name)); } else { snprintf(static_info->device_name, sizeof(static_info->device_name), "Unknown Adreno %lx", gpuid); } SET_VALID(gpuinfo_device_name_valid, static_info->valid); } } void gpuinfo_msm_refresh_dynamic_info(struct gpu_info *_gpu_info) { struct gpu_info_msm *gpu_info = container_of(_gpu_info, struct gpu_info_msm, base); struct gpuinfo_static_info *static_info = &gpu_info->base.static_info; struct gpuinfo_dynamic_info *dynamic_info = &gpu_info->base.dynamic_info; RESET_ALL(dynamic_info->valid); dynamic_info->encode_decode_shared = true; // GPU clock uint64_t val; if (gpuinfo_msm_query_param(gpu_info->fd, MSM_PARAM_MAX_FREQ, &val) == 0) { // TODO: No way to query current clock speed. SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed, val / 1000000); SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed_max, val / 1000000); } // Mem clock // TODO: No way to query. // TODO: find how to extract global utilization // gpu util will be computed as the sum of all the processes utilization for now struct sysinfo info; if (sysinfo(&info) == 0) { SET_GPUINFO_DYNAMIC(dynamic_info, total_memory, info.totalram); SET_GPUINFO_DYNAMIC(dynamic_info, used_memory, info.totalram - info.freeram); SET_GPUINFO_DYNAMIC(dynamic_info, free_memory, info.freeram); SET_GPUINFO_DYNAMIC(dynamic_info, mem_util_rate, (dynamic_info->total_memory - dynamic_info->free_memory) * 100 / dynamic_info->total_memory); } } static void swap_process_cache_for_next_update(struct gpu_info_msm *gpu_info) { // Free old cache data and set the cache for the next update if (gpu_info->last_update_process_cache) { struct msm_process_info_cache *cache_entry, *tmp; HASH_ITER(hh, gpu_info->last_update_process_cache, cache_entry, tmp) { HASH_DEL(gpu_info->last_update_process_cache, cache_entry); free(cache_entry); } } gpu_info->last_update_process_cache = gpu_info->current_update_process_cache; gpu_info->current_update_process_cache = NULL; } void gpuinfo_msm_get_running_processes(struct gpu_info *_gpu_info) { // For Adreno, we register a fdinfo callback that will fill the gpu_process datastructure of the gpu_info structure // for us. This avoids going through /proc multiple times per update for multiple GPUs. struct gpu_info_msm *gpu_info = container_of(_gpu_info, struct gpu_info_msm, base); swap_process_cache_for_next_update(gpu_info); } nvtop-3.0.2/src/extract_gpuinfo_msm_utils.c000066400000000000000000000052631444130114000211100ustar00rootroot00000000000000/* * * Copyright (C) 2023 Ryan Houdek * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/interface_internal_common.h" #include struct msm_id_struct { uint64_t id; const char *name; }; #define GetHundredDigit(coreid) (coreid / 100) #define GetHundred(coreid) (GetHundredDigit(coreid) * 100) #define GetTenDigit(coreid) ((coreid - GetHundred(coreid)) / 10) #define GetTen(coreid) (GetTenDigit(coreid) * 10) #define GetOneDigit(coreid) (coreid - (GetHundred(coreid) + GetTen(coreid))) #define CHIPID(coreid) \ (GetHundredDigit(coreid) << 24) | \ (GetTenDigit(coreid) << 16) | \ (GetOneDigit(coreid) << 8) static const struct msm_id_struct msm_ids[] = { // Adreno 2xx {CHIPID(200), "Adreno 200"}, {CHIPID(201), "Adreno 201"}, {CHIPID(205), "Adreno 205"}, {CHIPID(220), "Adreno 220"}, // Adreno 3xx {CHIPID(305), "Adreno 305"}, {CHIPID(307), "Adreno 307"}, {CHIPID(320), "Adreno 320"}, {CHIPID(330), "Adreno 330"}, // Adreno 4xx {CHIPID(405), "Adreno 405"}, {CHIPID(420), "Adreno 420"}, {CHIPID(430), "Adreno 430"}, // Adreno 5xx {CHIPID(508), "Adreno 508"}, {CHIPID(509), "Adreno 509"}, {CHIPID(510), "Adreno 510"}, {CHIPID(512), "Adreno 512"}, {CHIPID(530), "Adreno 530"}, {CHIPID(540), "Adreno 540"}, // Adreno 6xx {CHIPID(615), "Adreno 615"}, {CHIPID(616), "Adreno 616"}, {CHIPID(618), "Adreno 618"}, {CHIPID(619), "Adreno 619"}, {CHIPID(620), "Adreno 620"}, {CHIPID(630), "Adreno 630"}, {CHIPID(640), "Adreno 640"}, {CHIPID(650), "Adreno 650"}, {CHIPID(660), "Adreno 660"}, {CHIPID(680), "Adreno 680"}, {CHIPID(690), "Adreno 690"}, // Adreno 7xx {CHIPID(730), "Adreno 730"}, {CHIPID(740), "Adreno 740"}, // Misc {0x00be06030500, "Adreno 8c Gen 3"}, {0x007506030500, "Adreno 7c+ Gen 3"}, {0x006006030500, "Adreno 7c+ Gen 3 Lite"}, }; const char * msm_parse_marketing_name(uint64_t gpu_id) { for (unsigned i = 0; i < ARRAY_SIZE(msm_ids); i++) { if (gpu_id == msm_ids[i].id) { return msm_ids[i].name; } } return NULL; } nvtop-3.0.2/src/extract_gpuinfo_nvidia.c000066400000000000000000000653201444130114000203460ustar00rootroot00000000000000/* * * Copyright (C) 2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/common.h" #include "nvtop/extract_gpuinfo_common.h" #include #include #include #include #include #include #define NVML_SUCCESS 0 #define NVML_ERROR_INSUFFICIENT_SIZE 7 typedef struct nvmlDevice *nvmlDevice_t; typedef int nvmlReturn_t; // store the enum as int // Init and shutdown static nvmlReturn_t (*nvmlInit)(void); static nvmlReturn_t (*nvmlShutdown)(void); // Static information and helper functions static nvmlReturn_t (*nvmlDeviceGetCount)(unsigned int *deviceCount); static nvmlReturn_t (*nvmlDeviceGetHandleByIndex)(unsigned int index, nvmlDevice_t *device); static const char *(*nvmlErrorString)(nvmlReturn_t); static nvmlReturn_t (*nvmlDeviceGetName)(nvmlDevice_t device, char *name, unsigned int length); typedef struct { char busIdLegacy[16]; unsigned int domain; unsigned int bus; unsigned int device; unsigned int pciDeviceId; // Added in NVML 2.285 API unsigned int pciSubSystemId; char busId[32]; } nvmlPciInfo_t; static nvmlReturn_t (*nvmlDeviceGetPciInfo)(nvmlDevice_t device, nvmlPciInfo_t *pciInfo); static nvmlReturn_t (*nvmlDeviceGetMaxPcieLinkGeneration)(nvmlDevice_t device, unsigned int *maxLinkGen); static nvmlReturn_t (*nvmlDeviceGetMaxPcieLinkWidth)(nvmlDevice_t device, unsigned int *maxLinkWidth); typedef enum { NVML_TEMPERATURE_THRESHOLD_SHUTDOWN = 0, NVML_TEMPERATURE_THRESHOLD_SLOWDOWN = 1, } nvmlTemperatureThresholds_t; static nvmlReturn_t (*nvmlDeviceGetTemperatureThreshold)(nvmlDevice_t device, nvmlTemperatureThresholds_t thresholdType, unsigned int *temp); // Dynamic information extraction typedef enum { NVML_CLOCK_GRAPHICS = 0, NVML_CLOCK_SM = 1, NVML_CLOCK_MEM = 2, NVML_CLOCK_VIDEO = 3, } nvmlClockType_t; static nvmlReturn_t (*nvmlDeviceGetClockInfo)(nvmlDevice_t device, nvmlClockType_t type, unsigned int *clock); static nvmlReturn_t (*nvmlDeviceGetMaxClockInfo)(nvmlDevice_t device, nvmlClockType_t type, unsigned int *clock); typedef struct { unsigned int gpu; unsigned int memory; } nvmlUtilization_t; static nvmlReturn_t (*nvmlDeviceGetUtilizationRates)(nvmlDevice_t device, nvmlUtilization_t *utilization); typedef struct { unsigned long long total; unsigned long long free; unsigned long long used; } nvmlMemory_t; static nvmlReturn_t (*nvmlDeviceGetMemoryInfo)(nvmlDevice_t device, nvmlMemory_t *memory); static nvmlReturn_t (*nvmlDeviceGetCurrPcieLinkGeneration)(nvmlDevice_t device, unsigned int *currLinkGen); static nvmlReturn_t (*nvmlDeviceGetCurrPcieLinkWidth)(nvmlDevice_t device, unsigned int *currLinkWidth); typedef enum { NVML_PCIE_UTIL_TX_BYTES = 0, NVML_PCIE_UTIL_RX_BYTES = 1, } nvmlPcieUtilCounter_t; static nvmlReturn_t (*nvmlDeviceGetPcieThroughput)(nvmlDevice_t device, nvmlPcieUtilCounter_t counter, unsigned int *value); static nvmlReturn_t (*nvmlDeviceGetFanSpeed)(nvmlDevice_t device, unsigned int *speed); typedef enum { NVML_TEMPERATURE_GPU = 0, } nvmlTemperatureSensors_t; static nvmlReturn_t (*nvmlDeviceGetTemperature)(nvmlDevice_t device, nvmlTemperatureSensors_t sensorType, unsigned int *temp); static nvmlReturn_t (*nvmlDeviceGetPowerUsage)(nvmlDevice_t device, unsigned int *power); static nvmlReturn_t (*nvmlDeviceGetEnforcedPowerLimit)(nvmlDevice_t device, unsigned int *limit); static nvmlReturn_t (*nvmlDeviceGetEncoderUtilization)(nvmlDevice_t device, unsigned int *utilization, unsigned int *samplingPeriodUs); static nvmlReturn_t (*nvmlDeviceGetDecoderUtilization)(nvmlDevice_t device, unsigned int *utilization, unsigned int *samplingPeriodUs); // Processes running on GPU typedef struct { unsigned int pid; unsigned long long usedGpuMemory; // unsigned int gpuInstanceId; // not supported by older NVIDIA drivers // unsigned int computeInstanceId; // not supported by older NVIDIA drivers } nvmlProcessInfo_t; static nvmlReturn_t (*nvmlDeviceGetGraphicsRunningProcesses)(nvmlDevice_t device, unsigned int *infoCount, nvmlProcessInfo_t *infos); static nvmlReturn_t (*nvmlDeviceGetComputeRunningProcesses)(nvmlDevice_t device, unsigned int *infoCount, nvmlProcessInfo_t *infos); static void *libnvidia_ml_handle; static nvmlReturn_t last_nvml_return_status = NVML_SUCCESS; static char didnt_call_gpuinfo_init[] = "The NVIDIA extraction has not been initialized, please call " "gpuinfo_nvidia_init\n"; static const char *local_error_string = didnt_call_gpuinfo_init; // Processes GPU Utilization typedef struct { unsigned int pid; unsigned long long timeStamp; unsigned int smUtil; unsigned int memUtil; unsigned int encUtil; unsigned int decUtil; } nvmlProcessUtilizationSample_t; nvmlReturn_t (*nvmlDeviceGetProcessUtilization)(nvmlDevice_t device, nvmlProcessUtilizationSample_t *utilization, unsigned int *processSamplesCount, unsigned long long lastSeenTimeStamp); struct gpu_info_nvidia { struct gpu_info base; struct list_head allocate_list; nvmlDevice_t gpuhandle; unsigned long long last_utilization_timestamp; }; static LIST_HEAD(allocations); static bool gpuinfo_nvidia_init(void); static void gpuinfo_nvidia_shutdown(void); static const char *gpuinfo_nvidia_last_error_string(void); static bool gpuinfo_nvidia_get_device_handles(struct list_head *devices, unsigned *count); static void gpuinfo_nvidia_populate_static_info(struct gpu_info *_gpu_info); static void gpuinfo_nvidia_refresh_dynamic_info(struct gpu_info *_gpu_info); static void gpuinfo_nvidia_get_running_processes(struct gpu_info *_gpu_info); struct gpu_vendor gpu_vendor_nvidia = { .init = gpuinfo_nvidia_init, .shutdown = gpuinfo_nvidia_shutdown, .last_error_string = gpuinfo_nvidia_last_error_string, .get_device_handles = gpuinfo_nvidia_get_device_handles, .populate_static_info = gpuinfo_nvidia_populate_static_info, .refresh_dynamic_info = gpuinfo_nvidia_refresh_dynamic_info, .refresh_running_processes = gpuinfo_nvidia_get_running_processes, .name = "NVIDIA", }; __attribute__((constructor)) static void init_extract_gpuinfo_nvidia(void) { register_gpu_vendor(&gpu_vendor_nvidia); } /* * * This function loads the libnvidia-ml.so shared object, initializes the * required function pointers and calls the nvidia library initialization * function. Returns true if everything has been initialized successfully. If * false is returned, the cause of the error can be retrieved by calling the * function gpuinfo_nvidia_last_error_string. * */ static bool gpuinfo_nvidia_init(void) { libnvidia_ml_handle = dlopen("libnvidia-ml.so", RTLD_LAZY); if (!libnvidia_ml_handle) libnvidia_ml_handle = dlopen("libnvidia-ml.so.1", RTLD_LAZY); if (!libnvidia_ml_handle) { local_error_string = dlerror(); return false; } // Default to last version nvmlInit = dlsym(libnvidia_ml_handle, "nvmlInit_v2"); if (!nvmlInit) nvmlInit = dlsym(libnvidia_ml_handle, "nvmlInit"); if (!nvmlInit) goto init_error_clean_exit; nvmlShutdown = dlsym(libnvidia_ml_handle, "nvmlShutdown"); if (!nvmlShutdown) goto init_error_clean_exit; // Default to last version if available nvmlDeviceGetCount = dlsym(libnvidia_ml_handle, "nvmlDeviceGetCount_v2"); if (!nvmlDeviceGetCount) nvmlDeviceGetCount = dlsym(libnvidia_ml_handle, "nvmlDeviceGetCount"); if (!nvmlDeviceGetCount) goto init_error_clean_exit; nvmlDeviceGetHandleByIndex = dlsym(libnvidia_ml_handle, "nvmlDeviceGetHandleByIndex_v2"); if (!nvmlDeviceGetHandleByIndex) nvmlDeviceGetHandleByIndex = dlsym(libnvidia_ml_handle, "nvmlDeviceGetHandleByIndex"); if (!nvmlDeviceGetHandleByIndex) goto init_error_clean_exit; nvmlErrorString = dlsym(libnvidia_ml_handle, "nvmlErrorString"); if (!nvmlErrorString) goto init_error_clean_exit; nvmlDeviceGetName = dlsym(libnvidia_ml_handle, "nvmlDeviceGetName"); if (!nvmlDeviceGetName) goto init_error_clean_exit; nvmlDeviceGetPciInfo = dlsym(libnvidia_ml_handle, "nvmlDeviceGetPciInfo_v3"); if (!nvmlDeviceGetPciInfo) nvmlDeviceGetPciInfo = dlsym(libnvidia_ml_handle, "nvmlDeviceGetPciInfo_v2"); if (!nvmlDeviceGetPciInfo) nvmlDeviceGetPciInfo = dlsym(libnvidia_ml_handle, "nvmlDeviceGetPciInfo"); if (!nvmlDeviceGetPciInfo) goto init_error_clean_exit; nvmlDeviceGetMaxPcieLinkGeneration = dlsym(libnvidia_ml_handle, "nvmlDeviceGetMaxPcieLinkGeneration"); if (!nvmlDeviceGetMaxPcieLinkGeneration) goto init_error_clean_exit; nvmlDeviceGetMaxPcieLinkWidth = dlsym(libnvidia_ml_handle, "nvmlDeviceGetMaxPcieLinkWidth"); if (!nvmlDeviceGetMaxPcieLinkWidth) goto init_error_clean_exit; nvmlDeviceGetTemperatureThreshold = dlsym(libnvidia_ml_handle, "nvmlDeviceGetTemperatureThreshold"); if (!nvmlDeviceGetTemperatureThreshold) goto init_error_clean_exit; nvmlDeviceGetClockInfo = dlsym(libnvidia_ml_handle, "nvmlDeviceGetClockInfo"); if (!nvmlDeviceGetClockInfo) goto init_error_clean_exit; nvmlDeviceGetMaxClockInfo = dlsym(libnvidia_ml_handle, "nvmlDeviceGetMaxClockInfo"); if (!nvmlDeviceGetMaxClockInfo) goto init_error_clean_exit; nvmlDeviceGetUtilizationRates = dlsym(libnvidia_ml_handle, "nvmlDeviceGetUtilizationRates"); if (!nvmlDeviceGetUtilizationRates) goto init_error_clean_exit; nvmlDeviceGetMemoryInfo = dlsym(libnvidia_ml_handle, "nvmlDeviceGetMemoryInfo"); if (!nvmlDeviceGetMemoryInfo) goto init_error_clean_exit; nvmlDeviceGetCurrPcieLinkGeneration = dlsym(libnvidia_ml_handle, "nvmlDeviceGetCurrPcieLinkGeneration"); if (!nvmlDeviceGetCurrPcieLinkGeneration) goto init_error_clean_exit; nvmlDeviceGetCurrPcieLinkWidth = dlsym(libnvidia_ml_handle, "nvmlDeviceGetCurrPcieLinkWidth"); if (!nvmlDeviceGetCurrPcieLinkWidth) goto init_error_clean_exit; nvmlDeviceGetPcieThroughput = dlsym(libnvidia_ml_handle, "nvmlDeviceGetPcieThroughput"); if (!nvmlDeviceGetPcieThroughput) goto init_error_clean_exit; nvmlDeviceGetFanSpeed = dlsym(libnvidia_ml_handle, "nvmlDeviceGetFanSpeed"); if (!nvmlDeviceGetFanSpeed) goto init_error_clean_exit; nvmlDeviceGetTemperature = dlsym(libnvidia_ml_handle, "nvmlDeviceGetTemperature"); if (!nvmlDeviceGetTemperature) goto init_error_clean_exit; nvmlDeviceGetPowerUsage = dlsym(libnvidia_ml_handle, "nvmlDeviceGetPowerUsage"); if (!nvmlDeviceGetPowerUsage) goto init_error_clean_exit; nvmlDeviceGetEnforcedPowerLimit = dlsym(libnvidia_ml_handle, "nvmlDeviceGetEnforcedPowerLimit"); if (!nvmlDeviceGetEnforcedPowerLimit) goto init_error_clean_exit; nvmlDeviceGetEncoderUtilization = dlsym(libnvidia_ml_handle, "nvmlDeviceGetEncoderUtilization"); if (!nvmlDeviceGetEncoderUtilization) goto init_error_clean_exit; nvmlDeviceGetDecoderUtilization = dlsym(libnvidia_ml_handle, "nvmlDeviceGetDecoderUtilization"); if (!nvmlDeviceGetDecoderUtilization) goto init_error_clean_exit; nvmlDeviceGetGraphicsRunningProcesses = dlsym(libnvidia_ml_handle, "nvmlDeviceGetGraphicsRunningProcesses"); if (!nvmlDeviceGetGraphicsRunningProcesses) goto init_error_clean_exit; nvmlDeviceGetComputeRunningProcesses = dlsym(libnvidia_ml_handle, "nvmlDeviceGetComputeRunningProcesses"); if (!nvmlDeviceGetComputeRunningProcesses) goto init_error_clean_exit; // This one might not be available nvmlDeviceGetProcessUtilization = dlsym(libnvidia_ml_handle, "nvmlDeviceGetProcessUtilization"); last_nvml_return_status = nvmlInit(); if (last_nvml_return_status != NVML_SUCCESS) { return false; } local_error_string = NULL; return true; init_error_clean_exit: dlclose(libnvidia_ml_handle); libnvidia_ml_handle = NULL; return false; } static void gpuinfo_nvidia_shutdown(void) { if (libnvidia_ml_handle) { nvmlShutdown(); dlclose(libnvidia_ml_handle); libnvidia_ml_handle = NULL; local_error_string = didnt_call_gpuinfo_init; } struct gpu_info_nvidia *allocated, *tmp; list_for_each_entry_safe(allocated, tmp, &allocations, allocate_list) { list_del(&allocated->allocate_list); free(allocated); } } static const char *gpuinfo_nvidia_last_error_string(void) { if (local_error_string) { return local_error_string; } else if (libnvidia_ml_handle && nvmlErrorString) { return nvmlErrorString(last_nvml_return_status); } else { return "An unanticipated error occurred while accessing NVIDIA GPU " "information\n"; } } static bool gpuinfo_nvidia_get_device_handles(struct list_head *devices, unsigned *count) { if (!libnvidia_ml_handle) return false; unsigned num_devices; last_nvml_return_status = nvmlDeviceGetCount(&num_devices); if (last_nvml_return_status != NVML_SUCCESS) return false; struct gpu_info_nvidia *gpu_infos = calloc(num_devices, sizeof(*gpu_infos)); if (!gpu_infos) { local_error_string = strerror(errno); return false; } list_add(&gpu_infos[0].allocate_list, &allocations); *count = 0; for (unsigned int i = 0; i < num_devices; ++i) { last_nvml_return_status = nvmlDeviceGetHandleByIndex(i, &gpu_infos[*count].gpuhandle); if (last_nvml_return_status == NVML_SUCCESS) { gpu_infos[*count].base.vendor = &gpu_vendor_nvidia; nvmlPciInfo_t pciInfo; nvmlReturn_t pciInfoRet = nvmlDeviceGetPciInfo(gpu_infos[*count].gpuhandle, &pciInfo); if (pciInfoRet == NVML_SUCCESS) { strncpy(gpu_infos[*count].base.pdev, pciInfo.busIdLegacy, PDEV_LEN); list_add_tail(&gpu_infos[*count].base.list, devices); *count += 1; } } } return true; } static void gpuinfo_nvidia_populate_static_info(struct gpu_info *_gpu_info) { struct gpu_info_nvidia *gpu_info = container_of(_gpu_info, struct gpu_info_nvidia, base); struct gpuinfo_static_info *static_info = &gpu_info->base.static_info; nvmlDevice_t device = gpu_info->gpuhandle; static_info->integrated_graphics = false; RESET_ALL(static_info->valid); last_nvml_return_status = nvmlDeviceGetName(device, static_info->device_name, MAX_DEVICE_NAME); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_device_name_valid, static_info->valid); last_nvml_return_status = nvmlDeviceGetMaxPcieLinkGeneration(device, &static_info->max_pcie_gen); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_max_pcie_gen_valid, static_info->valid); last_nvml_return_status = nvmlDeviceGetMaxPcieLinkWidth(device, &static_info->max_pcie_link_width); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_max_pcie_link_width_valid, static_info->valid); last_nvml_return_status = nvmlDeviceGetTemperatureThreshold(device, NVML_TEMPERATURE_THRESHOLD_SHUTDOWN, &static_info->temperature_shutdown_threshold); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_temperature_shutdown_threshold_valid, static_info->valid); last_nvml_return_status = nvmlDeviceGetTemperatureThreshold(device, NVML_TEMPERATURE_THRESHOLD_SLOWDOWN, &static_info->temperature_slowdown_threshold); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_temperature_slowdown_threshold_valid, static_info->valid); } static void gpuinfo_nvidia_refresh_dynamic_info(struct gpu_info *_gpu_info) { struct gpu_info_nvidia *gpu_info = container_of(_gpu_info, struct gpu_info_nvidia, base); struct gpuinfo_dynamic_info *dynamic_info = &gpu_info->base.dynamic_info; nvmlDevice_t device = gpu_info->gpuhandle; bool graphics_clock_valid = false; unsigned graphics_clock; bool sm_clock_valid = false; unsigned sm_clock; nvmlClockType_t getMaxClockFrom = NVML_CLOCK_GRAPHICS; RESET_ALL(dynamic_info->valid); dynamic_info->encode_decode_shared = false; // GPU current speed // Maximum between SM and Graphical last_nvml_return_status = nvmlDeviceGetClockInfo(device, NVML_CLOCK_GRAPHICS, &graphics_clock); graphics_clock_valid = last_nvml_return_status == NVML_SUCCESS; last_nvml_return_status = nvmlDeviceGetClockInfo(device, NVML_CLOCK_SM, &sm_clock); sm_clock_valid = last_nvml_return_status == NVML_SUCCESS; if (graphics_clock_valid && sm_clock_valid && graphics_clock < sm_clock) { getMaxClockFrom = NVML_CLOCK_SM; } else if (!graphics_clock_valid && sm_clock_valid) { getMaxClockFrom = NVML_CLOCK_SM; } if (getMaxClockFrom == NVML_CLOCK_GRAPHICS && graphics_clock_valid) { SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed, graphics_clock); } if (getMaxClockFrom == NVML_CLOCK_SM && sm_clock_valid) { SET_GPUINFO_DYNAMIC(dynamic_info, gpu_clock_speed, sm_clock); } // GPU max speed last_nvml_return_status = nvmlDeviceGetMaxClockInfo(device, getMaxClockFrom, &dynamic_info->gpu_clock_speed_max); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_gpu_clock_speed_max_valid, dynamic_info->valid); // Memory current speed last_nvml_return_status = nvmlDeviceGetClockInfo(device, NVML_CLOCK_MEM, &dynamic_info->mem_clock_speed); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_mem_clock_speed_valid, dynamic_info->valid); // Memory max speed last_nvml_return_status = nvmlDeviceGetMaxClockInfo(device, NVML_CLOCK_MEM, &dynamic_info->mem_clock_speed_max); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_mem_clock_speed_max_valid, dynamic_info->valid); // CPU and Memory utilization rates nvmlUtilization_t utilization_percentages; last_nvml_return_status = nvmlDeviceGetUtilizationRates(device, &utilization_percentages); if (last_nvml_return_status == NVML_SUCCESS) { SET_GPUINFO_DYNAMIC(dynamic_info, gpu_util_rate, utilization_percentages.gpu); } // Encoder utilization rate unsigned ignored_period; last_nvml_return_status = nvmlDeviceGetEncoderUtilization(device, &dynamic_info->encoder_rate, &ignored_period); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_encoder_rate_valid, dynamic_info->valid); // Decoder utilization rate last_nvml_return_status = nvmlDeviceGetDecoderUtilization(device, &dynamic_info->decoder_rate, &ignored_period); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_decoder_rate_valid, dynamic_info->valid); // Device memory info (total,used,free) nvmlMemory_t memory_info; last_nvml_return_status = nvmlDeviceGetMemoryInfo(device, &memory_info); if (last_nvml_return_status == NVML_SUCCESS) { SET_GPUINFO_DYNAMIC(dynamic_info, total_memory, memory_info.total); SET_GPUINFO_DYNAMIC(dynamic_info, used_memory, memory_info.used); SET_GPUINFO_DYNAMIC(dynamic_info, free_memory, memory_info.free); SET_GPUINFO_DYNAMIC(dynamic_info, mem_util_rate, memory_info.used * 100 / memory_info.total); } // Pcie generation used by the device last_nvml_return_status = nvmlDeviceGetCurrPcieLinkGeneration(device, &dynamic_info->pcie_link_gen); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_pcie_link_gen_valid, dynamic_info->valid); // Pcie width used by the device last_nvml_return_status = nvmlDeviceGetCurrPcieLinkWidth(device, &dynamic_info->pcie_link_width); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_pcie_link_width_valid, dynamic_info->valid); // Pcie reception throughput last_nvml_return_status = nvmlDeviceGetPcieThroughput(device, NVML_PCIE_UTIL_RX_BYTES, &dynamic_info->pcie_rx); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_pcie_rx_valid, dynamic_info->valid); // Pcie transmission throughput last_nvml_return_status = nvmlDeviceGetPcieThroughput(device, NVML_PCIE_UTIL_TX_BYTES, &dynamic_info->pcie_tx); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_pcie_tx_valid, dynamic_info->valid); // Fan speed last_nvml_return_status = nvmlDeviceGetFanSpeed(device, &dynamic_info->fan_speed); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_fan_speed_valid, dynamic_info->valid); // GPU temperature last_nvml_return_status = nvmlDeviceGetTemperature(device, NVML_TEMPERATURE_GPU, &dynamic_info->gpu_temp); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_gpu_temp_valid, dynamic_info->valid); // Device power usage last_nvml_return_status = nvmlDeviceGetPowerUsage(device, &dynamic_info->power_draw); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_power_draw_valid, dynamic_info->valid); // Maximum enforced power usage last_nvml_return_status = nvmlDeviceGetEnforcedPowerLimit(device, &dynamic_info->power_draw_max); if (last_nvml_return_status == NVML_SUCCESS) SET_VALID(gpuinfo_power_draw_max_valid, dynamic_info->valid); } static void gpuinfo_nvidia_get_process_utilization(struct gpu_info_nvidia *gpu_info, unsigned num_processes_recovered, struct gpu_process processes[num_processes_recovered]) { nvmlDevice_t device = gpu_info->gpuhandle; if (num_processes_recovered && nvmlDeviceGetProcessUtilization) { unsigned samples_count = 0; nvmlReturn_t retval = nvmlDeviceGetProcessUtilization(device, NULL, &samples_count, gpu_info->last_utilization_timestamp); if (retval != NVML_ERROR_INSUFFICIENT_SIZE) return; nvmlProcessUtilizationSample_t *samples = malloc(samples_count * sizeof(*samples)); retval = nvmlDeviceGetProcessUtilization(device, samples, &samples_count, gpu_info->last_utilization_timestamp); if (retval != NVML_SUCCESS) { free(samples); return; } unsigned long long newest_timestamp_candidate = gpu_info->last_utilization_timestamp; for (unsigned i = 0; i < samples_count; ++i) { bool process_matched = false; for (unsigned j = 0; !process_matched && j < num_processes_recovered; ++j) { // Filter out samples due to inconsistency in the results returned by // the function nvmlDeviceGetProcessUtilization (see bug #110 on // Github). Check for a valid running process returned by // nvmlDeviceGetComputeRunningProcesses or // nvmlDeviceGetGraphicsRunningProcesses, filter out inconsistent // utilization value greater than 100% and filter out timestamp results // that are less recent than what we were asking for if ((pid_t)samples[i].pid == processes[j].pid && samples[i].smUtil <= 100 && samples[i].encUtil <= 100 && samples[i].decUtil <= 100 && samples[i].timeStamp > gpu_info->last_utilization_timestamp) { // Collect the largest valid timestamp for this device to filter out // the samples during the next call to the function // nvmlDeviceGetProcessUtilization if (samples[i].timeStamp > newest_timestamp_candidate) newest_timestamp_candidate = samples[i].timeStamp; SET_GPUINFO_PROCESS(&processes[j], gpu_usage, samples[i].smUtil); SET_GPUINFO_PROCESS(&processes[j], encode_usage, samples[i].encUtil); SET_GPUINFO_PROCESS(&processes[j], decode_usage, samples[i].decUtil); process_matched = true; } } } gpu_info->last_utilization_timestamp = newest_timestamp_candidate; free(samples); } } static void gpuinfo_nvidia_get_running_processes(struct gpu_info *_gpu_info) { struct gpu_info_nvidia *gpu_info = container_of(_gpu_info, struct gpu_info_nvidia, base); nvmlDevice_t device = gpu_info->gpuhandle; _gpu_info->processes_count = 0; static size_t array_size = 0; static nvmlProcessInfo_t *retrieved_infos = NULL; unsigned graphical_count = 0, compute_count = 0, recovered_count; retry_query_graphical: recovered_count = array_size; last_nvml_return_status = nvmlDeviceGetGraphicsRunningProcesses(device, &recovered_count, retrieved_infos); if (last_nvml_return_status == NVML_ERROR_INSUFFICIENT_SIZE) { array_size += COMMON_PROCESS_LINEAR_REALLOC_INC; retrieved_infos = reallocarray(retrieved_infos, array_size, sizeof(*retrieved_infos)); if (!retrieved_infos) { perror("Could not re-allocate memory: "); exit(EXIT_FAILURE); } goto retry_query_graphical; } if (last_nvml_return_status == NVML_SUCCESS) { graphical_count = recovered_count; } retry_query_compute: recovered_count = array_size - graphical_count; last_nvml_return_status = nvmlDeviceGetComputeRunningProcesses(device, &recovered_count, retrieved_infos + graphical_count); if (last_nvml_return_status == NVML_ERROR_INSUFFICIENT_SIZE) { array_size += COMMON_PROCESS_LINEAR_REALLOC_INC; retrieved_infos = reallocarray(retrieved_infos, array_size, sizeof(*retrieved_infos)); if (!retrieved_infos) { perror("Could not re-allocate memory: "); exit(EXIT_FAILURE); } goto retry_query_compute; } if (last_nvml_return_status == NVML_SUCCESS) { compute_count = recovered_count; } _gpu_info->processes_count = graphical_count + compute_count; if (_gpu_info->processes_count > 0) { if (_gpu_info->processes_count > _gpu_info->processes_array_size) { _gpu_info->processes_array_size = _gpu_info->processes_count + COMMON_PROCESS_LINEAR_REALLOC_INC; _gpu_info->processes = reallocarray(_gpu_info->processes, _gpu_info->processes_array_size, sizeof(*_gpu_info->processes)); if (!_gpu_info->processes) { perror("Could not allocate memory: "); exit(EXIT_FAILURE); } } memset(_gpu_info->processes, 0, _gpu_info->processes_count * sizeof(*_gpu_info->processes)); for (unsigned i = 0; i < graphical_count + compute_count; ++i) { if (i < graphical_count) _gpu_info->processes[i].type = gpu_process_graphical; else _gpu_info->processes[i].type = gpu_process_compute; _gpu_info->processes[i].pid = retrieved_infos[i].pid; _gpu_info->processes[i].gpu_memory_usage = retrieved_infos[i].usedGpuMemory; SET_VALID(gpuinfo_process_gpu_memory_usage_valid, _gpu_info->processes[i].valid); } } gpuinfo_nvidia_get_process_utilization(gpu_info, _gpu_info->processes_count, _gpu_info->processes); } nvtop-3.0.2/src/extract_processinfo_fdinfo.c000066400000000000000000000230641444130114000212230ustar00rootroot00000000000000/* * Copyright (C) 2022 YiFei Zhu * Copyright (C) 2022 Maxime Schmitt * * This file is part of Nvtop and adapted from radeontop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/extract_processinfo_fdinfo.h" #include "nvtop/common.h" #include #include #include #include #include #include #include #include #include struct callback_entry { struct gpu_info *gpu_info; processinfo_fdinfo_callback callback; }; static unsigned registered_callback_entries; #define FDINFO_CALLBACK_ARRAY_INCREMENT 4 static unsigned callback_entries_size; static struct callback_entry *callback_entries; void processinfo_drop_callback(const struct gpu_info *info) { for (unsigned index = 0; index < registered_callback_entries; ++index) { if (callback_entries[index].gpu_info == info) { memmove(&callback_entries[index], &callback_entries[index + 1], (registered_callback_entries - index) * sizeof(*callback_entries)); return; } } } void processinfo_register_fdinfo_callback(processinfo_fdinfo_callback callback, struct gpu_info *info) { if (callback_entries_size == registered_callback_entries) { callback_entries_size += FDINFO_CALLBACK_ARRAY_INCREMENT; callback_entries = reallocarray(callback_entries, callback_entries_size, sizeof(*callback_entries)); if (!callback_entries) { perror("Could not re-allocate memory: "); exit(EXIT_FAILURE); } } callback_entries[registered_callback_entries].gpu_info = info; callback_entries[registered_callback_entries].callback = callback; registered_callback_entries++; } static bool is_drm_fd(int fd_dir_fd, const char *name) { struct stat stat; int ret; ret = fstatat(fd_dir_fd, name, &stat, 0); return ret == 0 && (stat.st_mode & S_IFMT) == S_IFCHR && major(stat.st_rdev) == 226; } // Increment for the number DRM FD tracked per process // 8 has been experimentally selected for being small while avoiding multipe allocations in most common cases #define DRM_FD_LINEAR_REALLOC_INC 8 void processinfo_sweep_fdinfos(void) { if (registered_callback_entries == 0) return; DIR *proc_dir = opendir("/proc"); if (!proc_dir) return; static unsigned seen_fds_capacity = 0; static int *seen_fds = NULL; struct dirent *proc_dent; while ((proc_dent = readdir(proc_dir)) != NULL) { int pid_dir_fd = -1, fd_dir_fd = -1, fdinfo_dir_fd = -1; DIR *fdinfo_dir = NULL; unsigned int seen_fds_len = 0; struct dirent *fdinfo_dent; unsigned int client_pid; if (proc_dent->d_type != DT_DIR) continue; if (!isdigit(proc_dent->d_name[0])) continue; pid_dir_fd = openat(dirfd(proc_dir), proc_dent->d_name, O_DIRECTORY); if (pid_dir_fd < 0) continue; client_pid = atoi(proc_dent->d_name); if (!client_pid) goto next; fd_dir_fd = openat(pid_dir_fd, "fd", O_DIRECTORY); if (fd_dir_fd < 0) goto next; fdinfo_dir_fd = openat(pid_dir_fd, "fdinfo", O_DIRECTORY); if (fdinfo_dir_fd < 0) goto next; fdinfo_dir = fdopendir(fdinfo_dir_fd); if (!fdinfo_dir) { close(fdinfo_dir_fd); goto next; } next_fd: while ((fdinfo_dent = readdir(fdinfo_dir)) != NULL) { struct gpu_process processes_info_local = {0}; int fd_num; if (fdinfo_dent->d_type != DT_REG) continue; if (!isdigit(fdinfo_dent->d_name[0])) continue; if (!is_drm_fd(fd_dir_fd, fdinfo_dent->d_name)) continue; fd_num = atoi(fdinfo_dent->d_name); // check if this fd refers to the same open file as any seen ones. // we only care about unique opens for (unsigned i = 0; i < seen_fds_len; i++) { if (syscall(SYS_kcmp, client_pid, client_pid, KCMP_FILE, fd_num, seen_fds[i]) <= 0) goto next_fd; } if (seen_fds_len == seen_fds_capacity) { seen_fds_capacity += DRM_FD_LINEAR_REALLOC_INC; seen_fds = reallocarray(seen_fds, seen_fds_capacity, sizeof(*seen_fds)); if (!seen_fds) { perror("Could not re-allocate memory: "); exit(EXIT_FAILURE); } } seen_fds[seen_fds_len++] = fd_num; int fdinfo_fd = openat(fdinfo_dir_fd, fdinfo_dent->d_name, O_RDONLY); if (fdinfo_fd < 0) continue; FILE *fdinfo_file = fdopen(fdinfo_fd, "r"); if (!fdinfo_file) { close(fdinfo_fd); continue; } bool callback_success = false; struct callback_entry *current_callback = NULL; processes_info_local.pid = client_pid; for (unsigned callback_idx = 0; !callback_success && callback_idx < registered_callback_entries; ++callback_idx) { rewind(fdinfo_file); fflush(fdinfo_file); RESET_ALL(processes_info_local.valid); processes_info_local.type = gpu_process_unknown; current_callback = &callback_entries[callback_idx]; callback_success = current_callback->callback(current_callback->gpu_info, fdinfo_file, &processes_info_local); } fclose(fdinfo_file); if (!callback_success) continue; // Default to graphical type if (processes_info_local.type == gpu_process_unknown) processes_info_local.type = gpu_process_graphical; unsigned process_index = current_callback->gpu_info->processes_count ? current_callback->gpu_info->processes_count - 1 : 0; // Alloc when array is empty or realloc when this pid does not correspond to the last entry and the array is full if ((current_callback->gpu_info->processes_count == 0 || current_callback->gpu_info->processes[process_index].pid != (pid_t)client_pid) && current_callback->gpu_info->processes_count == current_callback->gpu_info->processes_array_size) { current_callback->gpu_info->processes_array_size += COMMON_PROCESS_LINEAR_REALLOC_INC; current_callback->gpu_info->processes = reallocarray(current_callback->gpu_info->processes, current_callback->gpu_info->processes_array_size, sizeof(*current_callback->gpu_info->processes)); if (!current_callback->gpu_info->processes) { perror("Could not re-allocate memory: "); exit(EXIT_FAILURE); } new_empty_process_entry: process_index = current_callback->gpu_info->processes_count++; memset(¤t_callback->gpu_info->processes[process_index], 0, sizeof(*current_callback->gpu_info->processes)); current_callback->gpu_info->processes[process_index].pid = client_pid; } // No alloc/realloc with different pid case if (current_callback->gpu_info->processes_count == 0 || current_callback->gpu_info->processes[process_index].pid != (pid_t)client_pid) { goto new_empty_process_entry; } struct gpu_process *process_info = ¤t_callback->gpu_info->processes[process_index]; process_info->type |= processes_info_local.type; if (GPUINFO_PROCESS_FIELD_VALID(&processes_info_local, gpu_memory_usage)) { SET_GPUINFO_PROCESS(process_info, gpu_memory_usage, process_info->gpu_memory_usage + processes_info_local.gpu_memory_usage); } if (GPUINFO_PROCESS_FIELD_VALID(&processes_info_local, gpu_usage)) { SET_GPUINFO_PROCESS(process_info, gpu_usage, process_info->gpu_usage + processes_info_local.gpu_usage); } if (GPUINFO_PROCESS_FIELD_VALID(&processes_info_local, encode_usage)) { SET_GPUINFO_PROCESS(process_info, encode_usage, process_info->encode_usage + processes_info_local.encode_usage); } if (GPUINFO_PROCESS_FIELD_VALID(&processes_info_local, decode_usage)) { SET_GPUINFO_PROCESS(process_info, decode_usage, process_info->decode_usage + processes_info_local.decode_usage); } if (GPUINFO_PROCESS_FIELD_VALID(&processes_info_local, gfx_engine_used)) { SET_GPUINFO_PROCESS(process_info, gfx_engine_used, process_info->gfx_engine_used + processes_info_local.gfx_engine_used); } if (GPUINFO_PROCESS_FIELD_VALID(&processes_info_local, compute_engine_used)) { SET_GPUINFO_PROCESS(process_info, compute_engine_used, process_info->compute_engine_used + processes_info_local.compute_engine_used); } if (GPUINFO_PROCESS_FIELD_VALID(&processes_info_local, enc_engine_used)) { SET_GPUINFO_PROCESS(process_info, enc_engine_used, process_info->enc_engine_used + processes_info_local.enc_engine_used); } if (GPUINFO_PROCESS_FIELD_VALID(&processes_info_local, dec_engine_used)) { SET_GPUINFO_PROCESS(process_info, dec_engine_used, process_info->dec_engine_used + processes_info_local.dec_engine_used); } } next: if (fdinfo_dir) closedir(fdinfo_dir); if (fd_dir_fd >= 0) close(fd_dir_fd); close(pid_dir_fd); } closedir(proc_dir); return; } nvtop-3.0.2/src/get_process_info_linux.c000066400000000000000000000147761444130114000203730ustar00rootroot00000000000000/* * * Copyright (C) 2017-2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/get_process_info.h" #include #include #include #include #include #include #include #include #define pid_path_size 1024 static char pid_path[pid_path_size]; void get_username_from_pid(pid_t pid, char **buffer) { int written = snprintf(pid_path, pid_path_size, "/proc/%" PRIdMAX, (intmax_t)pid); if (written == pid_path_size) { *buffer = NULL; return; } struct stat folder_stat; int starval = stat(pid_path, &folder_stat); if (starval == -1) { *buffer = NULL; return; } uid_t user_id = folder_stat.st_uid; struct passwd *user_info = getpwuid(user_id); if (user_info == NULL) { *buffer = NULL; return; } size_t namelen = strlen(user_info->pw_name) + 1; *buffer = malloc(namelen * sizeof(**buffer)); strncpy(*buffer, user_info->pw_name, namelen); } #define command_line_increment 32 void get_command_from_pid(pid_t pid, char **buffer) { int written = snprintf(pid_path, pid_path_size, "/proc/%" PRIdMAX "/cmdline", (intmax_t)pid); if (written == pid_path_size) { *buffer = NULL; return; } FILE *pid_file = fopen(pid_path, "r"); if (!pid_file) { *buffer = NULL; return; } size_t size_buffer = command_line_increment; *buffer = malloc(size_buffer); char *current_buffer = *buffer; current_buffer[0] = '\0'; size_t total_read = 0; do { size_t num_read = fread(current_buffer, 1, command_line_increment, pid_file); total_read += num_read; if (num_read == command_line_increment) { size_buffer += command_line_increment; *buffer = realloc(*buffer, size_buffer); current_buffer = &((*buffer)[total_read]); } } while (!feof(pid_file) && !ferror(pid_file)); if (ferror(pid_file)) { fclose(pid_file); free(*buffer); *buffer = NULL; return; } fclose(pid_file); for (size_t i = 0; total_read && i < total_read - 1; ++i) { if ((*buffer)[i] == '\0') (*buffer)[i] = ' '; } } /* * * From man 5 proc of /proc//stat * For clock ticks per second use sysconf(_SC_CLK_TCK) * * enum process_state { * process_running = 'R', * process_sleeping = 'S', * process_sleeping_disk = 'D', * process_zombie = 'Z', * process_stopped = 'T', * process_stopped_tracing = 't', * process_dead = 'X', * process_dead2 = 'x', * process_wake_kill = 'K', * process_waking = 'W', * process_parked = 'P', * }; * * struct stat_parse { * int process_id; * char *executable_filename; * enum process_state process_state; * int parent_pid; * int process_group_id; * int process_session_id; * int process_tty; * int foreground_process_group_id; * unsigned kernel_flag; * unsigned long num_minor_fault; * unsigned long num_minor_fault_children; * unsigned long num_major_fault; * unsigned long num_major_fault_children; * unsigned long user_time; // in clock ticks * unsigned long kernel_time; // in clock ticks * long children_user_time; // in clock ticks * long children_kernel_time; // in clock ticks * long process_priority; * long process_niceness; * long process_num_threads; * long next_sigalarm_time; * unsigned long long process_start_time; * unsigned long process_virt_mem_usage; * long process_resident_mem_usage; * long process_resident_mem_limit; * unsigned long process_text_address_start; * unsigned long process_text_address_end; * unsigned long process_stack_address_start; * unsigned long process_stack_address_current; * unsigned long process_instruction_pointer; * unsigned long process_signals; // Obsolete * unsigned long process_signals_blocked; // Obsolete * unsigned long process_signals_ignored; // Obsolete * unsigned long process_signals_caught; // Obsolete * unsigned long wait_channel_id; * unsigned long process_num_page_swapped; * unsigned long process_and_child_num_page_swapped; * int process_exit_signal_to_parent; * int process_processor; * unsigned process_real_time_priority; * unsigned policy; * long long unsigned total_io_delays; * long unsigned process_guest_time; * long process_children_guest_time; * unsigned long process_data_address_start; * unsigned long process_data_address_end; * unsigned long process_brk_start; * unsigned long process_arguments_address_start; * unsigned long process_arguments_address_end; * unsigned long process_env_vars_address_start; * unsigned long process_env_vars_address_end; * int thread_exit_code; * }; * */ bool get_process_info(pid_t pid, struct process_cpu_usage *usage) { double clock_ticks_per_second = sysconf(_SC_CLK_TCK); size_t page_size = (size_t)sysconf(_SC_PAGESIZE); int written = snprintf(pid_path, pid_path_size, "/proc/%" PRIdMAX "/stat", (intmax_t)pid); if (written == pid_path_size) { return false; } FILE *stat_file = fopen(pid_path, "r"); if (!stat_file) { return false; } nvtop_get_current_time(&usage->timestamp); unsigned long total_user_time; // in clock_ticks unsigned long total_kernel_time; // in clock_ticks unsigned long virtual_memory; // In bytes long resident_memory; // In page number? int retval = fscanf(stat_file, "%*d %*[^)]) %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u " "%*u %lu %lu %*d %*d %*d %*d %*d %*d %*u %lu %ld", &total_user_time, &total_kernel_time, &virtual_memory, &resident_memory); fclose(stat_file); if (retval != 4) return false; usage->total_user_time = total_user_time / clock_ticks_per_second; usage->total_kernel_time = total_kernel_time / clock_ticks_per_second; usage->virtual_memory = virtual_memory; usage->resident_memory = (size_t)resident_memory * page_size; return true; } nvtop-3.0.2/src/info_messages_linux.c000066400000000000000000000054531444130114000176550ustar00rootroot00000000000000/* * * Copyright (C) 2022 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "list.h" #include "nvtop/extract_gpuinfo_common.h" #include "nvtop/info_messages.h" #include #include #include #include static int get_linux_kernel_release(unsigned *major, unsigned *minor, unsigned *patch) { struct utsname uname_str; int retval = uname(&uname_str); if (retval) return retval; int nmatch = sscanf(uname_str.release, "%u.%u.%u", major, minor, patch); return nmatch != 3; } static char *allMessages[] = { "Nvtop won't be able to show AMD GPU processes on your kernel version (requires Linux >= 5.14)", "Nvtop won't be able to show Intel GPU utilization and processes on your kernel version (requires Linux >= 5.19)", "This version of Nvtop is missing support for reporting Intel GPU memory, power, fan and temperature", "This version of Nvtop is missing support for reporting MSM power, fan and temperature", }; static const char *message_array[sizeof(allMessages) / sizeof(*allMessages)]; void get_info_messages(struct list_head *devices, unsigned *num_messages, const char ***messages) { *num_messages = 0; unsigned linux_major, linux_minor, linux_patch; if (get_linux_kernel_release(&linux_major, &linux_minor, &linux_patch)) return; *messages = message_array; bool hasIntel = false; bool hasMSM = false; bool hasAMD = false; struct gpu_info *gpuinfo; list_for_each_entry(gpuinfo, devices, list) { if (strcmp(gpuinfo->vendor->name, "Intel") == 0) { hasIntel = true; } if (strcmp(gpuinfo->vendor->name, "msm") == 0) { hasMSM = true; } if (strcmp(gpuinfo->vendor->name, "AMD") == 0) { hasAMD = true; } } if (hasAMD) { if (linux_major < 5 || (linux_major == 5 && linux_minor < 14)) { message_array[(*num_messages)++] = allMessages[0]; } } if (hasIntel) { if (linux_major < 5 || (linux_major == 5 && linux_minor < 19)) { message_array[(*num_messages)++] = allMessages[1]; } message_array[(*num_messages)++] = allMessages[2]; } if (hasMSM) { message_array[(*num_messages)++] = allMessages[3]; } } nvtop-3.0.2/src/ini.c000066400000000000000000000162461444130114000143750ustar00rootroot00000000000000/* inih -- simple .INI file parser SPDX-License-Identifier: BSD-3-Clause Copyright (C) 2009-2020, Ben Hoyt inih is released under the New BSD license (see LICENSE.txt). Go to the project home page for more info: https://github.com/benhoyt/inih */ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) #define _CRT_SECURE_NO_WARNINGS #endif #include #include #include #include "ini.h" #if !INI_USE_STACK #if INI_CUSTOM_ALLOCATOR #include void *ini_malloc(size_t size); void ini_free(void *ptr); void *ini_realloc(void *ptr, size_t size); #else #include #define ini_malloc malloc #define ini_free free #define ini_realloc realloc #endif #endif #define MAX_SECTION 50 #define MAX_NAME 50 /* Used by ini_parse_string() to keep track of string parsing state. */ typedef struct { const char *ptr; size_t num_left; } ini_parse_string_ctx; /* Strip whitespace chars off end of given string, in place. Return s. */ static char *rstrip(char *s) { char *p = s + strlen(s); while (p > s && isspace((unsigned char)(*--p))) *p = '\0'; return s; } /* Return pointer to first non-whitespace char in given string. */ static char *lskip(const char *s) { while (*s && isspace((unsigned char)(*s))) s++; return (char *)s; } /* Return pointer to first char (of chars) or inline comment in given string, or pointer to NUL at end of string if neither found. Inline comment must be prefixed by a whitespace character to register as a comment. */ static char *find_chars_or_comment(const char *s, const char *chars) { #if INI_ALLOW_INLINE_COMMENTS int was_space = 0; while (*s && (!chars || !strchr(chars, *s)) && !(was_space && strchr(INI_INLINE_COMMENT_PREFIXES, *s))) { was_space = isspace((unsigned char)(*s)); s++; } #else while (*s && (!chars || !strchr(chars, *s))) { s++; } #endif return (char *)s; } /* Similar to strncpy, but ensures dest (size bytes) is NUL-terminated, and doesn't pad with NULs. */ static char *strncpy0(char *dest, const char *src, size_t size) { /* Could use strncpy internally, but it causes gcc warnings (see issue #91) */ size_t i; for (i = 0; i < size - 1 && src[i]; i++) dest[i] = src[i]; dest[i] = '\0'; return dest; } /* See documentation in header file. */ int ini_parse_stream(ini_reader reader, void *stream, ini_handler handler, void *user) { /* Uses a fair bit of stack (use heap instead if you need to) */ #if INI_USE_STACK char line[INI_MAX_LINE]; int max_line = INI_MAX_LINE; #else char *line; size_t max_line = INI_INITIAL_ALLOC; #endif #if INI_ALLOW_REALLOC && !INI_USE_STACK char *new_line; size_t offset; #endif char section[MAX_SECTION] = ""; char prev_name[MAX_NAME] = ""; char *start; char *end; char *name; char *value; int lineno = 0; int error = 0; #if !INI_USE_STACK line = (char *)ini_malloc(INI_INITIAL_ALLOC); if (!line) { return -2; } #endif #if INI_HANDLER_LINENO #define HANDLER(u, s, n, v) handler(u, s, n, v, lineno) #else #define HANDLER(u, s, n, v) handler(u, s, n, v) #endif /* Scan through stream line by line */ while (reader(line, (int)max_line, stream) != NULL) { #if INI_ALLOW_REALLOC && !INI_USE_STACK offset = strlen(line); while (offset == max_line - 1 && line[offset - 1] != '\n') { max_line *= 2; if (max_line > INI_MAX_LINE) max_line = INI_MAX_LINE; new_line = ini_realloc(line, max_line); if (!new_line) { ini_free(line); return -2; } line = new_line; if (reader(line + offset, (int)(max_line - offset), stream) == NULL) break; if (max_line >= INI_MAX_LINE) break; offset += strlen(line + offset); } #endif lineno++; start = line; #if INI_ALLOW_BOM if (lineno == 1 && (unsigned char)start[0] == 0xEF && (unsigned char)start[1] == 0xBB && (unsigned char)start[2] == 0xBF) { start += 3; } #endif start = lskip(rstrip(start)); if (strchr(INI_START_COMMENT_PREFIXES, *start)) { /* Start-of-line comment */ } #if INI_ALLOW_MULTILINE else if (*prev_name && *start && start > line) { /* Non-blank line with leading whitespace, treat as continuation of previous name's value (as per Python configparser). */ if (!HANDLER(user, section, prev_name, start) && !error) error = lineno; } #endif else if (*start == '[') { /* A "[section]" line */ end = find_chars_or_comment(start + 1, "]"); if (*end == ']') { *end = '\0'; strncpy0(section, start + 1, sizeof(section)); *prev_name = '\0'; #if INI_CALL_HANDLER_ON_NEW_SECTION if (!HANDLER(user, section, NULL, NULL) && !error) error = lineno; #endif } else if (!error) { /* No ']' found on section line */ error = lineno; } } else if (*start) { /* Not a comment, must be a name[=:]value pair */ end = find_chars_or_comment(start, "=:"); if (*end == '=' || *end == ':') { *end = '\0'; name = rstrip(start); value = end + 1; #if INI_ALLOW_INLINE_COMMENTS end = find_chars_or_comment(value, NULL); if (*end) *end = '\0'; #endif value = lskip(value); rstrip(value); /* Valid name[=:]value pair found, call handler */ strncpy0(prev_name, name, sizeof(prev_name)); if (!HANDLER(user, section, name, value) && !error) error = lineno; } else if (!error) { /* No '=' or ':' found on name[=:]value line */ #if INI_ALLOW_NO_VALUE *end = '\0'; name = rstrip(start); if (!HANDLER(user, section, name, NULL) && !error) error = lineno; #else error = lineno; #endif } } #if INI_STOP_ON_FIRST_ERROR if (error) break; #endif } #if !INI_USE_STACK ini_free(line); #endif return error; } /* See documentation in header file. */ int ini_parse_file(FILE *file, ini_handler handler, void *user) { return ini_parse_stream((ini_reader)fgets, file, handler, user); } /* See documentation in header file. */ int ini_parse(const char *filename, ini_handler handler, void *user) { FILE *file; int error; file = fopen(filename, "r"); if (!file) return -1; error = ini_parse_file(file, handler, user); fclose(file); return error; } /* An ini_reader function to read the next line from a string buffer. This is the fgets() equivalent used by ini_parse_string(). */ static char *ini_reader_string(char *str, int num, void *stream) { ini_parse_string_ctx *ctx = (ini_parse_string_ctx *)stream; const char *ctx_ptr = ctx->ptr; size_t ctx_num_left = ctx->num_left; char *strp = str; char c; if (ctx_num_left == 0 || num < 2) return NULL; while (num > 1 && ctx_num_left != 0) { c = *ctx_ptr++; ctx_num_left--; *strp++ = c; if (c == '\n') break; num--; } *strp = '\0'; ctx->ptr = ctx_ptr; ctx->num_left = ctx_num_left; return str; } /* See documentation in header file. */ int ini_parse_string(const char *string, ini_handler handler, void *user) { ini_parse_string_ctx ctx; ctx.ptr = string; ctx.num_left = strlen(string); return ini_parse_stream((ini_reader)ini_reader_string, &ctx, handler, user); } nvtop-3.0.2/src/interface.c000066400000000000000000002303021444130114000155450ustar00rootroot00000000000000/* * * Copyright (C) 2017-2022 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/interface.h" #include "nvtop/common.h" #include "nvtop/extract_gpuinfo.h" #include "nvtop/extract_gpuinfo_common.h" #include "nvtop/interface_common.h" #include "nvtop/interface_internal_common.h" #include "nvtop/interface_layout_selection.h" #include "nvtop/interface_options.h" #include "nvtop/interface_ring_buffer.h" #include "nvtop/interface_setup_win.h" #include "nvtop/plot.h" #include "nvtop/time.h" #include #include #include #include #include #include #include #include #include static unsigned int sizeof_device_field[device_field_count] = { [device_name] = 11, [device_fan_speed] = 8, [device_temperature] = 10, [device_power] = 15, [device_clock] = 11, [device_pcie] = 46, }; static unsigned int sizeof_process_field[process_field_count] = { [process_pid] = 7, [process_user] = 4, [process_gpu_id] = 3, [process_type] = 8, [process_gpu_rate] = 4, [process_enc_rate] = 4, [process_dec_rate] = 4, [process_memory] = 14, // 9 for mem 5 for % [process_cpu_usage] = 6, [process_cpu_mem_usage] = 9, [process_command] = 0, }; static void alloc_device_window(unsigned int start_row, unsigned int start_col, unsigned int totalcol, struct device_window *dwin) { const unsigned int spacer = 1; // Line 1 = Name | PCIe info dwin->name_win = newwin(1, sizeof_device_field[device_name], start_row, start_col); if (dwin->name_win == NULL) goto alloc_error; dwin->pcie_info = newwin(1, sizeof_device_field[device_pcie], start_row, start_col + spacer + sizeof_device_field[device_name]); if (dwin->pcie_info == NULL) goto alloc_error; // Line 2 = GPU clk | MEM clk | Temp | Fan | Power dwin->gpu_clock_info = newwin(1, sizeof_device_field[device_clock], start_row + 1, start_col); if (dwin->gpu_clock_info == NULL) goto alloc_error; dwin->mem_clock_info = newwin(1, sizeof_device_field[device_clock], start_row + 1, start_col + spacer + sizeof_device_field[device_clock]); if (dwin->mem_clock_info == NULL) goto alloc_error; dwin->temperature = newwin(1, sizeof_device_field[device_temperature], start_row + 1, start_col + spacer * 2 + sizeof_device_field[device_clock] * 2); if (dwin->temperature == NULL) goto alloc_error; dwin->fan_speed = newwin(1, sizeof_device_field[device_fan_speed], start_row + 1, start_col + spacer * 3 + sizeof_device_field[device_clock] * 2 + sizeof_device_field[device_temperature]); if (dwin->fan_speed == NULL) goto alloc_error; dwin->power_info = newwin(1, sizeof_device_field[device_power], start_row + 1, start_col + spacer * 4 + sizeof_device_field[device_clock] * 2 + sizeof_device_field[device_temperature] + sizeof_device_field[device_fan_speed]); if (dwin->power_info == NULL) goto alloc_error; // Line 3 = GPU used | MEM used | Encoder | Decoder int remaining_cols = totalcol - 3 * spacer; int size_gpu, size_mem, size_encode, size_decode; int quot, rem; quot = remaining_cols / 3; rem = remaining_cols % 3; size_gpu = size_mem = size_encode = quot; switch (rem) { case 2: if (size_encode % 2 == 1) size_encode += 1; else size_mem += 1; /* Falls through */ case 1: size_gpu += 1; break; } if (size_encode % 2 == 1) { size_mem += 1; size_encode -= 1; } if (size_encode / 2 < 14) { size_encode += 2; size_gpu -= 1; size_mem -= 1; } size_decode = size_encode / 2; if (size_encode % 2 == 1) size_encode += 1; size_encode /= 2; dwin->gpu_util_enc_dec = newwin(1, size_gpu, start_row + 2, start_col); if (dwin->gpu_util_enc_dec == NULL) goto alloc_error; dwin->mem_util_enc_dec = newwin(1, size_mem, start_row + 2, start_col + spacer + size_gpu); if (dwin->mem_util_enc_dec == NULL) goto alloc_error; dwin->encode_util = newwin(1, size_encode, start_row + 2, start_col + spacer * 2 + size_gpu + size_mem); if (dwin->encode_util == NULL) goto alloc_error; dwin->decode_util = newwin(1, size_decode, start_row + 2, start_col + spacer * 3 + size_gpu + size_mem + size_encode); if (dwin->decode_util == NULL) goto alloc_error; // For auto-hide encode / decode window dwin->gpu_util_no_enc_or_dec = newwin(1, size_gpu + size_encode / 2 + 1, start_row + 2, start_col); if (dwin->gpu_util_no_enc_or_dec == NULL) goto alloc_error; dwin->mem_util_no_enc_or_dec = newwin(1, size_mem + size_encode / 2, start_row + 2, start_col + spacer + size_gpu + size_encode / 2 + 1); if (dwin->mem_util_no_enc_or_dec == NULL) goto alloc_error; dwin->gpu_util_no_enc_and_dec = newwin(1, size_gpu + size_encode + 1, start_row + 2, start_col); if (dwin->gpu_util_no_enc_and_dec == NULL) goto alloc_error; dwin->mem_util_no_enc_and_dec = newwin(1, size_mem + size_encode + 1, start_row + 2, start_col + spacer + size_gpu + size_encode + 1); if (dwin->mem_util_no_enc_and_dec == NULL) goto alloc_error; dwin->enc_was_visible = false; dwin->dec_was_visible = false; return; alloc_error: endwin(); fprintf(stderr, "Error: Not enough columns to draw device information\n"); exit(EXIT_FAILURE); } static void free_device_windows(struct device_window *dwin) { delwin(dwin->name_win); delwin(dwin->gpu_util_enc_dec); delwin(dwin->mem_util_enc_dec); delwin(dwin->gpu_util_no_enc_or_dec); delwin(dwin->mem_util_no_enc_or_dec); delwin(dwin->gpu_util_no_enc_and_dec); delwin(dwin->mem_util_no_enc_and_dec); delwin(dwin->encode_util); delwin(dwin->decode_util); delwin(dwin->gpu_clock_info); delwin(dwin->mem_clock_info); delwin(dwin->power_info); delwin(dwin->temperature); delwin(dwin->fan_speed); delwin(dwin->pcie_info); } static void alloc_process_with_option(struct nvtop_interface *interface, unsigned posX, unsigned posY, unsigned sizeX, unsigned sizeY) { if (sizeY > 0) { interface->process.process_win = newwin(sizeY, sizeX, posY, posX); interface->process.process_with_option_win = newwin(sizeY, sizeX - option_window_size, posY, posX + option_window_size); } else { interface->process.process_win = NULL; interface->process.process_with_option_win = NULL; } interface->process.selected_row = 0; interface->process.selected_pid = -1; interface->process.offset_column = 0; interface->process.offset = 0; interface->process.option_window.option_win = newwin(sizeY, option_window_size, posY, posX); interface->process.option_window.state = nvtop_option_state_hidden; interface->process.option_window.previous_state = nvtop_option_state_sort_by; interface->process.option_window.offset = 0; interface->process.option_window.selected_row = 0; } static void initialize_gpu_mem_plot(struct plot_window *plot, struct window_position *position, nvtop_interface_option *options) { unsigned rows = position->sizeY; unsigned cols = position->sizeX; cols -= 5; rows -= 2; plot->plot_window = newwin(rows, cols, position->posY + 1, position->posX + 4); draw_rectangle(plot->win, 3, 0, cols + 2, rows + 2); mvwprintw(plot->win, 1 + rows * 3 / 4, 0, " 25"); mvwprintw(plot->win, 1 + rows / 4, 0, " 75"); mvwprintw(plot->win, 1 + rows / 2, 0, " 50"); mvwprintw(plot->win, 1, 0, "100"); mvwprintw(plot->win, rows, 0, " 0"); plot->data = calloc(cols, sizeof(*plot->data)); plot->num_data = cols; unsigned column_divisor = 0; for (unsigned i = 0; i < plot->num_devices_to_plot; ++i) { unsigned dev_id = plot->devices_ids[i]; plot_info_to_draw to_draw = options->gpu_specific_opts[dev_id].to_draw; column_divisor += plot_count_draw_info(to_draw); } assert(column_divisor > 0); char elapsedSeconds[5]; char *err = "err"; char *zeroSec = "0s"; if (options->plot_left_to_right) { char *toPrint = zeroSec; mvwprintw(plot->win, position->sizeY - 1, 4, "%s", toPrint); int retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / 4 / column_divisor / 1000); if (retval > 4) toPrint = err; else toPrint = elapsedSeconds; mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 4 - strlen(toPrint) / 2, "%s", toPrint); retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / 2 / column_divisor / 1000); if (retval > 4) toPrint = err; else toPrint = elapsedSeconds; mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 2 - strlen(toPrint) / 2, "%s", toPrint); retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols * 3 / 4 / column_divisor / 1000); if (retval > 4) toPrint = err; else toPrint = elapsedSeconds; mvwprintw(plot->win, position->sizeY - 1, 4 + cols * 3 / 4 - strlen(toPrint) / 2, "%s", toPrint); retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / column_divisor / 1000); if (retval > 4) toPrint = err; else toPrint = elapsedSeconds; mvwprintw(plot->win, position->sizeY - 1, 4 + cols - strlen(toPrint), "%s", toPrint); } else { char *toPrint; int retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / column_divisor / 1000); if (retval > 4) toPrint = err; else toPrint = elapsedSeconds; mvwprintw(plot->win, position->sizeY - 1, 4, "%s", toPrint); retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols * 3 / 4 / column_divisor / 1000); if (retval > 4) toPrint = err; else toPrint = elapsedSeconds; mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 4 - strlen(toPrint) / 2, "%s", toPrint); retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / 2 / column_divisor / 1000); if (retval > 4) toPrint = err; else toPrint = elapsedSeconds; mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 2 - strlen(toPrint) / 2, "%s", toPrint); retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / 4 / column_divisor / 1000); if (retval > 4) toPrint = err; else toPrint = elapsedSeconds; mvwprintw(plot->win, position->sizeY - 1, 4 + cols * 3 / 4 - strlen(toPrint) / 2, "%s", toPrint); toPrint = zeroSec; mvwprintw(plot->win, position->sizeY - 1, 4 + cols - strlen(toPrint), "%s", toPrint); } wnoutrefresh(plot->win); } static void alloc_plot_window(unsigned devices_count, struct window_position *plot_positions, unsigned map_device_to_plot[devices_count], struct nvtop_interface *interface) { if (!interface->num_plots) { interface->plots = NULL; return; } interface->plots = malloc(interface->num_plots * sizeof(*interface->plots)); for (size_t i = 0; i < interface->num_plots; ++i) { interface->plots[i].num_devices_to_plot = 0; for (unsigned dev_id = 0; dev_id < devices_count; ++dev_id) { if (map_device_to_plot[dev_id] == i) { interface->plots[i].devices_ids[interface->plots[i].num_devices_to_plot] = dev_id; interface->plots[i].num_devices_to_plot++; } } interface->plots[i].win = newwin(plot_positions[i].sizeY, plot_positions[i].sizeX, plot_positions[i].posY, plot_positions[i].posX); initialize_gpu_mem_plot(&interface->plots[i], &plot_positions[i], &interface->options); } } static unsigned device_length(void) { return max(sizeof_device_field[device_name] + sizeof_device_field[device_pcie] + 1, 2 * sizeof_device_field[device_clock] + sizeof_device_field[device_temperature] + sizeof_device_field[device_fan_speed] + sizeof_device_field[device_power] + 4); } static pid_t nvtop_pid; static void initialize_all_windows(struct nvtop_interface *dwin) { int rows, cols; getmaxyx(stdscr, rows, cols); unsigned int devices_count = dwin->monitored_dev_count; struct window_position device_positions[devices_count]; unsigned map_device_to_plot[devices_count]; struct window_position process_position; struct window_position plot_positions[MAX_CHARTS]; struct window_position setup_position; compute_sizes_from_layout(devices_count, 3, device_length(), rows - 1, cols, dwin->options.gpu_specific_opts, dwin->options.process_fields_displayed, device_positions, &dwin->num_plots, plot_positions, map_device_to_plot, &process_position, &setup_position); alloc_plot_window(devices_count, plot_positions, map_device_to_plot, dwin); for (unsigned int i = 0; i < devices_count; ++i) { alloc_device_window(device_positions[i].posY, device_positions[i].posX, device_positions[i].sizeX, &dwin->devices_win[i]); } alloc_process_with_option(dwin, process_position.posX, process_position.posY, process_position.sizeX, process_position.sizeY); dwin->shortcut_window = newwin(1, cols, rows - 1, 0); alloc_setup_window(&setup_position, &dwin->setup_win); nvtop_pid = getpid(); } static void delete_all_windows(struct nvtop_interface *dwin) { for (unsigned int i = 0; i < dwin->monitored_dev_count; ++i) { free_device_windows(&dwin->devices_win[i]); } delwin(dwin->process.process_win); delwin(dwin->process.process_with_option_win); dwin->process.process_win = NULL; dwin->process.process_with_option_win = NULL; delwin(dwin->shortcut_window); delwin(dwin->process.option_window.option_win); for (size_t i = 0; i < dwin->num_plots; ++i) { delwin(dwin->plots[i].win); free(dwin->plots[i].data); } free_setup_window(&dwin->setup_win); free(dwin->plots); } static void initialize_colors(void) { start_color(); short background_color; #ifdef NCURSES_VERSION if (use_default_colors() == OK) background_color = -1; else background_color = COLOR_BLACK; #else background_color = COLOR_BLACK; #endif init_pair(cyan_color, COLOR_CYAN, background_color); init_pair(red_color, COLOR_RED, background_color); init_pair(green_color, COLOR_GREEN, background_color); init_pair(yellow_color, COLOR_YELLOW, background_color); init_pair(blue_color, COLOR_BLUE, background_color); init_pair(magenta_color, COLOR_MAGENTA, background_color); } struct nvtop_interface *initialize_curses(unsigned total_devices, unsigned devices_count, unsigned largest_device_name, nvtop_interface_option options) { struct nvtop_interface *interface = calloc(1, sizeof(*interface)); interface->options = options; interface->devices_win = calloc(devices_count, sizeof(*interface->devices_win)); interface->total_dev_count = total_devices; interface->monitored_dev_count = devices_count; sizeof_device_field[device_name] = largest_device_name + 11; initscr(); refresh(); if (interface->options.use_color && has_colors() == TRUE) { initialize_colors(); } cbreak(); noecho(); keypad(stdscr, TRUE); curs_set(0); // Hide decode and encode if not active for some time if (interface->options.encode_decode_hiding_timer > 0.) { nvtop_time time_now, some_time_in_past; some_time_in_past = nvtop_hmns_to_time(0, (unsigned int)(interface->options.encode_decode_hiding_timer / 60.) + 1, 0); nvtop_get_current_time(&time_now); some_time_in_past = nvtop_substract_time(time_now, some_time_in_past); for (size_t i = 0; i < devices_count; ++i) { interface->devices_win[i].last_encode_seen = some_time_in_past; interface->devices_win[i].last_decode_seen = some_time_in_past; } } interface_alloc_ring_buffer(devices_count, 4, 10 * 60 * 1000, &interface->saved_data_ring); initialize_all_windows(interface); return interface; } void clean_ncurses(struct nvtop_interface *interface) { endwin(); delete_all_windows(interface); free(interface->options.gpu_specific_opts); free(interface->options.config_file_location); free(interface->devices_win); interface_free_ring_buffer(&interface->saved_data_ring); free(interface); } static void draw_percentage_meter(WINDOW *win, const char *prelude, unsigned int new_percentage, const char inside_braces_right[1024]) { int rows, cols; getmaxyx(win, rows, cols); (void)rows; size_t size_prelude = strlen(prelude); wcolor_set(win, cyan_color, NULL); mvwprintw(win, 0, 0, "%s", prelude); wstandend(win); waddch(win, '['); int curx, cury; curx = getcurx(win); cury = getcury(win); int between_sbraces = cols - size_prelude - 2; float usage = round((float)between_sbraces * new_percentage / 100.f); int represent_usage = (int)usage; whline(win, '|', (int)represent_usage); mvwhline(win, cury, curx + represent_usage, ' ', between_sbraces - represent_usage); mvwaddch(win, cury, curx + between_sbraces, ']'); unsigned int right_side_braces_space_required = strlen(inside_braces_right); wmove(win, cury, curx + between_sbraces - right_side_braces_space_required); wprintw(win, "%s", inside_braces_right); mvwchgat(win, cury, curx, represent_usage, 0, green_color, NULL); wnoutrefresh(win); } static const char *memory_prefix[] = {" B", "Ki", "Mi", "Gi", "Ti", "Pi"}; static void draw_temp_color(WINDOW *win, unsigned int temp, unsigned int temp_slowdown, bool celsius) { unsigned int temp_convert; if (celsius) temp_convert = temp; else temp_convert = (unsigned)(32 + nearbyint(temp * 1.8)); wcolor_set(win, cyan_color, NULL); mvwprintw(win, 0, 0, "TEMP"); if (temp >= temp_slowdown - 5) { if (temp >= temp_slowdown) wcolor_set(win, red_color, NULL); else wcolor_set(win, yellow_color, NULL); } else { wcolor_set(win, green_color, NULL); } wprintw(win, " %3u", temp_convert); wstandend(win); waddch(win, ACS_DEGREE); if (celsius) waddch(win, 'C'); else waddch(win, 'F'); wnoutrefresh(win); } static void print_pcie_at_scale(WINDOW *win, unsigned int value) { int prefix_off; double val_d = value; for (prefix_off = 1; prefix_off < 5 && val_d >= 1000.; ++prefix_off) { val_d = val_d / 1024.; } if (val_d >= 100.) { wprintw(win, "%.1f", val_d); } else { if (val_d >= 10.) { wprintw(win, "%.2f", val_d); } else { wprintw(win, "%.3f", val_d); } } wprintw(win, " %sB/s", memory_prefix[prefix_off]); } static inline void werase_and_wnoutrefresh(WINDOW *w) { werase(w); wnoutrefresh(w); } static bool cleaned_enc_window(struct device_window *dev, double encode_decode_hiding_timer, nvtop_time tnow) { if (encode_decode_hiding_timer > 0. && nvtop_difftime(dev->last_encode_seen, tnow) > encode_decode_hiding_timer) { if (dev->enc_was_visible) { dev->enc_was_visible = false; if (dev->dec_was_visible) { werase_and_wnoutrefresh(dev->gpu_util_enc_dec); werase_and_wnoutrefresh(dev->mem_util_enc_dec); } else { werase_and_wnoutrefresh(dev->gpu_util_no_enc_or_dec); werase_and_wnoutrefresh(dev->mem_util_no_enc_or_dec); } } return true; } else { return false; } } static bool cleaned_dec_window(struct device_window *dev, double encode_decode_hiding_timer, nvtop_time tnow) { if (encode_decode_hiding_timer > 0. && nvtop_difftime(dev->last_decode_seen, tnow) > encode_decode_hiding_timer) { if (dev->dec_was_visible) { dev->dec_was_visible = false; if (dev->enc_was_visible) { werase_and_wnoutrefresh(dev->gpu_util_enc_dec); werase_and_wnoutrefresh(dev->mem_util_enc_dec); } else { werase_and_wnoutrefresh(dev->gpu_util_no_enc_or_dec); werase_and_wnoutrefresh(dev->mem_util_no_enc_or_dec); } } return true; } else { return false; } } static void encode_decode_show_select(struct device_window *dev, bool encode_valid, bool decode_valid, unsigned encode_rate, unsigned decode_rate, double encode_decode_hiding_timer, bool encode_decode_shared, bool *display_encode, bool *display_decode) { nvtop_time tnow; nvtop_get_current_time(&tnow); if (encode_valid && encode_rate > 0) { *display_encode = true; dev->last_encode_seen = tnow; if (!dev->enc_was_visible) { dev->enc_was_visible = true; if (!dev->dec_was_visible) { werase_and_wnoutrefresh(dev->gpu_util_no_enc_and_dec); werase_and_wnoutrefresh(dev->mem_util_no_enc_and_dec); } else { werase_and_wnoutrefresh(dev->gpu_util_no_enc_or_dec); werase_and_wnoutrefresh(dev->mem_util_no_enc_or_dec); } } } else { *display_encode = !cleaned_enc_window(dev, encode_decode_hiding_timer, tnow); } // If shared, rely on decode *display_encode = *display_encode && !encode_decode_shared; if (decode_valid && decode_rate > 0) { *display_decode = true; dev->last_decode_seen = tnow; if (!dev->dec_was_visible) { dev->dec_was_visible = true; if (!dev->enc_was_visible) { werase_and_wnoutrefresh(dev->gpu_util_no_enc_and_dec); werase_and_wnoutrefresh(dev->mem_util_no_enc_and_dec); } else { werase_and_wnoutrefresh(dev->gpu_util_no_enc_or_dec); werase_and_wnoutrefresh(dev->mem_util_no_enc_or_dec); } } } else { *display_decode = !cleaned_dec_window(dev, encode_decode_hiding_timer, tnow); } } static void draw_devices(struct list_head *devices, struct nvtop_interface *interface) { struct gpu_info *device; unsigned dev_id = 0; list_for_each_entry(device, devices, list) { struct device_window *dev = &interface->devices_win[dev_id]; wcolor_set(dev->name_win, cyan_color, NULL); mvwprintw(dev->name_win, 0, 0, "Device %-2u", dev_id); wstandend(dev->name_win); if (GPUINFO_STATIC_FIELD_VALID(&device->static_info, device_name)) { wprintw(dev->name_win, "[%s]", device->static_info.device_name); wnoutrefresh(dev->name_win); } else { wprintw(dev->name_win, "[N/A]"); wnoutrefresh(dev->name_win); } bool display_encode = false; bool display_decode = false; encode_decode_show_select(dev, GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, encoder_rate), GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, decoder_rate), device->dynamic_info.encoder_rate, device->dynamic_info.decoder_rate, interface->options.encode_decode_hiding_timer, device->dynamic_info.encode_decode_shared, &display_encode, &display_decode); WINDOW *gpu_util_win; WINDOW *mem_util_win; WINDOW *encode_win = dev->encode_util; WINDOW *decode_win = dev->decode_util; if (display_encode && display_decode) { gpu_util_win = dev->gpu_util_enc_dec; mem_util_win = dev->mem_util_enc_dec; } else { if (display_encode || display_decode) { // If encode only, place at decode location encode_win = dev->decode_util; gpu_util_win = dev->gpu_util_no_enc_or_dec; mem_util_win = dev->mem_util_no_enc_or_dec; } else { gpu_util_win = dev->gpu_util_no_enc_and_dec; mem_util_win = dev->mem_util_no_enc_and_dec; } } char buff[1024]; if (display_encode) { unsigned rate = GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, encoder_rate) ? device->dynamic_info.encoder_rate : 0; snprintf(buff, 1024, "%u%%", rate); draw_percentage_meter(encode_win, "ENC", rate, buff); } if (display_decode) { unsigned rate = GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, decoder_rate) ? device->dynamic_info.decoder_rate : 0; snprintf(buff, 1024, "%u%%", rate); if (device->dynamic_info.encode_decode_shared) draw_percentage_meter(decode_win, "ENC/DEC", rate, buff); else draw_percentage_meter(decode_win, "DEC", rate, buff); } if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, gpu_util_rate)) { snprintf(buff, 1024, "%u%%", device->dynamic_info.gpu_util_rate); draw_percentage_meter(gpu_util_win, "GPU", device->dynamic_info.gpu_util_rate, buff); } else { snprintf(buff, 1024, "N/A"); draw_percentage_meter(gpu_util_win, "GPU", 0, buff); } if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, total_memory) && GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, used_memory)) { double total_mem = device->dynamic_info.total_memory; double used_mem = device->dynamic_info.used_memory; double total_prefixed = total_mem, used_prefixed = used_mem; size_t prefix_off; for (prefix_off = 0; prefix_off < 5 && total_prefixed >= 1000.; ++prefix_off) { total_prefixed /= 1024.; used_prefixed /= 1024.; } snprintf(buff, 1024, "%.3f%s/%.3f%s", used_prefixed, memory_prefix[prefix_off], total_prefixed, memory_prefix[prefix_off]); draw_percentage_meter(mem_util_win, "MEM", (unsigned int)(100. * used_mem / total_mem), buff); } else { snprintf(buff, 1024, "N/A"); draw_percentage_meter(mem_util_win, "MEM", 0, buff); } if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, gpu_temp)) { if (!GPUINFO_STATIC_FIELD_VALID(&device->static_info, temperature_slowdown_threshold)) device->static_info.temperature_slowdown_threshold = 0; draw_temp_color(dev->temperature, device->dynamic_info.gpu_temp, device->static_info.temperature_slowdown_threshold, !interface->options.temperature_in_fahrenheit); } else { mvwprintw(dev->temperature, 0, 0, "TEMP N/A"); waddch(dev->temperature, ACS_DEGREE); if (interface->options.temperature_in_fahrenheit) waddch(dev->temperature, 'F'); else waddch(dev->temperature, 'C'); mvwchgat(dev->temperature, 0, 0, 4, 0, cyan_color, NULL); wnoutrefresh(dev->temperature); } // FAN if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, fan_speed)) mvwprintw(dev->fan_speed, 0, 0, "FAN %3u%%", device->dynamic_info.fan_speed); else if (device->static_info.integrated_graphics) { mvwprintw(dev->fan_speed, 0, 0, "CPU-FAN "); mvwchgat(dev->fan_speed, 0, 3, 5, 0, cyan_color, NULL); } else mvwprintw(dev->fan_speed, 0, 0, "FAN N/A%%"); mvwchgat(dev->fan_speed, 0, 0, 3, 0, cyan_color, NULL); wnoutrefresh(dev->fan_speed); // GPU CLOCK werase(dev->gpu_clock_info); if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, gpu_clock_speed)) mvwprintw(dev->gpu_clock_info, 0, 0, "GPU %uMHz", device->dynamic_info.gpu_clock_speed); else mvwprintw(dev->gpu_clock_info, 0, 0, "GPU N/A MHz"); mvwchgat(dev->gpu_clock_info, 0, 0, 3, 0, cyan_color, NULL); wnoutrefresh(dev->gpu_clock_info); // MEM CLOCK werase(dev->mem_clock_info); if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, mem_clock_speed)) mvwprintw(dev->mem_clock_info, 0, 0, "MEM %uMHz", device->dynamic_info.mem_clock_speed); else mvwprintw(dev->mem_clock_info, 0, 0, "MEM N/A MHz"); mvwchgat(dev->mem_clock_info, 0, 0, 3, 0, cyan_color, NULL); wnoutrefresh(dev->mem_clock_info); // POWER werase(dev->power_info); if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, power_draw) && GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, power_draw_max)) mvwprintw(dev->power_info, 0, 0, "POW %3u / %3u W", device->dynamic_info.power_draw / 1000, device->dynamic_info.power_draw_max / 1000); else if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, power_draw) && !GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, power_draw_max)) mvwprintw(dev->power_info, 0, 0, "POW %3u W", device->dynamic_info.power_draw / 1000); else if (!GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, power_draw) && GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, power_draw_max)) mvwprintw(dev->power_info, 0, 0, "POW N/A / %3u W", device->dynamic_info.power_draw_max / 1000); else mvwprintw(dev->power_info, 0, 0, "POW N/A W"); mvwchgat(dev->power_info, 0, 0, 3, 0, cyan_color, NULL); wnoutrefresh(dev->power_info); // PICe throughput werase(dev->pcie_info); if (device->static_info.integrated_graphics) { wcolor_set(dev->pcie_info, cyan_color, NULL); mvwprintw(dev->pcie_info, 0, 0, "Integrated GPU"); } else { wcolor_set(dev->pcie_info, cyan_color, NULL); mvwprintw(dev->pcie_info, 0, 0, "PCIe "); wcolor_set(dev->pcie_info, magenta_color, NULL); wprintw(dev->pcie_info, "GEN "); wstandend(dev->pcie_info); if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, pcie_link_gen) && GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, pcie_link_width)) wprintw(dev->pcie_info, "%u@%2ux", device->dynamic_info.pcie_link_gen, device->dynamic_info.pcie_link_width); else wprintw(dev->pcie_info, "N/A"); } wcolor_set(dev->pcie_info, magenta_color, NULL); wprintw(dev->pcie_info, " RX: "); wstandend(dev->pcie_info); if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, pcie_rx)) print_pcie_at_scale(dev->pcie_info, device->dynamic_info.pcie_rx); else wprintw(dev->pcie_info, "N/A"); wcolor_set(dev->pcie_info, magenta_color, NULL); wprintw(dev->pcie_info, " TX: "); wstandend(dev->pcie_info); if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, pcie_tx)) print_pcie_at_scale(dev->pcie_info, device->dynamic_info.pcie_tx); else wprintw(dev->pcie_info, "N/A"); wnoutrefresh(dev->pcie_info); dev_id++; } } typedef struct { unsigned processes_count; struct gpuid_and_process { unsigned gpu_id; struct gpu_process *process; } * processes; } all_processes; static all_processes all_processes_array(struct list_head *devices) { unsigned total_processes_count = 0; struct gpu_info *device; unsigned dev_id = 0; list_for_each_entry(device, devices, list) { total_processes_count += device->processes_count; } all_processes merged_devices_processes; merged_devices_processes.processes_count = total_processes_count; if (total_processes_count) { merged_devices_processes.processes = malloc(total_processes_count * sizeof(*merged_devices_processes.processes)); if (!merged_devices_processes.processes) { perror("Cannot allocate memory: "); exit(EXIT_FAILURE); } } else { merged_devices_processes.processes = NULL; } size_t offset = 0; list_for_each_entry(device, devices, list) { for (unsigned int j = 0; j < device->processes_count; ++j) { merged_devices_processes.processes[offset].gpu_id = dev_id; merged_devices_processes.processes[offset++].process = &device->processes[j]; } dev_id++; } return merged_devices_processes; } static int compare_pid_desc(const void *pp1, const void *pp2) { const struct gpuid_and_process *p1 = (const struct gpuid_and_process *)pp1; const struct gpuid_and_process *p2 = (const struct gpuid_and_process *)pp2; return p1->process->pid >= p2->process->pid ? -1 : 1; } static int compare_pid_asc(const void *pp1, const void *pp2) { return compare_pid_desc(pp2, pp1); } static int compare_username_desc(const void *pp1, const void *pp2) { const struct gpuid_and_process *p1 = (const struct gpuid_and_process *)pp1; const struct gpuid_and_process *p2 = (const struct gpuid_and_process *)pp2; if (GPUINFO_PROCESS_FIELD_VALID(p1->process, user_name) && GPUINFO_PROCESS_FIELD_VALID(p2->process, user_name)) return -strcmp(p1->process->user_name, p2->process->user_name); else return 0; } static int compare_username_asc(const void *pp1, const void *pp2) { return compare_username_desc(pp2, pp1); } static int compare_process_name_desc(const void *pp1, const void *pp2) { const struct gpuid_and_process *p1 = (const struct gpuid_and_process *)pp1; const struct gpuid_and_process *p2 = (const struct gpuid_and_process *)pp2; if (GPUINFO_PROCESS_FIELD_VALID(p1->process, cmdline) && GPUINFO_PROCESS_FIELD_VALID(p2->process, cmdline)) return -strcmp(p1->process->cmdline, p2->process->cmdline); else return 0; } static int compare_process_name_asc(const void *pp1, const void *pp2) { return compare_process_name_desc(pp2, pp1); } static int compare_mem_usage_desc(const void *pp1, const void *pp2) { const struct gpuid_and_process *p1 = (const struct gpuid_and_process *)pp1; const struct gpuid_and_process *p2 = (const struct gpuid_and_process *)pp2; if (GPUINFO_PROCESS_FIELD_VALID(p1->process, gpu_memory_usage) && GPUINFO_PROCESS_FIELD_VALID(p2->process, gpu_memory_usage)) return p1->process->gpu_memory_usage >= p2->process->gpu_memory_usage ? -1 : 1; else return 0; } static int compare_mem_usage_asc(const void *pp1, const void *pp2) { return compare_mem_usage_desc(pp2, pp1); } static int compare_cpu_usage_desc(const void *pp1, const void *pp2) { const struct gpuid_and_process *p1 = (const struct gpuid_and_process *)pp1; const struct gpuid_and_process *p2 = (const struct gpuid_and_process *)pp2; if (GPUINFO_PROCESS_FIELD_VALID(p1->process, cpu_usage) && GPUINFO_PROCESS_FIELD_VALID(p2->process, cpu_usage)) return p1->process->cpu_usage >= p2->process->cpu_usage ? -1 : 1; else return 0; } static int compare_cpu_usage_asc(const void *pp1, const void *pp2) { return compare_cpu_usage_desc(pp2, pp1); } static int compare_cpu_mem_usage_desc(const void *pp1, const void *pp2) { const struct gpuid_and_process *p1 = (const struct gpuid_and_process *)pp1; const struct gpuid_and_process *p2 = (const struct gpuid_and_process *)pp2; if (GPUINFO_PROCESS_FIELD_VALID(p1->process, cpu_memory_res) && GPUINFO_PROCESS_FIELD_VALID(p2->process, cpu_memory_res)) return p1->process->cpu_memory_res >= p2->process->cpu_memory_res ? -1 : 1; else return 0; } static int compare_cpu_mem_usage_asc(const void *pp1, const void *pp2) { return compare_cpu_mem_usage_desc(pp2, pp1); } static int compare_gpu_desc(const void *pp1, const void *pp2) { const struct gpuid_and_process *p1 = (const struct gpuid_and_process *)pp1; const struct gpuid_and_process *p2 = (const struct gpuid_and_process *)pp2; return p1->gpu_id >= p2->gpu_id ? -1 : 1; } static int compare_gpu_asc(const void *pp1, const void *pp2) { return -compare_gpu_desc(pp1, pp2); } static int compare_process_type_desc(const void *pp1, const void *pp2) { const struct gpuid_and_process *p1 = (const struct gpuid_and_process *)pp1; const struct gpuid_and_process *p2 = (const struct gpuid_and_process *)pp2; return (p1->process->type == gpu_process_graphical) != (p2->process->type == gpu_process_graphical); } static int compare_process_type_asc(const void *pp1, const void *pp2) { return -compare_process_name_desc(pp1, pp2); } static int compare_process_gpu_rate_desc(const void *pp1, const void *pp2) { const struct gpuid_and_process *p1 = (const struct gpuid_and_process *)pp1; const struct gpuid_and_process *p2 = (const struct gpuid_and_process *)pp2; if (GPUINFO_PROCESS_FIELD_VALID(p1->process, gpu_usage) && GPUINFO_PROCESS_FIELD_VALID(p2->process, gpu_usage)) { return p1->process->gpu_usage > p2->process->gpu_usage ? -1 : 1; } else { if (GPUINFO_PROCESS_FIELD_VALID(p1->process, gpu_usage)) { return p1->process->gpu_usage > 0 ? -1 : 0; } else if (GPUINFO_PROCESS_FIELD_VALID(p2->process, gpu_usage)) { return p2->process->gpu_usage > 0 ? 1 : 0; } else { return 0; } } } static int compare_process_gpu_rate_asc(const void *pp1, const void *pp2) { return -compare_process_gpu_rate_desc(pp1, pp2); } static int compare_process_enc_rate_desc(const void *pp1, const void *pp2) { const struct gpuid_and_process *p1 = (const struct gpuid_and_process *)pp1; const struct gpuid_and_process *p2 = (const struct gpuid_and_process *)pp2; if (GPUINFO_PROCESS_FIELD_VALID(p1->process, encode_usage) && GPUINFO_PROCESS_FIELD_VALID(p2->process, encode_usage)) { return p1->process->encode_usage >= p2->process->encode_usage ? -1 : 1; } else { if (GPUINFO_PROCESS_FIELD_VALID(p1->process, encode_usage)) { return p1->process->encode_usage > 0 ? -1 : 0; } else if (GPUINFO_PROCESS_FIELD_VALID(p2->process, encode_usage)) { return p2->process->encode_usage > 0 ? 1 : 0; } else { return 0; } } } static int compare_process_enc_rate_asc(const void *pp1, const void *pp2) { return -compare_process_enc_rate_desc(pp1, pp2); } static int compare_process_dec_rate_desc(const void *pp1, const void *pp2) { const struct gpuid_and_process *p1 = (const struct gpuid_and_process *)pp1; const struct gpuid_and_process *p2 = (const struct gpuid_and_process *)pp2; if (GPUINFO_PROCESS_FIELD_VALID(p1->process, decode_usage) && GPUINFO_PROCESS_FIELD_VALID(p2->process, decode_usage)) { return p1->process->decode_usage >= p2->process->decode_usage ? -1 : 1; } else { if (GPUINFO_PROCESS_FIELD_VALID(p1->process, decode_usage)) { return p1->process->decode_usage > 0 ? -1 : 0; } else if (GPUINFO_PROCESS_FIELD_VALID(p2->process, decode_usage)) { return p2->process->decode_usage > 0 ? 1 : 0; } else { return 0; } } } static int compare_process_dec_rate_asc(const void *pp1, const void *pp2) { return -compare_process_dec_rate_desc(pp1, pp2); } static void sort_process(all_processes all_procs, enum process_field criterion, bool asc_sort) { if (all_procs.processes_count == 0 || !all_procs.processes) return; int (*sort_fun)(const void *, const void *); switch (criterion) { case process_pid: if (asc_sort) sort_fun = compare_pid_asc; else sort_fun = compare_pid_desc; break; case process_user: if (asc_sort) sort_fun = compare_username_asc; else sort_fun = compare_username_desc; break; case process_gpu_id: if (asc_sort) sort_fun = compare_gpu_asc; else sort_fun = compare_gpu_desc; break; case process_type: if (asc_sort) sort_fun = compare_process_type_asc; else sort_fun = compare_process_type_desc; break; case process_memory: if (asc_sort) sort_fun = compare_mem_usage_asc; else sort_fun = compare_mem_usage_desc; break; case process_command: if (asc_sort) sort_fun = compare_process_name_asc; else sort_fun = compare_process_name_desc; break; case process_cpu_usage: if (asc_sort) sort_fun = compare_cpu_usage_asc; else sort_fun = compare_cpu_usage_desc; break; case process_cpu_mem_usage: if (asc_sort) sort_fun = compare_cpu_mem_usage_asc; else sort_fun = compare_cpu_mem_usage_desc; break; case process_gpu_rate: if (asc_sort) sort_fun = compare_process_gpu_rate_asc; else sort_fun = compare_process_gpu_rate_desc; break; case process_enc_rate: if (asc_sort) sort_fun = compare_process_enc_rate_asc; else sort_fun = compare_process_enc_rate_desc; break; case process_dec_rate: if (asc_sort) sort_fun = compare_process_dec_rate_asc; else sort_fun = compare_process_dec_rate_desc; break; case process_field_count: return; } qsort(all_procs.processes, all_procs.processes_count, sizeof(*all_procs.processes), sort_fun); } static void filter_out_nvtop_pid(all_processes *all_procs, struct nvtop_interface *interface) { if (interface->options.filter_nvtop_pid) { for (unsigned procId = 0; procId < all_procs->processes_count; ++procId) { if (all_procs->processes[procId].process->pid == nvtop_pid) { memmove(&all_procs->processes[procId], &all_procs->processes[procId + 1], (all_procs->processes_count - procId - 1) * sizeof(*all_procs->processes)); all_procs->processes_count = all_procs->processes_count - 1; break; } } } } static const char *columnName[process_field_count] = { "PID", "USER", "DEV", "TYPE", "GPU", "ENC", "DEC", "GPU MEM", "CPU", "HOST MEM", "Command", }; static void update_selected_offset_with_window_size(unsigned int *selected_row, unsigned int *offset, unsigned int row_available_to_draw, unsigned int num_to_draw) { if (!num_to_draw) return; if (*selected_row > num_to_draw - 1) *selected_row = num_to_draw - 1; if (*offset > *selected_row) *offset = *selected_row; if (*offset + row_available_to_draw - 1 < *selected_row) *offset = *selected_row - row_available_to_draw + 1; while (row_available_to_draw > num_to_draw - *offset && *offset != 0) *offset -= 1; } #define process_buffer_line_size 8192 static char process_print_buffer[process_buffer_line_size]; static void print_processes_on_screen(all_processes all_procs, struct process_window *process, enum process_field sort_criterion, process_field_displayed fields_to_display) { WINDOW *win = process->option_window.state == nvtop_option_state_hidden ? process->process_win : process->process_with_option_win; struct gpuid_and_process *processes = all_procs.processes; unsigned int rows, cols; getmaxyx(win, rows, cols); rows -= 1; update_selected_offset_with_window_size(&process->selected_row, &process->offset, rows, all_procs.processes_count); if (process->offset_column + cols >= process_buffer_line_size) process->offset_column = process_buffer_line_size - cols - 1; size_t special_row = process->selected_row; char pid_str[sizeof_process_field[process_pid] + 1]; char guid_str[sizeof_process_field[process_gpu_id] + 1]; char memory[sizeof_process_field[process_memory] + 1]; char cpu_percent[sizeof_process_field[process_cpu_usage] + 1]; char cpu_mem[sizeof_process_field[process_cpu_mem_usage] + 1]; unsigned int start_at_process = process->offset; unsigned int end_at_process = start_at_process + rows; int printed = 0; int column_sort_start = 0, column_sort_end = sizeof_process_field[0]; memset(process_print_buffer, 0, sizeof(process_print_buffer)); for (enum process_field i = process_pid; i < process_field_count; ++i) { if (i == sort_criterion) { column_sort_start = printed; column_sort_end = i == process_command ? process_buffer_line_size - 4 : column_sort_start + sizeof_process_field[i]; } if (process_is_field_displayed(i, fields_to_display)) printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%*s ", sizeof_process_field[i], columnName[i]); } mvwprintw(win, 0, 0, "%.*s", cols, &process_print_buffer[process->offset_column]); wclrtoeol(win); mvwchgat(win, 0, 0, -1, A_STANDOUT, green_color, NULL); set_attribute_between(win, 0, column_sort_start - (int)process->offset_column, column_sort_end - (int)process->offset_column, A_STANDOUT, cyan_color); int start_col_process_type = 0; for (enum process_field i = process_pid; i < process_type; ++i) { if (process_is_field_displayed(i, fields_to_display)) start_col_process_type += sizeof_process_field[i] + 1; } int end_col_process_type = start_col_process_type + sizeof_process_field[process_type]; static unsigned printed_last_call = 0; unsigned last_line_printed = 0; for (unsigned int i = start_at_process; i < end_at_process && i < all_procs.processes_count; ++i) { memset(process_print_buffer, 0, sizeof(process_print_buffer)); printed = 0; if (process_is_field_displayed(process_pid, fields_to_display)) { size_t size = snprintf(pid_str, sizeof_process_field[process_pid] + 1, "%" PRIdMAX, (intmax_t)processes[i].process->pid); if (size == sizeof_process_field[process_pid] + 1) pid_str[sizeof_process_field[process_pid]] = '\0'; printed += snprintf(&process_print_buffer[printed], process_buffer_line_size, "%*s ", sizeof_process_field[process_pid], pid_str); } if (process_is_field_displayed(process_user, fields_to_display)) { const char *username; if (GPUINFO_PROCESS_FIELD_VALID(processes[i].process, user_name)) { username = processes[i].process->user_name; } else { username = "N/A"; } printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%*s ", sizeof_process_field[process_user], username); } if (process_is_field_displayed(process_gpu_id, fields_to_display)) { size_t size = snprintf(guid_str, sizeof_process_field[process_gpu_id] + 1, "%u", processes[i].gpu_id); if (size >= sizeof_process_field[process_gpu_id] + 1) pid_str[sizeof_process_field[process_gpu_id]] = '\0'; printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%*s ", sizeof_process_field[process_gpu_id], guid_str); } if (process_is_field_displayed(process_type, fields_to_display)) { if (processes[i].process->type == gpu_process_graphical_compute) { printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%*s ", sizeof_process_field[process_type], "Both G+C"); } else if (processes[i].process->type == gpu_process_graphical) { printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%*s ", sizeof_process_field[process_type], "Graphic"); } else { printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%*s ", sizeof_process_field[process_type], "Compute"); } } if (process_is_field_displayed(process_gpu_rate, fields_to_display)) { unsigned gpu_usage = 0; if (GPUINFO_PROCESS_FIELD_VALID(processes[i].process, gpu_usage)) { gpu_usage = processes[i].process->gpu_usage; } printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%3u%% ", gpu_usage); } if (process_is_field_displayed(process_enc_rate, fields_to_display)) { unsigned encoder_rate = 0; if (GPUINFO_PROCESS_FIELD_VALID(processes[i].process, encode_usage)) { encoder_rate = processes[i].process->encode_usage; } printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%3u%% ", encoder_rate); } if (process_is_field_displayed(process_dec_rate, fields_to_display)) { unsigned decode_rate = 0; if (GPUINFO_PROCESS_FIELD_VALID(processes[i].process, decode_usage)) { decode_rate = processes[i].process->decode_usage; } printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%3u%% ", decode_rate); } if (process_is_field_displayed(process_memory, fields_to_display)) { if (GPUINFO_PROCESS_FIELD_VALID(processes[i].process, gpu_memory_usage)) { if (GPUINFO_PROCESS_FIELD_VALID(processes[i].process, gpu_memory_percentage)) { snprintf(memory, 9 + 1, "%6uMiB", (unsigned)(processes[i].process->gpu_memory_usage / 1048576)); snprintf(memory + 9, sizeof_process_field[process_memory] - 9 + 1, " %3u%%", processes[i].process->gpu_memory_percentage); } else { snprintf(memory, sizeof_process_field[process_memory], "%6uMiB", (unsigned)(processes[i].process->gpu_memory_usage / 1048576)); } } else { memory[0] = '\0'; } printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%*s ", sizeof_process_field[process_memory], memory); } if (process_is_field_displayed(process_cpu_usage, fields_to_display)) { if (GPUINFO_PROCESS_FIELD_VALID(processes[i].process, cpu_usage)) snprintf(cpu_percent, sizeof_process_field[process_cpu_usage] + 1, "%u%%", processes[i].process->cpu_usage); else snprintf(cpu_percent, sizeof_process_field[process_cpu_usage] + 1, " N/A"); printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%*s ", sizeof_process_field[process_cpu_usage], cpu_percent); } if (process_is_field_displayed(process_cpu_mem_usage, fields_to_display)) { if (GPUINFO_PROCESS_FIELD_VALID(processes[i].process, cpu_memory_res)) snprintf(cpu_mem, sizeof_process_field[process_cpu_mem_usage] + 1, "%zuMiB", processes[i].process->cpu_memory_res / 1048576); else snprintf(cpu_mem, sizeof_process_field[process_cpu_mem_usage] + 1, "N/A"); printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%*s ", sizeof_process_field[process_cpu_mem_usage], cpu_mem); } if (process_is_field_displayed(process_command, fields_to_display)) { if (GPUINFO_PROCESS_FIELD_VALID(processes[i].process, cmdline)) printed += snprintf(&process_print_buffer[printed], process_buffer_line_size - printed, "%.*s", process_buffer_line_size - printed, processes[i].process->cmdline); } unsigned int write_at = i - start_at_process + 1; mvwprintw(win, write_at, 0, "%.*s", cols, &process_print_buffer[process->offset_column]); unsigned row, col; getyx(win, row, col); (void)col; if (row == write_at) wclrtoeol(win); last_line_printed = write_at; if (i == special_row) { mvwchgat(win, write_at, 0, -1, A_STANDOUT, cyan_color, NULL); } else { if (process_is_field_displayed(process_type, fields_to_display)) { if (processes[i].process->type == gpu_process_graphical_compute) { set_attribute_between(win, write_at, start_col_process_type - (int)process->offset_column, start_col_process_type - (int)process->offset_column + 4, 0, cyan_color); set_attribute_between(win, write_at, end_col_process_type - (int)process->offset_column - 3, end_col_process_type - (int)process->offset_column - 2, 0, yellow_color); set_attribute_between(win, write_at, end_col_process_type - (int)process->offset_column - 1, end_col_process_type - (int)process->offset_column, 0, magenta_color); } else if (processes[i].process->type == gpu_process_graphical) { set_attribute_between(win, write_at, start_col_process_type - (int)process->offset_column, end_col_process_type - (int)process->offset_column, 0, yellow_color); } else { set_attribute_between(win, write_at, start_col_process_type - (int)process->offset_column, end_col_process_type - (int)process->offset_column, 0, magenta_color); } } } } if (printed_last_call > last_line_printed) { for (unsigned i = last_line_printed + 1; i <= rows && i <= printed_last_call; ++i) { wmove(win, i, 0); wclrtoeol(win); } } printed_last_call = last_line_printed; wnoutrefresh(win); } static void update_process_option_win(struct nvtop_interface *interface); static void draw_processes(struct list_head *devices, struct nvtop_interface *interface) { if (interface->process.process_win == NULL) return; if (interface->process.option_window.state != interface->process.option_window.previous_state) { werase(interface->process.option_window.option_win); wclear(interface->process.process_win); wclear(interface->process.process_with_option_win); wnoutrefresh(interface->process.option_window.option_win); } if (interface->process.option_window.state != nvtop_option_state_hidden) update_process_option_win(interface); all_processes all_procs = all_processes_array(devices); filter_out_nvtop_pid(&all_procs, interface); sort_process(all_procs, interface->options.sort_processes_by, !interface->options.sort_descending_order); if (all_procs.processes_count > 0) { if (interface->process.selected_row >= all_procs.processes_count) interface->process.selected_row = all_procs.processes_count - 1; interface->process.selected_pid = all_procs.processes[interface->process.selected_row].process->pid; } else { interface->process.selected_row = 0; interface->process.selected_pid = -1; } unsigned largest_username = 4; for (unsigned i = 0; i < all_procs.processes_count; ++i) { if (GPUINFO_PROCESS_FIELD_VALID(all_procs.processes[i].process, user_name)) { unsigned length = strlen(all_procs.processes[i].process->user_name); if (length > largest_username) largest_username = length; } } sizeof_process_field[process_user] = largest_username; print_processes_on_screen(all_procs, &interface->process, interface->options.sort_processes_by, interface->options.process_fields_displayed); free(all_procs.processes); } static const char *signalNames[] = { "Cancel", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGBUS", "SIGFPE", "SIGKILL", "SIGUSR1", "SIGSEGV", "SIGUSR2", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGCHLD", "SIGCONT", "SIGSTOP", "SIGTSTP", "SIGTTIN", "SIGTTOU", "SIGURG", "SIGXCPU", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH", "SIGIO", "SIGPWR", "SIGSYS", }; // SIGPWR does not exist on FreeBSD, while it is a synonym for SIGINFO on Linux #ifdef __FreeBSD__ #define SIGPWR SIGINFO #endif static const int signalValues[ARRAY_SIZE(signalNames)] = { -1, SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGKILL, SIGUSR1, SIGSEGV, SIGUSR2, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGXCPU, SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH, SIGIO, SIGPWR, SIGSYS, }; static const size_t nvtop_num_signals = ARRAY_SIZE(signalNames) - 1; static void draw_kill_option(struct nvtop_interface *interface) { WINDOW *win = interface->process.option_window.option_win; wattr_set(win, A_REVERSE, green_color, NULL); mvwprintw(win, 0, 0, "Send signal:"); wstandend(win); wprintw(win, " "); int rows, cols; getmaxyx(win, rows, cols); size_t start_at_option = interface->process.option_window.offset; size_t end_at_option = start_at_option + rows - 1; for (size_t i = start_at_option; i < end_at_option && i <= nvtop_num_signals; ++i) { if (i == interface->process.option_window.selected_row) { wattr_set(win, A_STANDOUT, cyan_color, NULL); } wprintw(win, "%*zu %s", 2, i, signalNames[i]); getyx(win, rows, cols); for (unsigned int j = cols; j < option_window_size; ++j) wprintw(win, " "); if (i == interface->process.option_window.selected_row) { wstandend(win); mvwprintw(win, rows, option_window_size - 1, " "); } } wnoutrefresh(win); } static void draw_sort_option(struct nvtop_interface *interface) { WINDOW *win = interface->process.option_window.option_win; wattr_set(win, A_REVERSE, green_color, NULL); mvwprintw(win, 0, 0, "Sort by "); wstandend(win); wprintw(win, " "); int rows, cols; if (interface->process.option_window.offset == 0) { if (interface->process.option_window.selected_row == 0) { wattr_set(win, A_STANDOUT, cyan_color, NULL); } wprintw(win, "Cancel"); getyx(win, rows, cols); for (unsigned int j = cols; j < option_window_size; ++j) wprintw(win, " "); if (interface->process.option_window.selected_row == 0) { wstandend(win); mvwprintw(win, rows, option_window_size - 1, " "); } } getmaxyx(win, rows, cols); size_t start_at_option = interface->process.option_window.offset == 0 ? interface->process.option_window.offset : interface->process.option_window.offset - 1; size_t end_at_option = interface->process.option_window.offset == 0 ? start_at_option + rows - 2 : start_at_option + rows - 1; unsigned option_index = 0; for (enum process_field field = process_pid; field < process_field_count; ++field) { if (process_is_field_displayed(field, interface->options.process_fields_displayed)) { if (option_index >= start_at_option && option_index < end_at_option) { if (option_index + 1 == interface->process.option_window.selected_row) { wattr_set(win, A_STANDOUT, cyan_color, NULL); } wprintw(win, "%s", columnName[field]); getyx(win, rows, cols); for (unsigned int j = cols; j < option_window_size; ++j) wprintw(win, " "); if (option_index + 1 == interface->process.option_window.selected_row) { wstandend(win); mvwprintw(win, rows, option_window_size - 1, " "); } } option_index++; } } wnoutrefresh(win); } static void update_process_option_win(struct nvtop_interface *interface) { unsigned int rows, cols; getmaxyx(interface->process.option_window.option_win, rows, cols); rows -= 1; (void)cols; unsigned int num_options = 0; switch (interface->process.option_window.state) { case nvtop_option_state_kill: num_options = nvtop_num_signals + 1; // Option + Cancel break; case nvtop_option_state_sort_by: num_options = process_field_displayed_count(interface->options.process_fields_displayed) + 1; // Option + Cancel break; case nvtop_option_state_hidden: default: break; } update_selected_offset_with_window_size(&interface->process.option_window.selected_row, &interface->process.option_window.offset, rows, num_options); switch (interface->process.option_window.state) { case nvtop_option_state_kill: draw_kill_option(interface); break; case nvtop_option_state_sort_by: draw_sort_option(interface); break; case nvtop_option_state_hidden: default: break; } } static const char *option_selection_hidden[] = { "Setup", "Sort", "Kill", "Quit", "Save Config", }; static const char *option_selection_hidden_num[] = { "2", "6", "9", "10", "12", }; static const char *option_selection_sort[][2] = { {"Enter", "Sort"}, {"ESC", "Cancel"}, {"+", "Ascending"}, {"-", "Descending"}, }; static const char *option_selection_kill[][2] = { {"Enter", "Send"}, {"ESC", "Cancel"}, }; static const unsigned int option_selection_width = 8; static void draw_process_shortcuts(struct nvtop_interface *interface) { if (interface->process.option_window.state == interface->process.option_window.previous_state) return; WINDOW *win = interface->shortcut_window; enum nvtop_option_window_state current_state = interface->process.option_window.state; wmove(win, 0, 0); switch (current_state) { case nvtop_option_state_hidden: for (size_t i = 0; i < ARRAY_SIZE(option_selection_hidden); ++i) { if (process_field_displayed_count(interface->options.process_fields_displayed) > 0 || (i != 1 && i != 2)) { wprintw(win, "F%s", option_selection_hidden_num[i]); wattr_set(win, A_STANDOUT, cyan_color, NULL); wprintw(win, "%-*s", option_selection_width, option_selection_hidden[i]); wstandend(win); } } break; case nvtop_option_state_kill: for (size_t i = 0; i < ARRAY_SIZE(option_selection_kill); ++i) { wprintw(win, "%s", option_selection_kill[i][0]); wattr_set(win, A_STANDOUT, cyan_color, NULL); wprintw(win, "%-*s", option_selection_width, option_selection_kill[i][1]); wstandend(win); } break; case nvtop_option_state_sort_by: for (size_t i = 0; i < ARRAY_SIZE(option_selection_sort); ++i) { wprintw(win, "%s", option_selection_sort[i][0]); wattr_set(win, A_STANDOUT, cyan_color, NULL); wprintw(win, "%-*s", option_selection_width, option_selection_sort[i][1]); wstandend(win); } break; default: break; } wclrtoeol(win); unsigned int cur_col, tmp; (void)tmp; getyx(win, tmp, cur_col); mvwchgat(win, 0, cur_col, -1, A_STANDOUT, cyan_color, NULL); wnoutrefresh(win); interface->process.option_window.previous_state = current_state; } static void draw_shortcuts(struct nvtop_interface *interface) { if (interface->setup_win.visible) { draw_setup_window_shortcuts(interface); } else { draw_process_shortcuts(interface); } } void save_current_data_to_ring(struct list_head *devices, struct nvtop_interface *interface) { struct gpu_info *device; unsigned dev_id = 0; list_for_each_entry(device, devices, list) { unsigned data_index = 0; for (enum plot_information info = plot_gpu_rate; info < plot_information_count; ++info) { if (plot_isset_draw_info(info, interface->options.gpu_specific_opts[dev_id].to_draw)) { unsigned data_val = 0; switch (info) { case plot_gpu_rate: if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, gpu_util_rate)) data_val = device->dynamic_info.gpu_util_rate; break; case plot_gpu_mem_rate: if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, mem_util_rate)) data_val = device->dynamic_info.mem_util_rate; break; case plot_encoder_rate: if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, encoder_rate)) data_val = device->dynamic_info.encoder_rate; break; case plot_decoder_rate: if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, decoder_rate)) data_val = device->dynamic_info.decoder_rate; break; case plot_gpu_temperature: if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, gpu_temp)) { data_val = device->dynamic_info.gpu_temp; if (data_val > 100) data_val = 100u; } break; case plot_gpu_power_draw_rate: if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, power_draw) && GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, power_draw_max)) { data_val = device->dynamic_info.power_draw * 100 / device->dynamic_info.power_draw_max; if (data_val > 100) data_val = 100u; } break; case plot_fan_speed: if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, fan_speed)) { data_val = device->dynamic_info.fan_speed; } break; case plot_gpu_clock_rate: if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, gpu_clock_speed) && GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, gpu_clock_speed_max)) { data_val = device->dynamic_info.gpu_clock_speed * 100 / device->dynamic_info.gpu_clock_speed_max; } break; case plot_gpu_mem_clock_rate: if (GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, mem_clock_speed) && GPUINFO_DYNAMIC_FIELD_VALID(&device->dynamic_info, mem_clock_speed_max)) { data_val = device->dynamic_info.mem_clock_speed * 100 / device->dynamic_info.mem_clock_speed_max; } break; case plot_information_count: break; } interface_ring_buffer_push(&interface->saved_data_ring, dev_id, data_index, data_val); data_index++; } } dev_id++; } } static unsigned populate_plot_data_from_ring_buffer(const struct nvtop_interface *interface, struct plot_window *plot_win, unsigned size_data_buff, double data[size_data_buff], char plot_legend[MAX_LINES_PER_PLOT][PLOT_MAX_LEGEND_SIZE]) { memset(data, 0, size_data_buff * sizeof(*data)); unsigned total_to_draw = 0; for (unsigned i = 0; i < plot_win->num_devices_to_plot; ++i) { unsigned dev_id = plot_win->devices_ids[i]; plot_info_to_draw to_draw = interface->options.gpu_specific_opts[dev_id].to_draw; total_to_draw += plot_count_draw_info(to_draw); } assert(total_to_draw > 0); assert(size_data_buff % total_to_draw == 0); unsigned max_data_to_copy = size_data_buff / total_to_draw; double(*data_split)[total_to_draw] = (double(*)[total_to_draw])data; unsigned in_processing = 0; for (unsigned i = 0; i < plot_win->num_devices_to_plot; ++i) { unsigned dev_id = plot_win->devices_ids[i]; plot_info_to_draw to_draw = interface->options.gpu_specific_opts[dev_id].to_draw; unsigned data_ring_index = 0; for (enum plot_information info = plot_gpu_rate; info < plot_information_count; ++info) { if (plot_isset_draw_info(info, to_draw)) { // Populate the legend switch (info) { case plot_gpu_rate: snprintf(plot_legend[in_processing], PLOT_MAX_LEGEND_SIZE, "GPU%u %%", dev_id); break; case plot_gpu_mem_rate: snprintf(plot_legend[in_processing], PLOT_MAX_LEGEND_SIZE, "GPU%u mem%%", dev_id); break; case plot_encoder_rate: snprintf(plot_legend[in_processing], PLOT_MAX_LEGEND_SIZE, "GPU%u encode%%", dev_id); break; case plot_decoder_rate: snprintf(plot_legend[in_processing], PLOT_MAX_LEGEND_SIZE, "GPU%u decode%%", dev_id); break; case plot_gpu_temperature: snprintf(plot_legend[in_processing], PLOT_MAX_LEGEND_SIZE, "GPU%u temp(c)", dev_id); break; case plot_gpu_power_draw_rate: snprintf(plot_legend[in_processing], PLOT_MAX_LEGEND_SIZE, "GPU%u power%%", dev_id); break; case plot_fan_speed: snprintf(plot_legend[in_processing], PLOT_MAX_LEGEND_SIZE, "GPU%u fan%%", dev_id); break; case plot_gpu_clock_rate: snprintf(plot_legend[in_processing], PLOT_MAX_LEGEND_SIZE, "GPU%u clock%%", dev_id); break; case plot_gpu_mem_clock_rate: snprintf(plot_legend[in_processing], PLOT_MAX_LEGEND_SIZE, "GPU%u mem clock%%", dev_id); break; case plot_information_count: break; } // Copy the data unsigned data_in_ring = interface_ring_buffer_data_stored(&interface->saved_data_ring, dev_id, data_ring_index); if (interface->options.plot_left_to_right) { for (unsigned j = 0; j < data_in_ring && j < max_data_to_copy; ++j) { data_split[j][in_processing] = interface_ring_buffer_get(&interface->saved_data_ring, dev_id, data_ring_index, data_in_ring - j - 1); } } else { for (unsigned j = 0; j < data_in_ring && j < max_data_to_copy; ++j) { data_split[max_data_to_copy - j - 1][in_processing] = interface_ring_buffer_get(&interface->saved_data_ring, dev_id, data_ring_index, data_in_ring - j - 1); } } data_ring_index++; in_processing++; } } } return total_to_draw; } static void draw_plots(struct nvtop_interface *interface) { for (unsigned plot_id = 0; plot_id < interface->num_plots; ++plot_id) { werase(interface->plots[plot_id].plot_window); char plot_legend[MAX_LINES_PER_PLOT][PLOT_MAX_LEGEND_SIZE]; unsigned num_lines = populate_plot_data_from_ring_buffer(interface, &interface->plots[plot_id], interface->plots[plot_id].num_data, interface->plots[plot_id].data, plot_legend); nvtop_line_plot(interface->plots[plot_id].plot_window, interface->plots[plot_id].num_data, interface->plots[plot_id].data, num_lines, !interface->options.plot_left_to_right, plot_legend); wnoutrefresh(interface->plots[plot_id].plot_window); } } void draw_gpu_info_ncurses(unsigned devices_count, struct list_head *devices, struct nvtop_interface *interface) { draw_devices(devices, interface); if (!interface->setup_win.visible) { draw_plots(interface); draw_processes(devices, interface); } else { draw_setup_window(devices_count, devices, interface); } draw_shortcuts(interface); doupdate(); } void update_window_size_to_terminal_size(struct nvtop_interface *inter) { endwin(); erase(); refresh(); refresh(); delete_all_windows(inter); initialize_all_windows(inter); } bool is_escape_for_quit(struct nvtop_interface *interface) { if (interface->process.option_window.state == nvtop_option_state_hidden && !interface->setup_win.visible) return true; else return false; } static void option_do_kill(struct nvtop_interface *interface) { if (interface->process.option_window.selected_row == 0) return; pid_t pid = interface->process.selected_pid; int sig = signalValues[interface->process.option_window.selected_row]; if (pid > 0) { kill(pid, sig); } } static void option_change_sort(struct nvtop_interface *interface) { if (interface->process.option_window.selected_row == 0) return; unsigned index = 0; for (enum process_field i = process_pid; i < process_field_count; ++i) { if (process_is_field_displayed(i, interface->options.process_fields_displayed)) { if (index == interface->process.option_window.selected_row - 1) { interface->options.sort_processes_by = i; return; } index++; } } } void interface_key(int keyId, struct nvtop_interface *interface) { if (interface->setup_win.visible) { handle_setup_win_keypress(keyId, interface); return; } switch (keyId) { case KEY_F(2): if (interface->process.option_window.state == nvtop_option_state_hidden && !interface->setup_win.visible) { show_setup_window(interface); } break; case KEY_F(12): save_interface_options_to_config_file(interface->total_dev_count, &interface->options); break; case KEY_F(9): if (process_field_displayed_count(interface->options.process_fields_displayed) > 0 && interface->process.option_window.state == nvtop_option_state_hidden) { interface->process.option_window.state = nvtop_option_state_kill; interface->process.option_window.selected_row = 0; } break; case KEY_F(6): if (process_field_displayed_count(interface->options.process_fields_displayed) > 0 && interface->process.option_window.state == nvtop_option_state_hidden) { interface->process.option_window.state = nvtop_option_state_sort_by; interface->process.option_window.selected_row = 0; } break; case 'l': case KEY_RIGHT: if (interface->process.option_window.state == nvtop_option_state_hidden) interface->process.offset_column += 4; break; case 'h': case KEY_LEFT: if (interface->process.option_window.state == nvtop_option_state_hidden && interface->process.offset_column >= 4) interface->process.offset_column -= 4; break; case 'k': case KEY_UP: switch (interface->process.option_window.state) { case nvtop_option_state_kill: case nvtop_option_state_sort_by: if (interface->process.option_window.selected_row != 0) interface->process.option_window.selected_row--; break; case nvtop_option_state_hidden: if (interface->process.selected_row != 0) interface->process.selected_row--; break; default: break; } break; case 'j': case KEY_DOWN: switch (interface->process.option_window.state) { case nvtop_option_state_kill: case nvtop_option_state_sort_by: interface->process.option_window.selected_row++; break; case nvtop_option_state_hidden: interface->process.selected_row++; break; default: break; } break; case '+': interface->options.sort_descending_order = false; break; case '-': interface->options.sort_descending_order = true; break; case '\n': case KEY_ENTER: switch (interface->process.option_window.state) { case nvtop_option_state_kill: option_do_kill(interface); interface->process.option_window.state = nvtop_option_state_hidden; break; case nvtop_option_state_sort_by: option_change_sort(interface); interface->process.option_window.state = nvtop_option_state_hidden; break; case nvtop_option_state_hidden: default: break; } break; case 27: interface->process.option_window.state = nvtop_option_state_hidden; break; default: break; } } bool interface_freeze_processes(struct nvtop_interface *interface) { return interface->process.option_window.state == nvtop_option_state_kill; } extern inline void set_attribute_between(WINDOW *win, int startY, int startX, int endX, attr_t attr, short pair); int interface_update_interval(const struct nvtop_interface *interface) { return interface->options.update_interval; } unsigned interface_largest_gpu_name(struct list_head *devices) { struct gpu_info *gpuinfo; unsigned max_size = 4; list_for_each_entry(gpuinfo, devices, list) { if (GPUINFO_STATIC_FIELD_VALID(&gpuinfo->static_info, device_name)) { unsigned name_len = strlen(gpuinfo->static_info.device_name); max_size = name_len > max_size ? name_len : max_size; } } return max_size; } void interface_check_monitored_gpu_change(struct nvtop_interface **interface, unsigned allDevCount, unsigned *num_monitored_gpus, struct list_head *monitoredGpus, struct list_head *nonMonitoredGpus) { if (!(*interface)->setup_win.visible && (*interface)->options.has_monitored_set_changed) { nvtop_interface_option options_copy = (*interface)->options; options_copy.has_monitored_set_changed = false; memset(&(*interface)->options, 0, sizeof(options_copy)); *num_monitored_gpus = interface_check_and_fix_monitored_gpus(allDevCount, monitoredGpus, nonMonitoredGpus, &options_copy); clean_ncurses(*interface); *interface = initialize_curses(allDevCount, *num_monitored_gpus, interface_largest_gpu_name(monitoredGpus), options_copy); timeout(interface_update_interval(*interface)); } } static char dontShowAgain[] = ""; static char okay[] = ""; static char interactKeys[] = "Press Enter to select, arrows \">\" and \"<\" to switch options"; static unsigned message_lines(unsigned message_size, unsigned cols) { return (message_size + cols - 1) / cols; } bool show_information_messages(unsigned num_messages, const char **messages) { if (!num_messages) return false; bool exit = false; bool dontShowAgainOption = false; while (!exit) { initscr(); clear(); refresh(); initialize_colors(); cbreak(); noecho(); keypad(stdscr, TRUE); curs_set(0); int rows, cols; getmaxyx(stdscr, rows, cols); unsigned messages_lines = num_messages / 2; for (unsigned i = 0; i < num_messages; ++i) { messages_lines += message_lines(strlen(messages[i]), cols) + 1; } int row = (rows - messages_lines + 1) / 2; for (unsigned i = 0; i < num_messages; ++i) { int col = (cols - strlen(messages[i]) - 1) / 2; col = col < 0 ? 0 : col; mvprintw(row, col, "%s", messages[i]); row += message_lines(strlen(messages[i]), cols) + 1; } size_t sizeQuitOptions = sizeof(dontShowAgain) + sizeof(okay); int quitOptionsRow = row; int quitOptionsCol = (cols - sizeQuitOptions) / 2; quitOptionsCol = quitOptionsCol < 0 ? 0 : quitOptionsCol; mvprintw(quitOptionsRow, quitOptionsCol, "%s %s", dontShowAgain, okay); refresh(); if (dontShowAgainOption) { mvchgat(quitOptionsRow, quitOptionsCol, sizeof(dontShowAgain) - 1, 0, green_color, NULL); mvchgat(quitOptionsRow, quitOptionsCol + sizeof(dontShowAgain), sizeof(okay) - 1, 0, 0, NULL); } else { mvchgat(quitOptionsRow, quitOptionsCol, sizeof(dontShowAgain) - 1, 0, 0, NULL); mvchgat(quitOptionsRow, quitOptionsCol + sizeof(dontShowAgain), sizeof(okay) - 1, 0, green_color, NULL); } int interactKeyCol = (cols - sizeof(interactKeys) - 1) / 2; interactKeyCol = interactKeyCol < 0 ? 0 : interactKeyCol; mvprintw(quitOptionsRow + 1, interactKeyCol, "%s", interactKeys); int input_char = getch(); switch (input_char) { case 27: // ESC case 'q': case KEY_ENTER: case '\n': exit = true; break; case KEY_RIGHT: dontShowAgainOption = false; break; case KEY_LEFT: dontShowAgainOption = true; break; default: break; } endwin(); } return dontShowAgainOption; } nvtop-3.0.2/src/interface_layout_selection.c000066400000000000000000000375761444130114000212310ustar00rootroot00000000000000#include "nvtop/interface_layout_selection.h" #include "nvtop/interface.h" #include "nvtop/interface_options.h" #include #include #include #include #include #include #define max(a, b) ((a) > (b) ? (a) : (b)) #define min(a, b) ((a) < (b) ? (a) : (b)) static unsigned min_rows_taken_by_process(unsigned rows, unsigned num_devices) { return 1 + max(5, min(rows / 4, num_devices * 3)); } static const unsigned cols_needed_box_drawing = 5; static const unsigned min_plot_rows = 7; static unsigned min_plot_cols(unsigned num_data_info_to_plot) { return cols_needed_box_drawing + 10 * num_data_info_to_plot; } // If true, returns two plot indices that yields to the lowest number of info in // a plot when merged. // In case of ties, plots at the end of the list are prioritized. static bool who_to_merge(unsigned max_merge_size, unsigned plot_count, unsigned num_info_per_plot[plot_count], unsigned merge_ids[2]) { unsigned smallest_merge = UINT_MAX; for (unsigned notEmptyPlotIdx = plot_count - 1; notEmptyPlotIdx < plot_count; --notEmptyPlotIdx) { if (!num_info_per_plot[notEmptyPlotIdx]) continue; // We want to preserve the devices order when merging, hence we only look // for the closest non empty neighbor for each plot. unsigned merge_with = notEmptyPlotIdx; for (unsigned j = notEmptyPlotIdx - 1; j < notEmptyPlotIdx; --j) { if (num_info_per_plot[j]) { merge_with = j; break; } } unsigned num_info_merged = num_info_per_plot[notEmptyPlotIdx] + num_info_per_plot[merge_with]; if (merge_with < notEmptyPlotIdx && num_info_merged <= max_merge_size && num_info_merged < smallest_merge) { smallest_merge = num_info_merged; merge_ids[0] = merge_with; merge_ids[1] = notEmptyPlotIdx; } } return smallest_merge != UINT_MAX; } static bool move_plot_to_stack(unsigned stack_max_cols, unsigned plot_id, unsigned destination_stack, unsigned plot_count, unsigned stack_count, const unsigned num_info_per_plot[plot_count], unsigned cols_allocated_in_stacks[stack_count], unsigned plot_in_stack[plot_count]) { if (plot_in_stack[plot_id] == destination_stack) return false; unsigned cols_used_by_plot_id = min_plot_cols(num_info_per_plot[plot_id]); unsigned cols_after_merge = cols_allocated_in_stacks[destination_stack] + cols_used_by_plot_id; if (cols_after_merge > stack_max_cols) { return false; } else { cols_allocated_in_stacks[plot_in_stack[plot_id]] -= cols_used_by_plot_id; cols_allocated_in_stacks[destination_stack] += cols_used_by_plot_id; plot_in_stack[plot_id] = destination_stack; return true; } } static unsigned info_in_plot(unsigned plot_id, unsigned devices_count, const unsigned map_device_to_plot[devices_count], const nvtop_interface_gpu_opts gpuOpts[devices_count]) { unsigned sum = 0; for (unsigned dev_id = 0; dev_id < devices_count; ++dev_id) { if (map_device_to_plot[dev_id] == plot_id) sum += plot_count_draw_info(gpuOpts[dev_id].to_draw); } assert(sum > 0); return sum; } static unsigned cols_used_by_stack(unsigned stack_id, unsigned plot_count, const unsigned num_info_per_plot[plot_count], const unsigned plot_in_stack[plot_count]) { unsigned sum = 0; for (unsigned plot_id = 0; plot_id < plot_count; ++plot_id) { if (plot_in_stack[plot_id] == stack_id) sum += min_plot_cols(num_info_per_plot[plot_id]); } return sum; } static unsigned size_differences_between_stacks(unsigned plot_count, unsigned stack_count, unsigned cols_allocated_in_stacks[plot_count]) { unsigned sum = 0; for (unsigned i = 0; i < stack_count; ++i) { for (unsigned j = i + 1; j < stack_count; ++j) { if (cols_allocated_in_stacks[i] > cols_allocated_in_stacks[j]) { sum += cols_allocated_in_stacks[i] - cols_allocated_in_stacks[j]; } else { sum += cols_allocated_in_stacks[j] - cols_allocated_in_stacks[i]; } } } return sum; } static void preliminary_plot_positioning(unsigned rows_for_plots, unsigned plot_total_cols, unsigned devices_count, const nvtop_interface_gpu_opts gpuOpts[devices_count], unsigned map_device_to_plot[devices_count], unsigned plot_in_stack[devices_count], unsigned *num_plots, unsigned *plot_stack_count) { // Used to handle the merging process unsigned num_info_per_plot[MAX_CHARTS]; bool plot_anything = false; for (unsigned i = 0; i < devices_count; ++i) { num_info_per_plot[i] = plot_count_draw_info(gpuOpts[i].to_draw); map_device_to_plot[i] = i; if (num_info_per_plot[i]) plot_anything = true; } // Get the most packed configuration possible with one chart per device if // possible. // If there is not enough place, merge the charts and retry. unsigned num_plot_stacks = 0; bool search_a_window_configuration = plot_anything && rows_for_plots >= min_plot_rows; while (search_a_window_configuration) { search_a_window_configuration = false; unsigned plot_id = 0; num_plot_stacks = 1; unsigned cols_used_in_stack = 0; unsigned rows_left_to_allocate = rows_for_plots - min_plot_rows; for (unsigned i = 0; i < devices_count; ++i) { unsigned num_info_for_this_plot = num_info_per_plot[i]; if (num_info_for_this_plot == 0) continue; unsigned cols_this_plot = min_plot_cols(num_info_for_this_plot); // If there is enough horizontal space left, allocate side by side if (plot_total_cols >= cols_this_plot + cols_used_in_stack) { cols_used_in_stack += cols_this_plot; plot_in_stack[plot_id] = num_plot_stacks - 1; plot_id++; } else { // This plot is too wide for an empty stack, abort if (cols_used_in_stack == 0) { num_plot_stacks = 0; break; } // Else allocate a new stack and retry if (rows_left_to_allocate >= min_plot_rows) { rows_left_to_allocate -= min_plot_rows; num_plot_stacks++; cols_used_in_stack = 0; i--; } else { // Not enough space for a stack: retry and merge one more unsigned to_merge[2]; if (who_to_merge(MAX_LINES_PER_PLOT, devices_count, num_info_per_plot, to_merge)) { num_info_per_plot[to_merge[0]] += num_info_per_plot[to_merge[1]]; num_info_per_plot[to_merge[1]] = 0; unsigned oldLocation = map_device_to_plot[to_merge[1]]; for (unsigned devId = 0; devId < devices_count; ++devId) { if (map_device_to_plot[devId] == oldLocation) map_device_to_plot[devId] = map_device_to_plot[to_merge[0]]; } search_a_window_configuration = true; } else { // No merge left num_plot_stacks = 0; } break; } } } } // Compute the number of plots, the mapping and the size *num_plots = 0; *plot_stack_count = num_plot_stacks; if (num_plot_stacks > 0) { // Move non-empty plots over empty ones caused by merges for (unsigned idx = 0; idx < devices_count; ++idx) { if (!num_info_per_plot[idx]) { // Search next non-empty and move it here for (unsigned nextIdx = idx + 1; nextIdx < devices_count; ++nextIdx) { if (num_info_per_plot[nextIdx]) { num_info_per_plot[idx] = num_info_per_plot[nextIdx]; num_info_per_plot[nextIdx] = 0; for (unsigned devId = 0; devId < devices_count; ++devId) { if (map_device_to_plot[devId] == nextIdx) map_device_to_plot[devId] = idx; } (*num_plots)++; break; } } } else { (*num_plots)++; } } } } static void balance_info_on_stacks_preserving_plot_order(unsigned stack_max_cols, unsigned stack_count, unsigned plot_count, unsigned num_info_per_plot[plot_count], unsigned cols_allocated_in_stacks[stack_count], unsigned plot_in_stack[plot_count]) { if (stack_count > plot_count) { stack_count = plot_count; } unsigned moving_plot_id = plot_count - 1; while (moving_plot_id < plot_count) { unsigned to_stack = plot_in_stack[moving_plot_id] + 1; if (to_stack < stack_count) { unsigned diff_sum_before = size_differences_between_stacks(plot_count, stack_count, cols_allocated_in_stacks); unsigned stack_before = plot_in_stack[moving_plot_id]; if (move_plot_to_stack(stack_max_cols, moving_plot_id, to_stack, plot_count, stack_count, num_info_per_plot, cols_allocated_in_stacks, plot_in_stack)) { unsigned diff_sum_after = size_differences_between_stacks(plot_count, stack_count, cols_allocated_in_stacks); if (diff_sum_after <= diff_sum_before) { moving_plot_id = plot_count; } else { // Move back move_plot_to_stack(stack_max_cols, moving_plot_id, stack_before, plot_count, stack_count, num_info_per_plot, cols_allocated_in_stacks, plot_in_stack); } } } moving_plot_id--; } } void compute_sizes_from_layout(unsigned devices_count, unsigned device_header_rows, unsigned device_header_cols, unsigned rows, unsigned cols, const nvtop_interface_gpu_opts *gpuOpts, process_field_displayed process_displayed, struct window_position *device_positions, unsigned *num_plots, struct window_position plot_positions[MAX_CHARTS], unsigned *map_device_to_plot, struct window_position *process_position, struct window_position *setup_position) { unsigned min_rows_for_header = 0, header_stacks = 0, num_device_per_row = 0; num_device_per_row = max(1, cols / device_header_cols); header_stacks = max(1, devices_count / num_device_per_row + ((devices_count % num_device_per_row) > 0)); if (devices_count % header_stacks == 0) num_device_per_row = devices_count / header_stacks; min_rows_for_header = header_stacks * device_header_rows; unsigned min_rows_for_process = process_field_displayed_count(process_displayed) ? min_rows_taken_by_process(rows, devices_count) : 0; // Not enough room for the header and process if (rows < min_rows_for_header + min_rows_for_process) { if (rows >= min_rows_for_header + 2 && process_field_displayed_count(process_displayed)) { // Shrink process min_rows_for_process = rows - min_rows_for_header; } else { // Only header if possible min_rows_for_header = rows; min_rows_for_process = 0; } } unsigned rows_for_header = min_rows_for_header; unsigned rows_for_process = min_rows_for_process; unsigned rows_for_plots = rows - min_rows_for_header - min_rows_for_process; unsigned num_plot_stacks = 0; unsigned plot_in_stack[MAX_CHARTS]; preliminary_plot_positioning(rows_for_plots, cols, devices_count, gpuOpts, map_device_to_plot, plot_in_stack, num_plots, &num_plot_stacks); // Transfer some lines to the header to separate the devices unsigned transferable_lines = rows_for_plots - num_plot_stacks * min_plot_rows; unsigned space_for_header = header_stacks == 0 ? 0 : header_stacks - 1; bool space_between_header_stack = false; if (transferable_lines >= space_for_header) { rows_for_header += space_for_header; rows_for_plots -= space_for_header; space_between_header_stack = true; } // Allocate additional plot stacks if there is enough vertical room if (num_plot_stacks > 0) { while (num_plot_stacks < *num_plots && rows_for_plots / (num_plot_stacks + 1) >= 11 && (num_plot_stacks + 1) * min_plot_rows <= rows_for_plots) num_plot_stacks++; } // Compute the cols used in each stacks to prepare balancing unsigned num_info_per_plot[MAX_CHARTS]; for (unsigned i = 0; i < *num_plots; ++i) { num_info_per_plot[i] = info_in_plot(i, devices_count, map_device_to_plot, gpuOpts); } unsigned cols_allocated_in_stacks[MAX_CHARTS]; for (unsigned i = 0; i < num_plot_stacks; ++i) { cols_allocated_in_stacks[i] = cols_used_by_stack(i, *num_plots, num_info_per_plot, plot_in_stack); } // Keep the plot order of apparition, but spread the plot on different stacks balance_info_on_stacks_preserving_plot_order(cols, num_plot_stacks, *num_plots, num_info_per_plot, cols_allocated_in_stacks, plot_in_stack); // Device Information Header unsigned cols_header_left = cols - num_device_per_row * device_header_cols; bool space_between_header_col = false; bool space_before_header = false; if (cols_header_left > num_device_per_row) { space_between_header_col = true; cols_header_left -= num_device_per_row - 1; } if (cols_header_left > 0) space_before_header = true; unsigned num_this_row = 0; unsigned headerPosX = space_before_header; unsigned headerPosY = 0; for (unsigned i = 0; i < devices_count; ++i) { device_positions[i].posX = headerPosX; device_positions[i].posY = headerPosY; device_positions[i].sizeX = device_header_cols; device_positions[i].sizeY = device_header_rows; num_this_row++; if (num_this_row == num_device_per_row) { headerPosX = space_before_header; headerPosY += device_header_rows + space_between_header_stack; num_this_row = 0; } else { headerPosX += device_header_cols + space_between_header_col; } } unsigned rows_left_for_process = 0; if (*num_plots > 0) { unsigned rows_per_stack = rows_for_plots / num_plot_stacks; if (rows_per_stack > 23) rows_per_stack = 23; unsigned num_plot_done = 0; unsigned currentPosX = 0, currentPosY = rows_for_header; for (unsigned stack_id = 0; stack_id < num_plot_stacks; ++stack_id) { unsigned plot_in_this_stack = 0; unsigned lines_to_draw = 0; for (unsigned j = 0; j < *num_plots; ++j) { if (plot_in_stack[j] == stack_id) { plot_in_this_stack++; lines_to_draw += num_info_per_plot[j]; } } unsigned cols_for_line_drawing = cols - plot_in_this_stack * cols_needed_box_drawing; for (unsigned j = 0; j < *num_plots; ++j) { if (plot_in_stack[j] == stack_id) { unsigned max_plot_cols = cols_needed_box_drawing + cols_for_line_drawing * num_info_per_plot[j] / lines_to_draw; unsigned plot_cols = max_plot_cols - (max_plot_cols - cols_needed_box_drawing) % num_info_per_plot[j]; plot_positions[num_plot_done].posX = currentPosX; plot_positions[num_plot_done].posY = currentPosY; plot_positions[num_plot_done].sizeX = plot_cols; plot_positions[num_plot_done].sizeY = rows_per_stack; currentPosX += max_plot_cols; num_plot_done++; } } currentPosY += rows_per_stack; currentPosX = 0; } if (process_field_displayed_count(process_displayed) > 0) rows_left_for_process = rows_for_plots - rows_per_stack * num_plot_stacks; } else { // No plot displayed, allocate the leftover space to the processes if (process_field_displayed_count(process_displayed) > 0 && rows_for_plots > 0) rows_for_process += rows_for_plots - 1; } process_position->posX = 0; process_position->posY = rows - rows_for_process - rows_left_for_process; process_position->sizeY = rows_for_process + rows_left_for_process; process_position->sizeX = cols; setup_position->posX = 0; setup_position->posY = rows_for_header; setup_position->sizeY = rows - rows_for_header; setup_position->sizeX = cols; } nvtop-3.0.2/src/interface_options.c000066400000000000000000000461551444130114000173330ustar00rootroot00000000000000/* * * Copyright (C) 2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/interface_options.h" #include "ini.h" #include "nvtop/interface_common.h" #include #include #include #include #include #include #include #include char config_file_path[PATH_MAX]; const char config_file_location[] = "nvtop/interface.ini"; const char config_conf_path[] = ".config"; static const char *default_config_path(void) { char *xdg_config_dir = getenv("XDG_CONFIG_HOME"); size_t conf_path_length = 0; if (!xdg_config_dir) { // XDG config dir not set, default to $HOME/.config xdg_config_dir = getenv("HOME"); conf_path_length = sizeof(config_conf_path); } size_t xdg_path_length = strlen(xdg_config_dir); if (xdg_path_length < PATH_MAX - conf_path_length - sizeof(config_file_location)) { strcpy(config_file_path, xdg_config_dir); config_file_path[xdg_path_length] = '/'; if (conf_path_length) { strcpy(config_file_path + xdg_path_length + 1, config_conf_path); config_file_path[xdg_path_length + conf_path_length] = '/'; } strcpy(config_file_path + xdg_path_length + 1 + conf_path_length, config_file_location); return config_file_path; } else { return NULL; } } unsigned interface_check_and_fix_monitored_gpus(unsigned num_devices, struct list_head *monitoredGpu, struct list_head *nonMonitoredGpu, nvtop_interface_option *options) { // The array in options->gpu_specifi_opts is kept in sync with the lists unsigned idx = 0; struct gpu_info *device, *list_tmp; list_for_each_entry_safe(device, list_tmp, monitoredGpu, list) { assert(idx <= num_devices); if (options->gpu_specific_opts[idx].doNotMonitor) { list_move_tail(&device->list, nonMonitoredGpu); nvtop_interface_gpu_opts saveInfo = options->gpu_specific_opts[idx]; memmove(&options->gpu_specific_opts[idx], &options->gpu_specific_opts[idx + 1], (num_devices - idx - 1) * sizeof(*options->gpu_specific_opts)); options->gpu_specific_opts[num_devices - 1] = saveInfo; } else { idx++; } } unsigned numMonitored = idx; list_for_each_entry_safe(device, list_tmp, nonMonitoredGpu, list) { assert(idx <= num_devices); if (!options->gpu_specific_opts[idx].doNotMonitor) { list_move_tail(&device->list, monitoredGpu); nvtop_interface_gpu_opts saveInfo = options->gpu_specific_opts[idx]; for (unsigned nonMonPred = idx; nonMonPred > numMonitored; --nonMonPred) { options->gpu_specific_opts[nonMonPred] = options->gpu_specific_opts[nonMonPred - 1]; } options->gpu_specific_opts[numMonitored] = saveInfo; numMonitored++; } idx++; } assert(idx == num_devices); // We keep at least one monitored gpu at all times if (num_devices > 0 && numMonitored == 0) { assert(list_empty(monitoredGpu)); list_move(&list_first_entry(nonMonitoredGpu, struct gpu_info, list)->list, monitoredGpu); options->gpu_specific_opts[0].doNotMonitor = false; numMonitored++; } return numMonitored; } void alloc_interface_options_internals(char *config_location, unsigned num_devices, struct list_head *devices, nvtop_interface_option *options) { options->gpu_specific_opts = calloc(num_devices, sizeof(*options->gpu_specific_opts)); if (!options->gpu_specific_opts) { perror("Cannot allocate memory: "); exit(EXIT_FAILURE); } unsigned idx = 0; struct gpu_info *device; list_for_each_entry(device, devices, list) { options->gpu_specific_opts[idx++].linkedGpu = device; } options->plot_left_to_right = false; options->use_color = true; options->encode_decode_hiding_timer = 30.; options->temperature_in_fahrenheit = false; options->config_file_location = NULL; options->sort_processes_by = process_memory; options->sort_descending_order = true; options->update_interval = 1000; options->process_fields_displayed = 0; options->has_monitored_set_changed = false; options->show_startup_messages = true; options->filter_nvtop_pid = true; if (config_location) { options->config_file_location = malloc(strlen(config_location) + 1); if (!options->config_file_location) { perror("Cannot allocate memory: "); exit(EXIT_FAILURE); } strcpy(options->config_file_location, config_location); } else { const char *default_path = default_config_path(); options->config_file_location = malloc(strlen(default_path) + 1); if (!options->config_file_location) { perror("Cannot allocate memory: "); exit(EXIT_FAILURE); } strcpy(options->config_file_location, default_path); } } struct nvtop_option_ini_data { unsigned num_devices; unsigned selectedGpu; nvtop_interface_option *options; }; static const char do_not_modify_notice[] = "; Please do not edit this file.\n" "; The file is automatically generated and modified by nvtop by pressing " "F12.\n" "; If you wish to modify an option, use nvtop's setup window (F2) and " "follow " "up by saving the preference (F12).\n"; static const char general_section[] = "GeneralOption"; static const char general_value_use_color[] = "UseColor"; static const char general_value_update_interval[] = "UpdateInterval"; static const char general_show_messages[] = "ShowInfoMessages"; static const char header_section[] = "HeaderOption"; static const char header_value_use_fahrenheit[] = "UseFahrenheit"; static const char header_value_encode_decode_timer[] = "EncodeHideTimer"; static const char chart_section[] = "ChartOption"; static const char chart_value_reverse[] = "ReverseChart"; static const char process_list_section[] = "ProcessListOption"; static const char process_hide_nvtop_process[] = "HideNvtopProcess"; static const char process_value_sortby[] = "SortBy"; static const char process_value_display_field[] = "DisplayField"; static const char *process_sortby_vals[process_field_count + 1] = { "pId", "user", "gpuId", "type", "gpuRate", "encRate", "decRate", "memory", "cpuUsage", "cpuMem", "cmdline", "none"}; static const char process_value_sort_order[] = "SortOrder"; static const char process_sort_descending[] = "descending"; static const char process_sort_ascending[] = "ascending"; static const char device_section[] = "Device"; static const char device_pdev[] = "Pdev"; static const char device_monitor[] = "Monitor"; static const char device_shown_value[] = "ShownInfo"; static const char *device_draw_vals[plot_information_count + 1] = { "gpuRate", "gpuMemRate", "encodeRate", "decodeRate", "temperature", "powerDrawRate", "fanSpeed", "gpuClockRate", "gpuMemClockRate", "none"}; static int nvtop_option_ini_handler(void *user, const char *section, const char *name, const char *value) { struct nvtop_option_ini_data *ini_data = (struct nvtop_option_ini_data *)user; // General Options if (strcmp(section, general_section) == 0) { if (strcmp(name, general_value_use_color) == 0) { if (strcmp(value, "true") == 0) { ini_data->options->use_color = true; } if (strcmp(value, "false") == 0) { ini_data->options->use_color = false; } } if (strcmp(name, general_value_update_interval) == 0) { int update_interval; if (sscanf(value, "%d", &update_interval) == 1) ini_data->options->update_interval = update_interval; } if (strcmp(name, general_show_messages) == 0) { if (strcmp(value, "true") == 0) { ini_data->options->show_startup_messages = true; } if (strcmp(value, "false") == 0) { ini_data->options->show_startup_messages = false; } } } // Header Options if (strcmp(section, header_section) == 0) { if (strcmp(name, header_value_use_fahrenheit) == 0) { if (strcmp(value, "true") == 0) { ini_data->options->temperature_in_fahrenheit = true; } if (strcmp(value, "false") == 0) { ini_data->options->temperature_in_fahrenheit = false; } } if (strcmp(name, header_value_encode_decode_timer) == 0) { double value_double; if (sscanf(value, "%le", &value_double) == 1) ini_data->options->encode_decode_hiding_timer = value_double; } } // Chart Options if (strcmp(section, chart_section) == 0) { if (strcmp(name, chart_value_reverse) == 0) { if (strcmp(value, "true") == 0) { ini_data->options->plot_left_to_right = true; } if (strcmp(value, "false") == 0) { ini_data->options->plot_left_to_right = false; } } } // Process List Options if (strcmp(section, process_list_section) == 0) { if (strcmp(name, process_hide_nvtop_process) == 0) { if (strcmp(value, "true") == 0) { ini_data->options->filter_nvtop_pid = true; } if (strcmp(value, "false") == 0) { ini_data->options->filter_nvtop_pid = false; } } if (strcmp(name, process_value_sortby) == 0) { for (enum process_field i = process_pid; i < process_field_count; ++i) { if (strcmp(value, process_sortby_vals[i]) == 0) { ini_data->options->sort_processes_by = i; } } } if (strcmp(name, process_value_display_field) == 0) { for (enum process_field i = process_pid; i < process_field_count + 1; ++i) { if (strcmp(value, process_sortby_vals[i]) == 0) { ini_data->options->process_fields_displayed = process_add_field_to_display(i, ini_data->options->process_fields_displayed); ini_data->options->process_fields_displayed = process_add_field_to_display(process_field_count, ini_data->options->process_fields_displayed); } } } if (strcmp(name, process_value_sort_order) == 0) { if (strcmp(value, process_sort_descending) == 0) { ini_data->options->sort_descending_order = true; } if (strcmp(value, process_sort_ascending) == 0) { ini_data->options->sort_descending_order = false; } } } // Per-Device Sections if (strcmp(section, device_section) == 0) { if (strcmp(name, device_pdev) == 0) { ini_data->selectedGpu = ini_data->num_devices; for (unsigned i = 0; i < ini_data->num_devices; ++i) { if (strcmp(ini_data->options->gpu_specific_opts[i].linkedGpu->pdev, value) == 0) { ini_data->selectedGpu = i; break; } } } if (ini_data->selectedGpu < ini_data->num_devices) { if (strcmp(name, device_shown_value) == 0) { for (enum plot_information j = plot_gpu_rate; j < plot_information_count + 1; ++j) { if (strcmp(value, device_draw_vals[j]) == 0) { ini_data->options->gpu_specific_opts[ini_data->selectedGpu].to_draw = plot_add_draw_info(j, ini_data->options->gpu_specific_opts[ini_data->selectedGpu].to_draw); ini_data->options->gpu_specific_opts[ini_data->selectedGpu].to_draw = plot_add_draw_info( plot_information_count, ini_data->options->gpu_specific_opts[ini_data->selectedGpu].to_draw); } } } if (strcmp(name, device_monitor) == 0) { if (strcmp(value, "true") == 0) ini_data->options->gpu_specific_opts[ini_data->selectedGpu].doNotMonitor = false; if (strcmp(value, "false") == 0) ini_data->options->gpu_specific_opts[ini_data->selectedGpu].doNotMonitor = true; } } } return 1; } bool load_interface_options_from_config_file(unsigned num_devices, nvtop_interface_option *options) { FILE *option_file = fopen(options->config_file_location, "r"); if (!option_file) return false; struct nvtop_option_ini_data ini_data = {num_devices, num_devices, options}; int retval = ini_parse_file(option_file, nvtop_option_ini_handler, &ini_data); fclose(option_file); if (!process_is_field_displayed(options->sort_processes_by, options->process_fields_displayed)) { options->sort_processes_by = process_default_sort_by_from(options->process_fields_displayed); } return retval >= 0; } static bool create_config_directory_rec(char *config_directory) { for (char *index = config_directory + 1; *index != '\0'; ++index) { if (*index == '/') { *index = '\0'; if (mkdir(config_directory, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { if (errno != EEXIST) { char *error_str = strerror(errno); fprintf(stderr, "Could not create directory \"%s\": %s\n", config_directory, error_str); return false; } } *index = '/'; } } if (mkdir(config_directory, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { if (errno != EEXIST) { char *error_str = strerror(errno); fprintf(stderr, "Could not create directory \"%s\": %s\n", config_directory, error_str); return false; } } return true; } static const char *boolean_string(bool value) { return value ? "true" : "false"; } bool save_interface_options_to_config_file(unsigned total_dev_count, const nvtop_interface_option *options) { char folder_path[PATH_MAX]; strcpy(folder_path, options->config_file_location); char *config_directory = dirname(folder_path); if (!create_config_directory_rec(config_directory)) return false; FILE *config_file = fopen(options->config_file_location, "w"); if (!config_file) { char *error_str = strerror(errno); fprintf(stderr, "Could not create config file \"%s\": %s\n", options->config_file_location, error_str); return false; } fprintf(config_file, "%s", do_not_modify_notice); // General Options fprintf(config_file, "[%s]\n", general_section); fprintf(config_file, "%s = %s\n", general_value_use_color, boolean_string(options->use_color)); fprintf(config_file, "%s = %d\n", general_value_update_interval, options->update_interval); fprintf(config_file, "%s = %s\n", general_show_messages, boolean_string(options->show_startup_messages)); // Header Options fprintf(config_file, "\n[%s]\n", header_section); fprintf(config_file, "%s = %s\n", header_value_use_fahrenheit, boolean_string(options->temperature_in_fahrenheit)); fprintf(config_file, "%s = %e\n", header_value_encode_decode_timer, options->encode_decode_hiding_timer); // Chart Options fprintf(config_file, "\n[%s]\n", chart_section); fprintf(config_file, "%s = %s\n", chart_value_reverse, boolean_string(options->plot_left_to_right)); // Process Options fprintf(config_file, "\n[%s]\n", process_list_section); fprintf(config_file, "%s = %s\n", process_hide_nvtop_process, boolean_string(options->filter_nvtop_pid)); fprintf(config_file, "%s = %s\n", process_value_sort_order, options->sort_descending_order ? process_sort_descending : process_sort_ascending); fprintf(config_file, "%s = %s\n", process_value_sortby, process_sortby_vals[options->sort_processes_by]); bool display_any_field = false; for (enum process_field field = process_pid; field < process_field_count; ++field) { if (process_is_field_displayed(field, options->process_fields_displayed)) { fprintf(config_file, "%s = %s\n", process_value_display_field, process_sortby_vals[field]); display_any_field = true; } } if (!display_any_field) fprintf(config_file, "%s = %s\n", process_value_display_field, process_sortby_vals[process_field_count]); // Per-Device Sections for (unsigned i = 0; i < total_dev_count; ++i) { fprintf(config_file, "\n[%s]\n", device_section); fprintf(config_file, "%s = %s\n", device_pdev, options->gpu_specific_opts[i].linkedGpu->pdev); fprintf(config_file, "%s = %s\n", device_monitor, boolean_string(!options->gpu_specific_opts[i].doNotMonitor)); bool draw_any = false; for (enum plot_information j = plot_gpu_rate; j < plot_information_count; ++j) { if (plot_isset_draw_info(j, options->gpu_specific_opts[i].to_draw)) { fprintf(config_file, "%s = %s\n", device_shown_value, device_draw_vals[j]); draw_any = true; } } if (!draw_any) fprintf(config_file, "%s = %s\n", device_shown_value, device_draw_vals[plot_information_count]); fprintf(config_file, "\n"); } fclose(config_file); return true; } extern inline plot_info_to_draw plot_add_draw_info(enum plot_information set_info, plot_info_to_draw to_draw); extern inline plot_info_to_draw plot_remove_draw_info(enum plot_information set_info, plot_info_to_draw to_draw); extern inline plot_info_to_draw plot_default_draw_info(void); extern inline bool plot_isset_draw_info(enum plot_information check_info, plot_info_to_draw to_draw); extern inline unsigned plot_count_draw_info(plot_info_to_draw to_draw); extern inline bool process_is_field_displayed(enum process_field field, process_field_displayed cols_displayed); extern inline process_field_displayed process_remove_field_to_display(enum process_field field, process_field_displayed cols_displayed); extern inline process_field_displayed process_add_field_to_display(enum process_field field, process_field_displayed cols_displayed); extern inline process_field_displayed process_default_displayed_field(void); extern inline unsigned process_field_displayed_count(process_field_displayed fields_displayed); enum process_field process_default_sort_by_from(process_field_displayed fields_displayed) { if (process_is_field_displayed(process_memory, fields_displayed)) return process_memory; if (process_is_field_displayed(process_cpu_mem_usage, fields_displayed)) return process_cpu_mem_usage; if (process_is_field_displayed(process_gpu_rate, fields_displayed)) return process_gpu_rate; if (process_is_field_displayed(process_cpu_usage, fields_displayed)) return process_cpu_usage; if (process_is_field_displayed(process_command, fields_displayed)) return process_command; if (process_is_field_displayed(process_type, fields_displayed)) return process_type; if (process_is_field_displayed(process_enc_rate, fields_displayed)) return process_enc_rate; if (process_is_field_displayed(process_dec_rate, fields_displayed)) return process_dec_rate; if (process_is_field_displayed(process_user, fields_displayed)) return process_user; if (process_is_field_displayed(process_gpu_id, fields_displayed)) return process_gpu_id; if (process_is_field_displayed(process_pid, fields_displayed)) return process_pid; return process_field_count; } nvtop-3.0.2/src/interface_ring_buffer.c000066400000000000000000000040701444130114000201160ustar00rootroot00000000000000 #include "nvtop/interface_ring_buffer.h" #include "stdio.h" #include "stdlib.h" void interface_alloc_ring_buffer(unsigned devices_count, unsigned per_device_data_saved, unsigned buffer_size, interface_ring_buffer *ring_buffer) { ring_buffer->ring_buffer[0] = calloc(1, sizeof(unsigned[devices_count][per_device_data_saved][2])); if (!ring_buffer->ring_buffer[0]) { perror("Cannot allocate memory: "); exit(EXIT_FAILURE); } ring_buffer->ring_buffer[1] = malloc(sizeof(unsigned[devices_count][per_device_data_saved][buffer_size])); if (!ring_buffer->ring_buffer[1]) { perror("Cannot allocate memory: "); exit(EXIT_FAILURE); } ring_buffer->buffer_size = buffer_size; ring_buffer->per_device_data_saved = per_device_data_saved; ring_buffer->monitored_dev_count = devices_count; } void interface_free_ring_buffer(interface_ring_buffer *buffer) { free(buffer->ring_buffer[0]); free(buffer->ring_buffer[1]); } extern inline unsigned interface_ring_buffer_data_stored(const interface_ring_buffer *buff, unsigned device, unsigned which_data); extern inline unsigned interface_index_in_ring(const interface_ring_buffer *buff, unsigned device, unsigned which_data, unsigned index); extern inline unsigned interface_ring_buffer_get(const interface_ring_buffer *buff, unsigned device, unsigned which_data, unsigned index); extern inline void interface_ring_buffer_push(interface_ring_buffer *buff, unsigned device, unsigned which_data, unsigned value); extern inline void interface_ring_buffer_pop(interface_ring_buffer *buff, unsigned device, unsigned which_data); extern inline void interface_ring_buffer_empty_select(interface_ring_buffer *buff, unsigned device, unsigned which_data); extern inline void interface_ring_buffer_empty(interface_ring_buffer *buff, unsigned device); nvtop-3.0.2/src/interface_setup_win.c000066400000000000000000001132041444130114000176430ustar00rootroot00000000000000/* * * Copyright (C) 2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/interface_setup_win.h" #include "nvtop/interface.h" #include "nvtop/interface_internal_common.h" #include "nvtop/interface_options.h" #include "nvtop/interface_ring_buffer.h" #include static char *setup_window_category_names[setup_window_selection_count] = {"General", "Devices", "Chart", "Processes", "GPU Select"}; // All the windows used to display the setup enum setup_window_type { setup_window_type_setup, setup_window_type_single, setup_window_type_split_left, setup_window_type_split_right, setup_window_type_count }; // General Options enum setup_general_options { setup_general_color, setup_general_show_startup_support_messages, setup_general_update_interval, setup_general_options_count }; static const char *setup_general_option_description[setup_general_options_count] = { "Disable color (requires save and restart)", "Show support messages on startup", "Update interval (seconds)"}; // Header Options enum setup_header_options { setup_header_toggle_fahrenheit, setup_header_enc_dec_timer, setup_header_options_count }; static const char *setup_header_option_descriptions[setup_header_options_count] = { "Temperature in fahrenheit", "Keep displaying Encoder/Decoder rate (after reaching an idle state)"}; // Chart Options enum setup_chart_options { setup_chart_reverse, setup_chart_all_gpu, setup_chart_start_gpu_list, setup_chart_options_count }; static const char *setup_chart_options_descriptions[setup_chart_options_count] = { "Reverse plot direction", "Displayed all GPUs", "Displayed GPU"}; static const char *setup_chart_gpu_value_descriptions[plot_information_count] = { "GPU utilization rate", "GPU memory utilization rate", "GPU encoder rate", "GPU decoder rate", "GPU temperature", "Power draw rate (current/max)", "Fan speed", "GPU clock rate", "GPU memory clock rate"}; // Process List Options enum setup_proc_list_options { setup_proc_list_hide_nvtop_process, setup_proc_list_sort_ascending, setup_proc_list_sort_by, setup_proc_list_display, setup_proc_list_options_count }; static const char *setup_proc_list_option_description[setup_proc_list_options_count] = { "Hide nvtop process", "Sort Ascending", "Sort by", "Field Displayed"}; static const char *setup_proc_list_value_descriptions[process_field_count] = { "Process Id", "User name", "Device Id", "Workload type", "GPU usage", "Encoder usage", "Decoder usage", "GPU memory usage", "CPU usage", "CPU memory usage", "Command"}; static unsigned int sizeof_setup_windows[setup_window_type_count] = {[setup_window_type_setup] = 11, [setup_window_type_single] = 0, [setup_window_type_split_left] = 26, [setup_window_type_split_right] = 0}; // For toggle options // Show * if on, - if partial and nothing if off enum option_state { option_off, option_on, option_partially_active, }; static char option_state_char(enum option_state state) { switch (state) { case option_on: return '*'; case option_partially_active: return '-'; case option_off: return ' '; default: return ' '; } } void alloc_setup_window(struct window_position *position, struct setup_window *setup_win) { setup_win->visible = false; setup_win->clean_space = newwin(position->sizeY, position->sizeX, position->posY, position->posX); sizeof_setup_windows[setup_window_type_single] = position->sizeX - sizeof_setup_windows[setup_window_type_setup] - 1; if (sizeof_setup_windows[setup_window_type_single] > position->sizeX) sizeof_setup_windows[setup_window_type_single] = 0; sizeof_setup_windows[setup_window_type_split_right] = position->sizeX - sizeof_setup_windows[setup_window_type_setup] - sizeof_setup_windows[setup_window_type_split_left] - 2; if (sizeof_setup_windows[setup_window_type_split_right] > position->sizeX) sizeof_setup_windows[setup_window_type_split_right] = 0; setup_win->setup = newwin(position->sizeY, sizeof_setup_windows[setup_window_type_setup], position->posY, position->posX); setup_win->single = newwin(position->sizeY, sizeof_setup_windows[setup_window_type_single], position->posY, position->posX + sizeof_setup_windows[setup_window_type_setup] + 1); setup_win->split[0] = newwin(position->sizeY, sizeof_setup_windows[setup_window_type_split_left], position->posY, position->posX + sizeof_setup_windows[setup_window_type_setup] + 1); setup_win->split[1] = newwin(position->sizeY, sizeof_setup_windows[setup_window_type_split_right], position->posY, position->posX + sizeof_setup_windows[setup_window_type_setup] + sizeof_setup_windows[setup_window_type_split_left] + 2); } void free_setup_window(struct setup_window *setup_win) { delwin(setup_win->clean_space); delwin(setup_win->setup); delwin(setup_win->single); delwin(setup_win->split[0]); delwin(setup_win->split[1]); } void show_setup_window(struct nvtop_interface *interface) { interface->setup_win.visible = true; touchwin(interface->setup_win.clean_space); wnoutrefresh(interface->setup_win.clean_space); interface->setup_win.selected_section = setup_general_selected; interface->setup_win.indentation_level = 0; interface->setup_win.options_selected[0] = 0; interface->setup_win.options_selected[1] = 0; } void hide_setup_window(struct nvtop_interface *interface) { interface->setup_win.visible = false; } static void draw_setup_window_setup(struct nvtop_interface *interface) { werase(interface->setup_win.setup); mvwprintw(interface->setup_win.setup, 0, 0, "Setup"); mvwchgat(interface->setup_win.setup, 0, 0, sizeof_setup_windows[setup_window_type_setup], A_STANDOUT, green_color, NULL); for (enum setup_window_section category = setup_general_selected; category < setup_window_selection_count; ++category) { mvwprintw(interface->setup_win.setup, category + 1, 0, "%s", setup_window_category_names[category]); if (interface->setup_win.selected_section == category) { if (interface->setup_win.indentation_level == 0) { set_attribute_between(interface->setup_win.setup, category + 1, 0, sizeof_setup_windows[setup_window_type_setup], A_STANDOUT, cyan_color); } else { mvwprintw(interface->setup_win.setup, category + 1, sizeof_setup_windows[setup_window_type_setup] - 1, ">"); set_attribute_between(interface->setup_win.setup, category + 1, 0, sizeof_setup_windows[setup_window_type_setup], A_BOLD, cyan_color); } } } wnoutrefresh(interface->setup_win.setup); } static void draw_setup_window_general(struct nvtop_interface *interface) { if (interface->setup_win.indentation_level > 1) interface->setup_win.indentation_level = 1; if (interface->setup_win.indentation_level == 1 && interface->setup_win.options_selected[0] >= setup_general_options_count) interface->setup_win.options_selected[0] = setup_general_options_count - 1; wattr_set(interface->setup_win.single, A_STANDOUT, green_color, NULL); mvwprintw(interface->setup_win.single, 0, 0, "General Options"); wstandend(interface->setup_win.single); unsigned int cur_col, maxcols, tmp; (void)tmp; getmaxyx(interface->setup_win.single, tmp, maxcols); getyx(interface->setup_win.single, tmp, cur_col); mvwchgat(interface->setup_win.single, 0, cur_col, maxcols - cur_col, A_STANDOUT, green_color, NULL); enum option_state option_state = !interface->options.use_color; mvwprintw(interface->setup_win.single, setup_general_color + 1, 0, "[%c] %s", option_state_char(option_state), setup_general_option_description[setup_general_color]); if (interface->setup_win.indentation_level == 1 && interface->setup_win.options_selected[0] == setup_general_color) { mvwchgat(interface->setup_win.single, setup_general_color + 1, 0, 3, A_STANDOUT, cyan_color, NULL); } option_state = interface->options.show_startup_messages; mvwprintw(interface->setup_win.single, setup_general_show_startup_support_messages + 1, 0, "[%c] %s", option_state_char(option_state), setup_general_option_description[setup_general_show_startup_support_messages]); if (interface->setup_win.indentation_level == 1 && interface->setup_win.options_selected[0] == setup_general_show_startup_support_messages) { mvwchgat(interface->setup_win.single, setup_general_show_startup_support_messages + 1, 0, 3, A_STANDOUT, cyan_color, NULL); } int update_deciseconds = (interface->options.update_interval / 100) % 10; int update_seconds = interface->options.update_interval / 1000; mvwprintw(interface->setup_win.single, setup_general_update_interval + 1, 0, "[%2u.%u] %s", update_seconds, update_deciseconds, setup_general_option_description[setup_general_update_interval]); if (interface->setup_win.indentation_level == 1 && interface->setup_win.options_selected[0] == setup_general_update_interval) { mvwchgat(interface->setup_win.single, setup_general_update_interval + 1, 0, 6, A_STANDOUT, cyan_color, NULL); } wnoutrefresh(interface->setup_win.single); } static void draw_setup_window_header(struct nvtop_interface *interface) { if (interface->setup_win.indentation_level > 1) interface->setup_win.indentation_level = 1; if (interface->setup_win.options_selected[0] > setup_header_enc_dec_timer) interface->setup_win.options_selected[0] = setup_header_enc_dec_timer; WINDOW *options_win = interface->setup_win.single; wattr_set(options_win, A_STANDOUT, green_color, NULL); mvwprintw(options_win, 0, 0, "Devices Display Options"); wstandend(options_win); unsigned int cur_col, maxcols, tmp; (void)tmp; getmaxyx(options_win, tmp, maxcols); getyx(options_win, tmp, cur_col); mvwchgat(options_win, 0, cur_col, maxcols - cur_col, A_STANDOUT, green_color, NULL); enum option_state option_state; // Fahrenheit Option option_state = interface->options.temperature_in_fahrenheit; mvwprintw(options_win, setup_header_toggle_fahrenheit + 1, 0, "[%c] %s", option_state_char(option_state), setup_header_option_descriptions[setup_header_toggle_fahrenheit]); if (interface->setup_win.indentation_level == 1 && interface->setup_win.options_selected[0] == setup_header_toggle_fahrenheit) { mvwchgat(options_win, setup_header_toggle_fahrenheit + 1, 0, 3, A_STANDOUT, cyan_color, NULL); } // Encode/Decode hiding timer if (interface->options.encode_decode_hiding_timer > 0) { mvwprintw(options_win, setup_header_enc_dec_timer + 1, 0, "[%3.0fsec] %s", interface->options.encode_decode_hiding_timer, setup_header_option_descriptions[setup_header_enc_dec_timer]); } else { mvwprintw(options_win, setup_header_enc_dec_timer + 1, 0, "[always] %s", setup_header_option_descriptions[setup_header_enc_dec_timer]); } if (interface->setup_win.indentation_level == 1 && interface->setup_win.options_selected[0] == setup_header_enc_dec_timer) { mvwchgat(options_win, setup_header_enc_dec_timer + 1, 0, 8, A_STANDOUT, cyan_color, NULL); } wnoutrefresh(options_win); } static void draw_setup_window_chart(unsigned devices_count, struct list_head *devices, struct nvtop_interface *interface) { WINDOW *option_list_win; // Fix indices for this window if (interface->setup_win.options_selected[0] > devices_count + 1) interface->setup_win.options_selected[0] = devices_count + 1; if (interface->setup_win.options_selected[0] > 0) { if (interface->setup_win.options_selected[1] >= plot_information_count) interface->setup_win.options_selected[1] = plot_information_count - 1; option_list_win = interface->setup_win.split[0]; } else { if (interface->setup_win.indentation_level > 1) interface->setup_win.indentation_level = 1; option_list_win = interface->setup_win.single; } werase(interface->setup_win.single); wnoutrefresh(interface->setup_win.single); touchwin(interface->setup_win.split[0]); touchwin(interface->setup_win.split[1]); wattr_set(option_list_win, A_STANDOUT, green_color, NULL); mvwprintw(option_list_win, 0, 0, "Chart Options"); wstandend(option_list_win); unsigned int cur_col, maxcols, tmp; (void)tmp; getmaxyx(option_list_win, tmp, maxcols); getyx(option_list_win, tmp, cur_col); mvwchgat(option_list_win, 0, cur_col, maxcols - cur_col, A_STANDOUT, green_color, NULL); enum option_state option_state; // Reverse plot option_state = interface->options.plot_left_to_right; mvwprintw(option_list_win, setup_chart_reverse + 1, 0, "[%c] %s", option_state_char(option_state), setup_chart_options_descriptions[setup_chart_reverse]); if (interface->setup_win.indentation_level == 1 && interface->setup_win.options_selected[0] == setup_chart_reverse) { mvwchgat(option_list_win, setup_chart_reverse + 1, 0, 3, A_STANDOUT, cyan_color, NULL); } // Set for all GPUs at once if (interface->setup_win.options_selected[0] == setup_chart_all_gpu) { if (interface->setup_win.indentation_level == 1) wattr_set(option_list_win, A_STANDOUT, cyan_color, NULL); if (interface->setup_win.indentation_level == 2) wattr_set(option_list_win, A_BOLD, cyan_color, NULL); } mvwaddch(option_list_win, setup_chart_all_gpu + 1, 1, ACS_HLINE); waddch(option_list_win, '>'); wstandend(option_list_win); wprintw(option_list_win, " %s", setup_chart_options_descriptions[setup_chart_all_gpu]); // GPUs as a list for (unsigned i = 0; i < devices_count; ++i) { if (interface->setup_win.options_selected[0] == setup_chart_start_gpu_list + i) { if (interface->setup_win.indentation_level == 1) wattr_set(option_list_win, A_STANDOUT, cyan_color, NULL); if (interface->setup_win.indentation_level == 2) wattr_set(option_list_win, A_BOLD, cyan_color, NULL); } mvwaddch(option_list_win, setup_chart_start_gpu_list + 1 + i, 1, ACS_HLINE); waddch(option_list_win, '>'); wstandend(option_list_win); wprintw(option_list_win, " %s %u", setup_chart_options_descriptions[setup_chart_start_gpu_list], i); } wnoutrefresh(option_list_win); // Window of list of metric to display in chart (4 maximum) if (interface->setup_win.options_selected[0] >= setup_chart_all_gpu) { WINDOW *value_list_win = interface->setup_win.split[1]; wattr_set(value_list_win, A_STANDOUT, green_color, NULL); mvwprintw(value_list_win, 0, 0, "Metric Displayed in Graph"); getmaxyx(value_list_win, tmp, maxcols); unsigned selected_gpu = interface->setup_win.options_selected[0] - setup_chart_start_gpu_list; if (interface->setup_win.options_selected[0] == setup_chart_all_gpu) { wprintw(value_list_win, " (All GPUs)"); } else { // Get the selected device struct gpu_info *device; unsigned index = 0; list_for_each_entry(device, devices, list) { if (index == selected_gpu) break; index++; } if (IS_VALID(gpuinfo_device_name_valid, device->static_info.valid)) { getyx(value_list_win, tmp, cur_col); wprintw(value_list_win, " (%.*s)", maxcols - cur_col - 3, device->static_info.device_name); } else wprintw(value_list_win, " (GPU %u)", selected_gpu); } wclrtoeol(value_list_win); getyx(value_list_win, tmp, cur_col); mvwchgat(value_list_win, 0, cur_col, maxcols - cur_col, A_STANDOUT, green_color, NULL); wattr_set(value_list_win, A_NORMAL, magenta_color, NULL); mvwprintw(value_list_win, 1, 0, "Maximum of 4 metrics per GPU"); wstandend(value_list_win); for (enum plot_information i = plot_gpu_rate; i < plot_information_count; ++i) { if (interface->setup_win.options_selected[0] == setup_chart_all_gpu) { plot_info_to_draw draw_union = 0, draw_intersection = 0xffff; for (unsigned j = 0; j < devices_count; ++j) { draw_union |= interface->options.gpu_specific_opts[j].to_draw; draw_intersection = draw_intersection & interface->options.gpu_specific_opts[j].to_draw; } if (plot_isset_draw_info(i, draw_intersection)) { option_state = option_on; } else { if (plot_isset_draw_info(i, draw_union)) option_state = option_partially_active; else option_state = option_off; } } else { option_state = plot_isset_draw_info(i, interface->options.gpu_specific_opts[selected_gpu].to_draw); } mvwprintw(value_list_win, i + 2, 0, "[%c] %s", option_state_char(option_state), setup_chart_gpu_value_descriptions[i]); if (interface->setup_win.indentation_level == 2 && interface->setup_win.options_selected[1] == i) { mvwchgat(value_list_win, i + 2, 0, 3, A_STANDOUT, cyan_color, NULL); } } wnoutrefresh(value_list_win); } } static void draw_setup_window_proc_list(struct nvtop_interface *interface) { WINDOW *option_list_win; if (interface->setup_win.options_selected[0] >= setup_proc_list_options_count) interface->setup_win.options_selected[0] = setup_proc_list_options_count - 1; if (interface->setup_win.options_selected[0] < setup_proc_list_sort_by) { option_list_win = interface->setup_win.single; if (interface->setup_win.indentation_level > 1) interface->setup_win.indentation_level = 1; } else { option_list_win = interface->setup_win.split[0]; if (interface->setup_win.options_selected[0] == setup_proc_list_sort_by) { unsigned fields_count = process_field_displayed_count(interface->options.process_fields_displayed); if (!fields_count) { if (interface->setup_win.indentation_level > 1) interface->setup_win.indentation_level = 1; } else { if (interface->setup_win.options_selected[1] >= fields_count) interface->setup_win.options_selected[1] = fields_count - 1; } } if (interface->setup_win.options_selected[0] == setup_proc_list_display) { if (interface->setup_win.options_selected[1] >= process_field_count) interface->setup_win.options_selected[1] = process_field_count - 1; } } werase(interface->setup_win.single); wnoutrefresh(interface->setup_win.single); touchwin(interface->setup_win.split[0]); touchwin(interface->setup_win.split[1]); wattr_set(option_list_win, A_STANDOUT, green_color, NULL); mvwprintw(option_list_win, 0, 0, "Process List Options"); wstandend(option_list_win); unsigned int cur_col, maxcols, tmp; (void)tmp; getmaxyx(option_list_win, tmp, maxcols); getyx(option_list_win, tmp, cur_col); mvwchgat(option_list_win, 0, cur_col, maxcols - cur_col, A_STANDOUT, green_color, NULL); // Sort Ascending enum option_state option_state = interface->options.filter_nvtop_pid; mvwprintw(option_list_win, setup_proc_list_hide_nvtop_process + 1, 0, "[%c] %s", option_state_char(option_state), setup_proc_list_option_description[setup_proc_list_hide_nvtop_process]); if (interface->setup_win.indentation_level == 1 && interface->setup_win.options_selected[0] == setup_proc_list_hide_nvtop_process) { mvwchgat(option_list_win, setup_proc_list_hide_nvtop_process + 1, 0, 3, A_STANDOUT, cyan_color, NULL); } option_state = !interface->options.sort_descending_order; mvwprintw(option_list_win, setup_proc_list_sort_ascending + 1, 0, "[%c] %s", option_state_char(option_state), setup_proc_list_option_description[setup_proc_list_sort_ascending]); if (interface->setup_win.indentation_level == 1 && interface->setup_win.options_selected[0] == setup_proc_list_sort_ascending) { mvwchgat(option_list_win, setup_proc_list_sort_ascending + 1, 0, 3, A_STANDOUT, cyan_color, NULL); } for (enum setup_proc_list_options i = setup_proc_list_sort_by; i < setup_proc_list_options_count; ++i) { if (interface->setup_win.options_selected[0] == i) { if (interface->setup_win.indentation_level == 1) wattr_set(option_list_win, A_STANDOUT, cyan_color, NULL); if (interface->setup_win.indentation_level == 2) wattr_set(option_list_win, A_BOLD, cyan_color, NULL); } mvwaddch(option_list_win, i + 1, 1, ACS_HLINE); waddch(option_list_win, '>'); wstandend(option_list_win); wprintw(option_list_win, " %s", setup_proc_list_option_description[i]); wnoutrefresh(option_list_win); } if (interface->setup_win.options_selected[0] >= setup_proc_list_sort_by) { WINDOW *value_list_win = interface->setup_win.split[1]; // Sort by if (interface->setup_win.options_selected[0] == setup_proc_list_sort_by) { wattr_set(value_list_win, A_STANDOUT, green_color, NULL); mvwprintw(value_list_win, 0, 0, "Processes are sorted by:"); wstandend(value_list_win); wclrtoeol(value_list_win); getmaxyx(value_list_win, tmp, maxcols); getyx(value_list_win, tmp, cur_col); mvwchgat(value_list_win, 0, cur_col, maxcols - cur_col, A_STANDOUT, green_color, NULL); unsigned index = 0; for (enum process_field field = process_pid; field < process_field_count; ++field) { if (process_is_field_displayed(field, interface->options.process_fields_displayed)) { option_state = interface->options.sort_processes_by == field; mvwprintw(value_list_win, index + 1, 0, "[%c] %s", option_state_char(option_state), setup_proc_list_value_descriptions[field]); wclrtoeol(value_list_win); if (interface->setup_win.indentation_level == 2 && interface->setup_win.options_selected[1] == index) { mvwchgat(value_list_win, index + 1, 0, 3, A_STANDOUT, cyan_color, NULL); wmove(value_list_win, field + 2, 0); } index++; } } if (!index) { // Nothing displayed wcolor_set(value_list_win, magenta_color, NULL); mvwprintw(value_list_win, 1, 0, "Nothing to sort: none of the process fields are displayed"); wstandend(value_list_win); } } // Process field displayed if (interface->setup_win.options_selected[0] == setup_proc_list_display) { wattr_set(value_list_win, A_STANDOUT, green_color, NULL); mvwprintw(value_list_win, 0, 0, "Process Field Displayed:"); wstandend(value_list_win); wclrtoeol(value_list_win); getmaxyx(value_list_win, tmp, maxcols); getyx(value_list_win, tmp, cur_col); mvwchgat(value_list_win, 0, cur_col, maxcols - cur_col, A_STANDOUT, green_color, NULL); for (enum process_field field = process_pid; field < process_field_count; ++field) { option_state = process_is_field_displayed(field, interface->options.process_fields_displayed); mvwprintw(value_list_win, field + 1, 0, "[%c] %s", option_state_char(option_state), setup_proc_list_value_descriptions[field]); wclrtoeol(value_list_win); if (interface->setup_win.indentation_level == 2 && interface->setup_win.options_selected[1] == field) { mvwchgat(value_list_win, field + 1, 0, 3, A_STANDOUT, cyan_color, NULL); wmove(value_list_win, field + 2, 0); } } } wclrtobot(value_list_win); wnoutrefresh(value_list_win); } } static void draw_setup_window_gpu_select(struct nvtop_interface *interface) { if (interface->setup_win.indentation_level > 1) interface->setup_win.indentation_level = 1; if (interface->setup_win.indentation_level == 1 && interface->setup_win.options_selected[0] >= interface->total_dev_count) interface->setup_win.options_selected[0] = interface->total_dev_count - 1; wattr_set(interface->setup_win.single, A_STANDOUT, green_color, NULL); mvwprintw(interface->setup_win.single, 0, 0, "Select Monitored GPUs"); wstandend(interface->setup_win.single); unsigned int cur_col, maxcols, tmp; (void)tmp; getmaxyx(interface->setup_win.single, tmp, maxcols); getyx(interface->setup_win.single, tmp, cur_col); mvwchgat(interface->setup_win.single, 0, cur_col, maxcols - cur_col, A_STANDOUT, green_color, NULL); for (unsigned devId = 0; devId < interface->total_dev_count; ++devId) { mvwprintw(interface->setup_win.single, devId + 1, 0, "[%c] %s", option_state_char(!interface->options.gpu_specific_opts[devId].doNotMonitor), interface->options.gpu_specific_opts[devId].linkedGpu->static_info.device_name); if (interface->setup_win.indentation_level == 1 && interface->setup_win.options_selected[0] == devId) mvwchgat(interface->setup_win.single, devId + 1, 0, 3, A_STANDOUT, cyan_color, NULL); } wnoutrefresh(interface->setup_win.single); } static const char *setup_window_shortcuts[] = {"Enter", "ESC", "Arrow keys", "+/-", "F12"}; static const char *setup_window_shortcut_description[] = {"Toggle", "Exit", "Navigate Menu", "Increment/Decrement Values", "Save Config"}; void draw_setup_window_shortcuts(struct nvtop_interface *interface) { WINDOW *window = interface->shortcut_window; wmove(window, 0, 0); for (size_t i = 0; i < ARRAY_SIZE(setup_window_shortcuts); ++i) { wprintw(window, "%s", setup_window_shortcuts[i]); wattr_set(window, A_STANDOUT, cyan_color, NULL); wprintw(window, "%s ", setup_window_shortcut_description[i]); wstandend(window); } wclrtoeol(window); unsigned int cur_col, tmp; (void)tmp; getyx(window, tmp, cur_col); mvwchgat(window, 0, cur_col, -1, A_STANDOUT, cyan_color, NULL); wnoutrefresh(window); } void draw_setup_window(unsigned devices_count, struct list_head *devices, struct nvtop_interface *interface) { draw_setup_window_setup(interface); switch (interface->setup_win.selected_section) { case setup_general_selected: draw_setup_window_general(interface); break; case setup_header_selected: draw_setup_window_header(interface); break; case setup_chart_selected: draw_setup_window_chart(devices_count, devices, interface); break; case setup_process_list_selected: draw_setup_window_proc_list(interface); break; case setup_monitored_gpu_list_selected: draw_setup_window_gpu_select(interface); break; default: break; } } void handle_setup_win_keypress(int keyId, struct nvtop_interface *interface) { if (interface->setup_win.visible) { switch (keyId) { case 'l': case KEY_RIGHT: if (interface->setup_win.indentation_level < 2) interface->setup_win.indentation_level++; break; case 'h': case KEY_LEFT: if (interface->setup_win.indentation_level > 0) interface->setup_win.indentation_level--; break; case 'k': case KEY_UP: if (interface->setup_win.indentation_level == 0) { if (interface->setup_win.selected_section != setup_general_selected) { interface->setup_win.selected_section--; interface->setup_win.options_selected[0] = 0; interface->setup_win.options_selected[1] = 0; werase(interface->setup_win.single); werase(interface->setup_win.split[0]); werase(interface->setup_win.split[1]); wnoutrefresh(interface->setup_win.single); } } else { if (interface->setup_win.indentation_level == 1) interface->setup_win.options_selected[1] = 0; if (interface->setup_win.options_selected[interface->setup_win.indentation_level - 1] != 0) interface->setup_win.options_selected[interface->setup_win.indentation_level - 1]--; } break; case 'j': case KEY_DOWN: if (interface->setup_win.indentation_level == 0) { if (interface->setup_win.selected_section + 1 != setup_window_selection_count) { interface->setup_win.selected_section++; interface->setup_win.options_selected[0] = 0; interface->setup_win.options_selected[1] = 0; werase(interface->setup_win.single); werase(interface->setup_win.split[0]); werase(interface->setup_win.split[1]); wnoutrefresh(interface->setup_win.single); } } else { if (interface->setup_win.indentation_level == 1) interface->setup_win.options_selected[1] = 0; interface->setup_win.options_selected[interface->setup_win.indentation_level - 1]++; } break; case '+': // General Options if (interface->setup_win.selected_section == setup_general_selected) { if (interface->setup_win.options_selected[0] == setup_general_update_interval) { if (interface->options.update_interval <= 99800) interface->options.update_interval += 100; } } // Header options if (interface->setup_win.selected_section == setup_header_selected) { if (interface->setup_win.indentation_level == 1) { if (interface->setup_win.options_selected[0] == setup_header_enc_dec_timer) { interface->options.encode_decode_hiding_timer += 5.; } } } break; case '-': // General Options if (interface->setup_win.selected_section == setup_general_selected) { if (interface->setup_win.options_selected[0] == setup_general_update_interval) { if (interface->options.update_interval >= 200) interface->options.update_interval -= 100; } } // Header options if (interface->setup_win.selected_section == setup_header_selected) { if (interface->setup_win.indentation_level == 1) { if (interface->setup_win.options_selected[0] == setup_header_enc_dec_timer) { interface->options.encode_decode_hiding_timer -= 5.; if (interface->options.encode_decode_hiding_timer < 0.) { interface->options.encode_decode_hiding_timer = 0.; } } } } break; case '\n': case KEY_ENTER: if (interface->setup_win.indentation_level == 0) { handle_setup_win_keypress(KEY_RIGHT, interface); return; } // General Options if (interface->setup_win.selected_section == setup_general_selected) { if (interface->setup_win.options_selected[0] == setup_general_color) { interface->options.use_color = !interface->options.use_color; } if (interface->setup_win.options_selected[0] == setup_general_show_startup_support_messages) { interface->options.show_startup_messages = !interface->options.show_startup_messages; } if (interface->setup_win.options_selected[0] == setup_general_update_interval) { } } // Header Options if (interface->setup_win.selected_section == setup_header_selected) { if (interface->setup_win.indentation_level == 1) { if (interface->setup_win.options_selected[0] == setup_header_toggle_fahrenheit) { interface->options.temperature_in_fahrenheit = !interface->options.temperature_in_fahrenheit; } if (interface->setup_win.options_selected[0] == setup_header_enc_dec_timer) { if (interface->options.encode_decode_hiding_timer > 0.) { interface->options.encode_decode_hiding_timer = 0.; } else { interface->options.encode_decode_hiding_timer = 30.; } } } } // Chart Options if (interface->setup_win.selected_section == setup_chart_selected) { if (interface->setup_win.indentation_level == 1) { if (interface->setup_win.options_selected[0] == setup_chart_reverse) { interface->options.plot_left_to_right = !interface->options.plot_left_to_right; } if (interface->setup_win.options_selected[0] >= setup_chart_all_gpu) { handle_setup_win_keypress(KEY_RIGHT, interface); } } else if (interface->setup_win.indentation_level == 2) { if (interface->setup_win.options_selected[0] == setup_chart_all_gpu) { plot_info_to_draw draw_intersection = 0xffff; for (unsigned j = 0; j < interface->monitored_dev_count; ++j) { draw_intersection = draw_intersection & interface->options.gpu_specific_opts[j].to_draw; } if (plot_isset_draw_info(interface->setup_win.options_selected[1], draw_intersection)) { for (unsigned i = 0; i < interface->monitored_dev_count; ++i) { interface->options.gpu_specific_opts[i].to_draw = plot_remove_draw_info( interface->setup_win.options_selected[1], interface->options.gpu_specific_opts[i].to_draw); interface_ring_buffer_empty(&interface->saved_data_ring, i); } } else { for (unsigned i = 0; i < interface->monitored_dev_count; ++i) { interface->options.gpu_specific_opts[i].to_draw = plot_add_draw_info( interface->setup_win.options_selected[1], interface->options.gpu_specific_opts[i].to_draw); interface_ring_buffer_empty(&interface->saved_data_ring, i); } } } if (interface->setup_win.options_selected[0] > setup_chart_all_gpu) { unsigned selected_gpu = interface->setup_win.options_selected[0] - setup_chart_start_gpu_list; if (plot_isset_draw_info(interface->setup_win.options_selected[1], interface->options.gpu_specific_opts[selected_gpu].to_draw)) interface->options.gpu_specific_opts[selected_gpu].to_draw = plot_remove_draw_info( interface->setup_win.options_selected[1], interface->options.gpu_specific_opts[selected_gpu].to_draw); else interface->options.gpu_specific_opts[selected_gpu].to_draw = plot_add_draw_info( interface->setup_win.options_selected[1], interface->options.gpu_specific_opts[selected_gpu].to_draw); interface_ring_buffer_empty(&interface->saved_data_ring, selected_gpu); } } } // Process List Options if (interface->setup_win.selected_section == setup_process_list_selected) { if (interface->setup_win.indentation_level == 1) { if (interface->setup_win.options_selected[0] == setup_proc_list_sort_ascending) { interface->options.sort_descending_order = !interface->options.sort_descending_order; } else if (interface->setup_win.options_selected[0] == setup_proc_list_hide_nvtop_process) { interface->options.filter_nvtop_pid = !interface->options.filter_nvtop_pid; } else if (interface->setup_win.options_selected[0] == setup_proc_list_sort_by) { handle_setup_win_keypress(KEY_RIGHT, interface); } } else if (interface->setup_win.indentation_level == 2) { if (interface->setup_win.options_selected[0] == setup_proc_list_sort_by) { unsigned index = 0; for (enum process_field field = process_pid; field < process_field_count; ++field) { if (process_is_field_displayed(field, interface->options.process_fields_displayed)) { if (index == interface->setup_win.options_selected[1]) interface->options.sort_processes_by = field; index++; } } } if (interface->setup_win.options_selected[0] == setup_proc_list_display) { if (process_is_field_displayed(interface->setup_win.options_selected[1], interface->options.process_fields_displayed)) { interface->options.process_fields_displayed = process_remove_field_to_display( interface->setup_win.options_selected[1], interface->options.process_fields_displayed); } else { interface->options.process_fields_displayed = process_add_field_to_display( interface->setup_win.options_selected[1], interface->options.process_fields_displayed); } if (!process_is_field_displayed(interface->options.sort_processes_by, interface->options.process_fields_displayed)) { interface->options.sort_processes_by = process_default_sort_by_from(interface->options.process_fields_displayed); } } } } if (interface->setup_win.selected_section == setup_monitored_gpu_list_selected) { if (interface->setup_win.indentation_level == 1) { interface->options.gpu_specific_opts[interface->setup_win.options_selected[0]].doNotMonitor = !interface->options.gpu_specific_opts[interface->setup_win.options_selected[0]].doNotMonitor; interface->options.has_monitored_set_changed = true; } } break; case KEY_F(2): case 27: interface->setup_win.visible = false; update_window_size_to_terminal_size(interface); break; case KEY_F(12): save_interface_options_to_config_file(interface->total_dev_count, &interface->options); break; default: break; } } } nvtop-3.0.2/src/nvtop.c000066400000000000000000000264251444130114000147640ustar00rootroot00000000000000/* * * Copyright (C) 2017-2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include #include #include #include #include #include #include #include #include "nvtop/extract_gpuinfo.h" #include "nvtop/info_messages.h" #include "nvtop/interface.h" #include "nvtop/interface_common.h" #include "nvtop/interface_options.h" #include "nvtop/time.h" #include "nvtop/version.h" static volatile sig_atomic_t signal_exit = 0; static volatile sig_atomic_t signal_resize_win = 0; static void exit_handler(int signum) { (void)signum; signal_exit = 1; } static void resize_handler(int signum) { (void)signum; signal_resize_win = 1; } static const char helpstring[] = "Available options:\n" " -d --delay : Select the refresh rate (1 == 0.1s)\n" " -v --version : Print the version and exit\n" " -c --config-file : Provide a custom config file location to load/save " "preferences\n" " -p --no-plot : Disable bar plot\n" " -r --reverse-abs : Reverse abscissa: plot the recent data left and " "older on the right\n" " -C --no-color : No colors\n" "line information\n" " -f --freedom-unit : Use fahrenheit\n" " -E --encode-hide : Set encode/decode auto hide time in seconds " "(default 30s, negative = always on screen)\n" " -h --help : Print help and exit\n"; static const char versionString[] = "nvtop version " NVTOP_VERSION_STRING; static const struct option long_opts[] = { {.name = "delay", .has_arg = required_argument, .flag = NULL, .val = 'd'}, {.name = "version", .has_arg = no_argument, .flag = NULL, .val = 'v'}, {.name = "help", .has_arg = no_argument, .flag = NULL, .val = 'h'}, {.name = "config-file", .has_arg = required_argument, .flag = NULL, .val = 'c'}, {.name = "no-color", .has_arg = no_argument, .flag = NULL, .val = 'C'}, {.name = "no-colour", .has_arg = no_argument, .flag = NULL, .val = 'C'}, {.name = "freedom-unit", .has_arg = no_argument, .flag = NULL, .val = 'f'}, {.name = "encode-hide", .has_arg = required_argument, .flag = NULL, .val = 'E'}, {.name = "no-plot", .has_arg = no_argument, .flag = NULL, .val = 'p'}, {.name = "reverse-abs", .has_arg = no_argument, .flag = NULL, .val = 'r'}, {0, 0, 0, 0}, }; static const char opts[] = "hvd:c:CfE:pr"; int main(int argc, char **argv) { (void)setlocale(LC_CTYPE, ""); opterr = 0; bool update_interval_option_set = false; int update_interval_option; bool no_color_option = false; bool use_fahrenheit_option = false; bool hide_plot_option = false; bool reverse_plot_direction_option = false; bool encode_decode_timer_option_set = false; double encode_decode_hide_time = -1.; char *custom_config_file_path = NULL; while (true) { int optchar = getopt_long(argc, argv, opts, long_opts, NULL); if (optchar == -1) break; switch (optchar) { case 'd': { char *endptr = NULL; long int delay_val = strtol(optarg, &endptr, 0); if (endptr == optarg) { fprintf(stderr, "Error: The delay must be a positive value " "representing tenths of seconds\n"); exit(EXIT_FAILURE); } if (delay_val < 0) { fprintf(stderr, "Error: A negative delay requires a time machine!\n"); exit(EXIT_FAILURE); } update_interval_option_set = true; update_interval_option = (int)delay_val * 100u; if (update_interval_option > 99900) update_interval_option = 99900; if (update_interval_option < 100) update_interval_option = 100; } break; case 'v': printf("%s\n", versionString); exit(EXIT_SUCCESS); case 'h': printf("%s\n%s", versionString, helpstring); exit(EXIT_SUCCESS); case 'c': custom_config_file_path = optarg; break; case 'C': no_color_option = true; break; case 'f': use_fahrenheit_option = true; break; case 'E': { if (sscanf(optarg, "%lf", &encode_decode_hide_time) == EOF) { fprintf(stderr, "Invalid format for encode/decode hide time: %s\n", optarg); exit(EXIT_FAILURE); } encode_decode_timer_option_set = true; } break; case 'p': hide_plot_option = true; break; case 'r': reverse_plot_direction_option = true; break; case ':': case '?': switch (optopt) { case 'd': fprintf(stderr, "Error: The delay option takes a positive value " "representing tenths of seconds\n"); break; default: fprintf(stderr, "Unhandled error in getopt missing argument\n"); exit(EXIT_FAILURE); break; } exit(EXIT_FAILURE); } } setenv("ESCDELAY", "10", 1); struct sigaction siga; siga.sa_flags = 0; sigemptyset(&siga.sa_mask); siga.sa_handler = exit_handler; if (sigaction(SIGINT, &siga, NULL) != 0) { perror("Impossible to set signal handler for SIGINT: "); exit(EXIT_FAILURE); } if (sigaction(SIGQUIT, &siga, NULL) != 0) { perror("Impossible to set signal handler for SIGQUIT: "); exit(EXIT_FAILURE); } siga.sa_handler = resize_handler; if (sigaction(SIGWINCH, &siga, NULL) != 0) { perror("Impossible to set signal handler for SIGWINCH: "); exit(EXIT_FAILURE); } unsigned allDevCount = 0; LIST_HEAD(monitoredGpus); LIST_HEAD(nonMonitoredGpus); if (!gpuinfo_init_info_extraction(&allDevCount, &monitoredGpus)) return EXIT_FAILURE; if (allDevCount == 0) { fprintf(stdout, "No GPU to monitor.\n"); return EXIT_SUCCESS; } unsigned numWarningMessages = 0; const char **warningMessages; get_info_messages(&monitoredGpus, &numWarningMessages, &warningMessages); nvtop_interface_option allDevicesOptions; alloc_interface_options_internals(custom_config_file_path, allDevCount, &monitoredGpus, &allDevicesOptions); load_interface_options_from_config_file(allDevCount, &allDevicesOptions); for (unsigned i = 0; i < allDevCount; ++i) { // Nothing specified in the file if (!plot_isset_draw_info(plot_information_count, allDevicesOptions.gpu_specific_opts[i].to_draw)) { allDevicesOptions.gpu_specific_opts[i].to_draw = plot_default_draw_info(); } else { allDevicesOptions.gpu_specific_opts[i].to_draw = plot_remove_draw_info(plot_information_count, allDevicesOptions.gpu_specific_opts[i].to_draw); } } if (!process_is_field_displayed(process_field_count, allDevicesOptions.process_fields_displayed)) { allDevicesOptions.process_fields_displayed = process_default_displayed_field(); } else { allDevicesOptions.process_fields_displayed = process_remove_field_to_display(process_field_count, allDevicesOptions.process_fields_displayed); } if (no_color_option) allDevicesOptions.use_color = false; if (hide_plot_option) { for (unsigned i = 0; i < allDevCount; ++i) { allDevicesOptions.gpu_specific_opts[i].to_draw = 0; } } if (encode_decode_timer_option_set) { allDevicesOptions.encode_decode_hiding_timer = encode_decode_hide_time; if (allDevicesOptions.encode_decode_hiding_timer < 0.) allDevicesOptions.encode_decode_hiding_timer = 0.; } if (reverse_plot_direction_option) allDevicesOptions.plot_left_to_right = true; if (use_fahrenheit_option) allDevicesOptions.temperature_in_fahrenheit = true; if (update_interval_option_set) allDevicesOptions.update_interval = update_interval_option; gpuinfo_populate_static_infos(&monitoredGpus); unsigned numMonitoredGpus = interface_check_and_fix_monitored_gpus(allDevCount, &monitoredGpus, &nonMonitoredGpus, &allDevicesOptions); if (allDevicesOptions.show_startup_messages) { bool dont_show_again = show_information_messages(numWarningMessages, warningMessages); if (dont_show_again) { allDevicesOptions.show_startup_messages = false; save_interface_options_to_config_file(allDevCount, &allDevicesOptions); } } struct nvtop_interface *interface = initialize_curses(allDevCount, numMonitoredGpus, interface_largest_gpu_name(&monitoredGpus), allDevicesOptions); timeout(interface_update_interval(interface)); double time_slept = interface_update_interval(interface); while (!signal_exit) { if (signal_resize_win) { signal_resize_win = 0; update_window_size_to_terminal_size(interface); } interface_check_monitored_gpu_change(&interface, allDevCount, &numMonitoredGpus, &monitoredGpus, &nonMonitoredGpus); if (time_slept >= interface_update_interval(interface)) { gpuinfo_refresh_dynamic_info(&monitoredGpus); if (!interface_freeze_processes(interface)) { gpuinfo_refresh_processes(&monitoredGpus); gpuinfo_fix_dynamic_info_from_process_info(&monitoredGpus); } save_current_data_to_ring(&monitoredGpus, interface); timeout(interface_update_interval(interface)); time_slept = 0.; } else { int next_sleep = interface_update_interval(interface) - (int)time_slept; timeout(next_sleep); } draw_gpu_info_ncurses(numMonitoredGpus, &monitoredGpus, interface); nvtop_time time_before_sleep, time_after_sleep; nvtop_get_current_time(&time_before_sleep); int input_char = getch(); nvtop_get_current_time(&time_after_sleep); time_slept += nvtop_difftime(time_before_sleep, time_after_sleep) * 1000; switch (input_char) { case 27: // ESC { timeout(0); int in = getch(); if (in == ERR) { // ESC alone if (is_escape_for_quit(interface)) signal_exit = 1; else interface_key(27, interface); } // else ALT key } break; case KEY_F(10): if (is_escape_for_quit(interface)) signal_exit = 1; break; case 'q': signal_exit = 1; break; case KEY_F(2): case KEY_F(9): case KEY_F(6): case KEY_F(12): case '+': case '-': interface_key(input_char, interface); break; case 'k': case KEY_UP: case 'j': case KEY_DOWN: case 'h': case KEY_LEFT: case 'l': case KEY_RIGHT: case KEY_ENTER: case '\n': interface_key(input_char, interface); break; case ERR: default: break; } } clean_ncurses(interface); gpuinfo_shutdown_info_extraction(&monitoredGpus); return EXIT_SUCCESS; } nvtop-3.0.2/src/plot.c000066400000000000000000000121221444130114000145610ustar00rootroot00000000000000/* * * Copyright (C) 2019-2021 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/plot.h" #include "nvtop/common.h" #include #include #include #include static inline int data_level(double rows, double data, double increment) { return (int)(rows - round(data / increment)); } void nvtop_line_plot(WINDOW *win, size_t num_data, const double *data, unsigned num_lines, bool legend_left, char legend[MAX_LINES_PER_PLOT][PLOT_MAX_LEGEND_SIZE]) { if (num_data == 0) return; int rows, cols; getmaxyx(win, rows, cols); rows -= 1; double increment = 100. / (double)(rows); assert(num_lines <= MAX_LINES_PER_PLOT && "Cannot plot more than " EXPAND_AND_QUOTE(MAX_LINES_PER_PLOT) " lines"); unsigned lvl_before[MAX_LINES_PER_PLOT]; for (size_t k = 0; k < num_lines; ++k) lvl_before[k] = data_level(rows, data[k], increment); for (size_t i = 0; i < num_data || i < (size_t)cols; i += num_lines) { for (unsigned k = 0; k < num_lines; ++k) { unsigned lvl_now_k = data_level(rows, data[i + k], increment); wcolor_set(win, k + 1, NULL); // Three cases: has increased, has decreased and remained level if (lvl_before[k] < lvl_now_k || lvl_before[k] > lvl_now_k) { // Case 1 and 2: has increased/decreased // An increase goes down on the plot because (0,0) is top left bool drawing_down = lvl_before[k] < lvl_now_k; unsigned bottom = drawing_down ? lvl_before[k] : lvl_now_k; unsigned top = drawing_down ? lvl_now_k : lvl_before[k]; // Draw the vertical line corners mvwaddch(win, bottom, i + k, drawing_down ? ACS_URCORNER : ACS_ULCORNER); mvwaddch(win, top, i + k, drawing_down ? ACS_LLCORNER : ACS_LRCORNER); // Draw the vertical line between the corners if (top - bottom > 1) { mvwvline(win, bottom + 1, i + k, 0, top - bottom - 1); } // Draw the continuation of the other metrics for (unsigned j = 0; j < num_lines; ++j) { if (j != k) { if (lvl_before[j] == top) // The continuation is at the same level as the bottom corner mvwaddch(win, top, i + k, ACS_BTEE); else if (lvl_before[j] == bottom) // The continuation is at the same level as the top corner mvwaddch(win, bottom, i + k, ACS_TTEE); else if (lvl_before[j] > bottom && lvl_before[j] < top) // The continuation lies on the vertical line mvwaddch(win, lvl_before[j], i + k, ACS_PLUS); else { // The continuation lies outside the update interval so keep the // color wcolor_set(win, j + 1, NULL); mvwaddch(win, lvl_before[j], i + k, ACS_HLINE); wcolor_set(win, k + 1, NULL); } } } } else { // Case 3: stayed level mvwhline(win, lvl_now_k, i + k, 0, 1); for (unsigned j = 0; j < num_lines; ++j) { if (j != k) { if (lvl_before[j] != lvl_now_k) { // Add the continuation of other metric lines wcolor_set(win, j + 1, NULL); mvwaddch(win, lvl_before[j], i + k, ACS_HLINE); wcolor_set(win, k + 1, NULL); } } } } lvl_before[k] = lvl_now_k; } } int plot_y_position = 0; for (unsigned i = 0; i < num_lines && plot_y_position < rows; ++i) { wcolor_set(win, i + 1, NULL); if (legend_left) { mvwprintw(win, plot_y_position, 0, "%.*s", cols, legend[i]); } else { size_t length = strlen(legend[i]); if (length <= (size_t)cols) { mvwprintw(win, plot_y_position, cols - length, "%s", legend[i]); } else { mvwprintw(win, plot_y_position, 0, "%.*s", (int)(length - cols), legend[i]); } } plot_y_position++; } } void draw_rectangle(WINDOW *win, unsigned startX, unsigned startY, unsigned sizeX, unsigned sizeY) { mvwhline(win, startY, startX + 1, 0, sizeX - 2); mvwhline(win, startY + sizeY - 1, startX + 1, 0, sizeX - 2); mvwvline(win, startY + 1, startX, 0, sizeY - 2); mvwvline(win, startY + 1, startX + sizeX - 1, 0, sizeY - 2); mvwaddch(win, startY, startX, ACS_ULCORNER); mvwaddch(win, startY, startX + sizeX - 1, ACS_URCORNER); mvwaddch(win, startY + sizeY - 1, startX, ACS_LLCORNER); mvwaddch(win, startY + sizeY - 1, startX + sizeX - 1, ACS_LRCORNER); } nvtop-3.0.2/src/time.c000066400000000000000000000023741444130114000145510ustar00rootroot00000000000000/* * * Copyright (C) 2018-2022 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include "nvtop/time.h" extern inline void nvtop_get_current_time(nvtop_time *time); extern inline double nvtop_difftime(nvtop_time t0, nvtop_time t1); extern inline uint64_t nvtop_difftime_u64(nvtop_time t0, nvtop_time t1); extern inline uint64_t nvtop_time_u64(nvtop_time t0); extern inline nvtop_time nvtop_add_time(nvtop_time t0, nvtop_time t1); extern inline nvtop_time nvtop_substract_time(nvtop_time t0, nvtop_time t1); extern inline nvtop_time nvtop_hmns_to_time(unsigned hour, unsigned minutes, unsigned long nanosec); nvtop-3.0.2/tests/000077500000000000000000000000001444130114000140145ustar00rootroot00000000000000nvtop-3.0.2/tests/CMakeLists.txt000066400000000000000000000014131444130114000165530ustar00rootroot00000000000000find_package(GTest) if (BUILD_TESTING AND GTest_FOUND) option(THOROUGH_TESTING "Enable extensive testing (takes hours, e.g., use once per release)" OFF) # Create a library for testing add_library(testLib ${PROJECT_SOURCE_DIR}/src/interface_layout_selection.c ${PROJECT_SOURCE_DIR}/src/interface_options.c ${PROJECT_SOURCE_DIR}/src/ini.c ) target_include_directories(testLib PUBLIC ${PROJECT_SOURCE_DIR}/include ${PROJECT_BINARY_DIR}/include) # Tests add_executable( interfaceTests interfaceTests.cpp ) target_link_libraries(interfaceTests PRIVATE testLib GTest::gtest_main) gtest_discover_tests(interfaceTests) if (THOROUGH_TESTING) target_compile_definitions(interfaceTests PRIVATE THOROUGH_TESTING) endif() endif() nvtop-3.0.2/tests/interfaceTests.cpp000066400000000000000000000232711444130114000175100ustar00rootroot00000000000000/* * * Copyright (C) 2022 Maxime Schmitt * * This file is part of Nvtop. * * Nvtop is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Nvtop is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with nvtop. If not, see . * */ #include #include #include #include extern "C" { #include "nvtop/interface.h" #include "nvtop/interface_layout_selection.h" } static std::ostream &operator<<(std::ostream &os, const struct window_position &win) { os << "Win (" << win.posX << ", " << win.posY << ")--(" << win.posX + win.sizeX << "," << win.posY + win.sizeY << ")"; return os; } namespace { // Returns true if the two windows overlap, false otherwise. bool window_position_overlap(struct window_position &w1, struct window_position &w2) { bool overlapX = w1.posX == w2.posX || (w1.posX < w2.posX && w1.posX + w1.sizeX - 1 >= w2.posX) || (w1.posX > w2.posX && w2.posX + w2.sizeX - 1 >= w1.posX); bool overlapY = w1.posY == w2.posY || (w1.posY < w2.posY && w1.posY + w1.sizeY - 1 >= w2.posY) || (w1.posY > w2.posY && w2.posY + w2.sizeY - 1 >= w1.posY); return overlapX && overlapY; } bool window_is_empty(const struct window_position &w1) { return w1.sizeX == 0 || w1.sizeY == 0; } // Check that the window is not empty // Returns true if the window is not empty bool check_non_empty_window(const struct window_position &w1) { EXPECT_GT(w1.sizeX, 0) << "Window " << w1 << " should not be empty"; EXPECT_GT(w1.sizeY, 0) << "Window " << w1 << " should not be empty"; return not window_is_empty(w1); } // Check that the none of the windows overlap any other bool check_no_windows_overlap(std::vector &windows) { bool has_overlap = false; for (unsigned winId = 0; winId < windows.size(); ++winId) { struct window_position ¤tWin = windows[winId]; for (unsigned winCompareId = winId + 1; winCompareId < windows.size(); ++winCompareId) { struct window_position &compareTo = windows[winCompareId]; bool overlaps = window_position_overlap(currentWin, compareTo); EXPECT_FALSE(overlaps) << "Between " << currentWin << " and " << compareTo; has_overlap = has_overlap || overlaps; } } return !has_overlap; } // Check that win does not extend past the container // Returns true if win is contained inside the container bool check_window_inside(const struct window_position &win, const struct window_position &container) { bool insideX = win.posX >= container.posX && win.posX + win.sizeX - 1 <= container.posX + container.sizeX - 1; EXPECT_TRUE(insideX) << win << " is not inside " << container; bool insideY = win.posY >= container.posY && win.posY + win.sizeY - 1 <= container.posY + container.sizeY - 1; EXPECT_TRUE(insideY) << win << " is not inside " << container; return insideX && insideY; } // Check that w1 is below w2 bool check_window_below(const struct window_position &w1, const struct window_position &w2) { EXPECT_GT(w1.posY, w2.posY + w2.sizeY - 1) << w1 << " is not below " << w2; return w1.posY > w2.posY + w2.sizeY - 1; } // Returns true if the layout is valid bool check_layout(struct window_position screen, std::vector &dev_pos, std::vector &plot_position, struct window_position process_position, struct window_position setup_position) { bool layout_valid = true; // Header // A particularity of the header is that it can be bigger than the screen for (auto const &dev_win : dev_pos) { bool valid = check_non_empty_window(dev_win); if (!valid) std::cout << "Error with header window: " << dev_win << std::endl; layout_valid = layout_valid && valid; } layout_valid = layout_valid && check_no_windows_overlap(dev_pos); // Plots for (auto const &plot_win : plot_position) { bool valid = check_non_empty_window(plot_win); if (!valid) std::cout << "Error with plot window: " << plot_win << std::endl; layout_valid = layout_valid && valid; } for (auto const &dev_win : dev_pos) { for (auto const &plot_win : plot_position) { layout_valid = layout_valid && check_window_below(plot_win, dev_win); layout_valid = layout_valid && check_window_inside(plot_win, screen); } } layout_valid = layout_valid && check_no_windows_overlap(plot_position); // Processes for (auto const &plot_win : plot_position) { layout_valid = layout_valid && check_window_below(process_position, plot_win); } if (not window_is_empty(process_position)) layout_valid = layout_valid && check_window_inside(process_position, screen); return layout_valid; } bool test_with_terminal_size(unsigned device_count, unsigned header_rows, unsigned header_cols, unsigned rows, unsigned cols) { struct window_position screen = {.posX = 0, .posY = 0, .sizeX = cols, .sizeY = rows}; nvtop_interface_gpu_opts to_draw_default = {.to_draw = plot_default_draw_info()}; std::vector plot_display(device_count, to_draw_default); process_field_displayed proc_display = process_default_displayed_field(); unsigned num_plots = 0; std::vector dev_positions(device_count); std::vector plot_positions(MAX_CHARTS); struct window_position process_position; struct window_position setup_position; std::vector map_dev_to_plot(device_count); compute_sizes_from_layout(device_count, header_rows, header_cols, rows, cols, plot_display.data(), proc_display, dev_positions.data(), &num_plots, plot_positions.data(), map_dev_to_plot.data(), &process_position, &setup_position); plot_positions.resize(num_plots); return check_layout(screen, dev_positions, plot_positions, process_position, setup_position); } } // namespace TEST(InterfaceLayout, LayoutSelection_issue_147) { test_with_terminal_size(8, 3, 78, 26, 189); } TEST(InterfaceLayout, CheckEmptyProcessWindow) { unsigned device_count = 3, header_rows = 3, header_cols = 55, rows = 4, cols = 120; struct window_position screen = {.posX = 0, .posY = 0, .sizeX = cols, .sizeY = rows}; nvtop_interface_gpu_opts to_draw_default = {.to_draw = plot_default_draw_info()}; std::vector plot_display(device_count, to_draw_default); process_field_displayed proc_display = process_default_displayed_field(); unsigned num_plots = 0; std::vector dev_positions(device_count); std::vector plot_positions(MAX_CHARTS); struct window_position process_position; struct window_position setup_position; std::vector map_dev_to_plot(device_count); compute_sizes_from_layout(device_count, header_rows, header_cols, rows, cols, plot_display.data(), proc_display, dev_positions.data(), &num_plots, plot_positions.data(), map_dev_to_plot.data(), &process_position, &setup_position); plot_positions.resize(num_plots); EXPECT_EQ(num_plots, 0); EXPECT_TRUE(window_is_empty(process_position)); } TEST(InterfaceLayout, FixInfiniteLoop) { unsigned device_count = 3, header_rows = 3, header_cols = 55, rows = 22, cols = 25; struct window_position screen = {.posX = 0, .posY = 0, .sizeX = cols, .sizeY = rows}; nvtop_interface_gpu_opts to_draw_default = {.to_draw = plot_default_draw_info()}; std::vector plot_display(device_count, to_draw_default); process_field_displayed proc_display = process_default_displayed_field(); unsigned num_plots = 0; std::vector dev_positions(device_count); std::vector plot_positions(MAX_CHARTS); struct window_position process_position; struct window_position setup_position; std::vector map_dev_to_plot(device_count); compute_sizes_from_layout(device_count, header_rows, header_cols, rows, cols, plot_display.data(), proc_display, dev_positions.data(), &num_plots, plot_positions.data(), map_dev_to_plot.data(), &process_position, &setup_position); plot_positions.resize(num_plots); } TEST(InterfaceLayout, LayoutSelection_test_fail_case1) { test_with_terminal_size(32, 3, 55, 16, 1760); } #ifdef THOROUGH_TESTING TEST(InterfaceLayout, CheckManyTermSize) { const std::array dev_count_to_test = {0, 1, 2, 3, 6, 16, 32, 64}; const std::map extra_increment = {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {6, 4}, {16, 6}, {32, 8}, {64, 17}}; for (unsigned dev_count : dev_count_to_test) { for (unsigned screen_rows = 1; screen_rows < 2048; screen_rows += 1 + extra_increment.at(dev_count)) { for (unsigned screen_cols = 1; screen_cols < 2048; screen_cols += 1 + extra_increment.at(dev_count)) { for (unsigned header_cols = 55; header_cols < 120; header_cols += 1 + extra_increment.at(dev_count)) { ASSERT_TRUE(test_with_terminal_size(dev_count, 3, header_cols, screen_rows, screen_cols)) << "Problem found with " << dev_count << " devices, (" << 3 << ", header " << header_cols << "), terminal size (" << screen_rows << ", " << screen_cols << ")"; } } } } } #endif // THOROUGH_TESTING