hashRateReports is an array with its length equal to the number of GPUs being used, but it is accessed by the miner ID, which will be problematic when certain GPUs are excluded (any not from the end of the list of GPUs).
Take for example a system with two GPUs: 0 and 1. If -E 0 is specified, hashRateReports will be initialized as a list with one element. The only active GPU has a minerID of 1. hashRateReports[1] will be accessed, causing an index out of bounds error.
An easy fix is to change
hashRateReports := make([]float64, nrOfMiningDevices)
to
hashRateReports := make(map[int]float64)
hashRateReportsis an array with its length equal to the number of GPUs being used, but it is accessed by the miner ID, which will be problematic when certain GPUs are excluded (any not from the end of the list of GPUs).Take for example a system with two GPUs: 0 and 1. If -E 0 is specified,
hashRateReportswill be initialized as a list with one element. The only active GPU has aminerIDof 1.hashRateReports[1]will be accessed, causing an index out of bounds error.An easy fix is to change
hashRateReports := make([]float64, nrOfMiningDevices)to
hashRateReports := make(map[int]float64)