From 20f33ecb754ad0450b01302607de20be35706a45 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Sat, 15 Oct 2022 21:40:05 +0800 Subject: [PATCH] fix(cli): fix GPU process type filtering Signed-off-by: Xuehai Pan --- nvitop/cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nvitop/cli.py b/nvitop/cli.py index 2a70e1b..3287a0a 100644 --- a/nvitop/cli.py +++ b/nvitop/cli.py @@ -315,13 +315,13 @@ def main(): # pylint: disable=too-many-branches,too-many-statements,too-many-lo filters = [] if args.compute: - filters.append(lambda process: 'C' in process.type) + filters.append(lambda process: 'C' in process.type or 'X' in process.type) if args.no_compute: - filters.append(lambda process: 'C' not in process.type) + filters.append(lambda process: 'C' not in process.type and 'X' not in process.type) if args.graphics: - filters.append(lambda process: 'G' in process.type) + filters.append(lambda process: 'G' in process.type or 'X' in process.type) if args.no_graphics: - filters.append(lambda process: 'G' not in process.type) + filters.append(lambda process: 'G' not in process.type and 'X' not in process.type) if args.user is not None: users = set(args.user) filters.append(lambda process: process.username in users)