Compare commits
					merge into: hs_tohidi:develop
					
				
				hs_tohidi:add-capture-card
						
							hs_tohidi:client-connection
						
							hs_tohidi:develop
						
							hs_tohidi:develop-Arm
						
							hs_tohidi:video-streaming
						
						
						
						
					
					pull from: hs_tohidi:client-connection
					
				
				hs_tohidi:add-capture-card
						
							hs_tohidi:client-connection
						
							hs_tohidi:develop
						
							hs_tohidi:develop-Arm
						
							hs_tohidi:video-streaming
						
						
						
						
					
	
		
			13 Commits 
		
	
	
		
			develop
			...
			client-con
		
	
    
				 17 changed files with 321 additions and 106 deletions
			
			
		- 
					BINOxygen-Sys-Warning.wav
- 
					161app.py
- 
					2config.yaml
- 
					130core.py
- 
					2detector/demo.py
- 
					47gpuMonitor.py
- 
					1tracker/ltr/external/PreciseRoIPooling/pytorch/prroi_pool/functional.py
- 
					2tracker/ltr/models/backbone/resnet.py
- 
					1tracker/ltr/models/bbreg/atom_iou_net.py
- 
					2tracker/ltr/models/layers/distance.py
- 
					2tracker/ltr/models/target_classifier/features.py
- 
					6tracker/pytracking/features/augmentation.py
- 
					7tracker/pytracking/features/preprocessing.py
- 
					1tracker/pytracking/libs/dcf.py
- 
					3tracker/pytracking/tracker/dimp/dimp.py
- 
					2tracker/pytracking/utils/params.py
- 
					BINvideo_streamer/vision_service.cpython-37m-x86_64-linux-gnu.so
| @ -0,0 +1,47 @@ | |||
| import pynvml | |||
| import time | |||
| from colorama import Fore, Style, init | |||
| import os | |||
| 
 | |||
| # Initialize colorama | |||
| init(autoreset=True) | |||
| 
 | |||
| 
 | |||
| 
 | |||
| def monitor_gpu_ram_usage(interval=2, threshold_gb=2): | |||
|     pynvml.nvmlInit() | |||
|     # Initialize NVML | |||
|     try: | |||
|         device_count = pynvml.nvmlDeviceGetCount() | |||
|         print(f"Found {device_count} GPU(s).") | |||
| 
 | |||
|         while True: | |||
|             for i in range(device_count): | |||
|                 handle = pynvml.nvmlDeviceGetHandleByIndex(i) | |||
|                 info = pynvml.nvmlDeviceGetMemoryInfo(handle) | |||
| 
 | |||
| 
 | |||
| 
 | |||
|                 print(f"GPU {i}:") | |||
|                 print(f"  Total RAM: {info.total / 1024 ** 2:.2f} MB") | |||
|                 if(info.used / 1024 ** 2 >= 2.5 * 1024 ): | |||
|                     print(Fore.RED + f"  Used RAM: {info.used / 1024 ** 2:.2f} MB") | |||
|                     os.system("aplay /home/rog/repos/Tracker/NE-Smart-Tracker/Oxygen-Sys-Warning.wav") | |||
|                 else: | |||
|                     print(f"  Used RAM: {info.used / 1024 ** 2:.2f} MB") | |||
|                 print(f"  Free RAM: {info.free / 1024 ** 2:.2f} MB") | |||
|                 print(Fore.GREEN + "-" * 30) | |||
|                 print(Fore.GREEN) | |||
| 
 | |||
|             time.sleep(interval)  # Wait for the specified interval before checking again | |||
| 
 | |||
|     except KeyboardInterrupt: | |||
|         print("Monitoring stopped by user.") | |||
| 
 | |||
|     finally: | |||
|         # Shutdown NVML | |||
|         pynvml.nvmlShutdown() | |||
| 
 | |||
| if __name__ == "__main__": | |||
|     monitor_gpu_ram_usage(interval=2, threshold_gb=2)  # Check every 2 seconds, threshold is 2 GB | |||
| 
 | |||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue