Projet

Général

Profil

Révision 73bf78e7

ID73bf78e7653c6fa434bcfaf7d4d3169eabc1c91f
Parent 24e77a26
Enfant 1dbbe77c

Ajouté par Lee Clemens il y a environ 11 ans

backwards compatible grep for memory

Potentially will work for 5.5 and earlier, as well as 6 and 6.5 (tested with 6.5)

Voir les différences:

plugins/gpu/nvidia_gpu_
127 127
			;;
128 128
		mem)
129 129
			# First determine total memory of each GPU...
130
			gpusTotalMemOutput=`echo "$smiOutput" | grep -A 3 "Memory Usage" | grep "Total" | cut -d : -f 2 | tr -d ' '`
130
			gpusTotalMemOutput=`echo "$smiOutput" | grep -v BAR1 | grep -A 3 "Memory Usage" | grep "Total" | cut -d : -f 2 | tr -d ' '`
131 131
			gpusTotalMem=''
132 132
			nGpusCounter=0
133 133
			while [ $nGpusCounter -lt $nGpus ]
......
189 189
		valueGpus=`echo "$smiOutput" | grep -A 1 "Temperature" | grep "Gpu" | cut -d : -f 2 | cut -d ' ' -f 2`
190 190
		;;
191 191
	mem)
192
		totalMemGpus=`echo "$smiOutput" | grep -A 3 "Memory Usage" | grep "Total" | cut -d : -f 2 | cut -d ' ' -f 2`
193
		usedMemGpus=`echo "$smiOutput" | grep -A 3 "Memory Usage" | grep "Used" | cut -d : -f 2 | cut -d ' ' -f 2`
192
		totalMemGpus=`echo "$smiOutput" | grep -v BAR1 | grep -A 3 "Memory Usage" | grep "Total" | cut -d : -f 2 | cut -d ' ' -f 2`
193
		usedMemGpus=`echo "$smiOutput" | grep -v BAR1 | grep -A 3 "Memory Usage" | grep "Used" | cut -d : -f 2 | cut -d ' ' -f 2`
194 194
		valueGpus=''
195 195
		nGpusCounter=0
196 196
		while [ $nGpusCounter -lt $nGpus ]

Formats disponibles : Unified diff