              driver = "No Nvidia driver found"
          return driver
  
      def get_devices(self):
          """ Return total vram in megabytes per device """
          vram = [pynvml.nvmlDeviceGetName(handle).decode("utf-8")
                  for handle in self.handles]
          return vram
  
      def get_vram(self):
          """ Return total vram in megabytes per device """
          vram = [pynvml.nvmlDeviceGetMemoryInfo(handle).total / (1024 * 1024)
                  for handle in self.handles]
 
</s> remove         vram = [pynvml.nvmlDeviceGetMemoryInfo(handle).total / (1024 * 1024)
                for handle in self.handles]
 </s> add         self.initialize()
        if is_macos:
            vram = [pynvx.cudaGetMemTotal(handle, ignore=True) / (1024 * 1024)
                    for handle in self.handles]
        else:
            vram = [pynvml.nvmlDeviceGetMemoryInfo(handle).total / (1024 * 1024)
                    for handle in self.handles] </s> remove         try:
            driver = pynvml.nvmlSystemGetDriverVersion().decode("utf-8")
        except pynvml.NVMLError:
            driver = "No Nvidia driver found"
 </s> add         if is_macos:
            driver = pynvx.cudaSystemGetDriverVersion(ignore=True)
        else:
            try:
                driver = pynvml.nvmlSystemGetDriverVersion().decode("utf-8")
            except pynvml.NVMLError:
                driver = "No Nvidia driver found" </s> remove         vram = [pynvml.nvmlDeviceGetMemoryInfo(handle).free / (1024 * 1024)
                for handle in self.handles]
 </s> add         if is_macos:
            vram = [pynvx.cudaGetMemFree(handle, ignore=True) / (1024 * 1024)
                    for handle in self.handles]
        else:
            vram = [pynvml.nvmlDeviceGetMemoryInfo(handle).free / (1024 * 1024)
                    for handle in self.handles] </s> remove         vram = [pynvml.nvmlDeviceGetMemoryInfo(handle).used / (1024 * 1024)
                for handle in self.handles]
 </s> add         if is_macos:
            vram = [pynvx.cudaGetMemUsed(handle, ignore=True) / (1024 * 1024)
                    for handle in self.handles]
        else:
            vram = [pynvml.nvmlDeviceGetMemoryInfo(handle).used / (1024 * 1024)
                    for handle in self.handles] </s> remove         self.handles = [pynvml.nvmlDeviceGetHandleByIndex(i)
                        for i in range(self.device_count)]
 </s> add         if is_macos:
            self.handles = pynvx.cudaDeviceGetHandles(ignore=True)
        else:
            self.handles = [pynvml.nvmlDeviceGetHandleByIndex(i)
                            for i in range(self.device_count)]
        """ Return name of devices """
        self.initialize()
        if is_macos:
            names = [pynvx.cudaGetName(handle, ignore=True)
                    for handle in self.handles]
        else:
            names = [pynvml.nvmlDeviceGetName(handle).decode("utf-8")
                    for handle in self.handles]
        return names
              driver = "No Nvidia driver found"
          return driver
  
      def get_devices(self):
        """ Return name of devices """
        self.initialize()
        if is_macos:
            names = [pynvx.cudaGetName(handle, ignore=True)
                    for handle in self.handles]
        else:
            names = [pynvml.nvmlDeviceGetName(handle).decode("utf-8")
                    for handle in self.handles]
        return names
        """ Return name of devices """
        self.initialize()
        if is_macos:
            names = [pynvx.cudaGetName(handle, ignore=True)
                    for handle in self.handles]
        else:
            names = [pynvml.nvmlDeviceGetName(handle).decode("utf-8")
                    for handle in self.handles]
        return names
        """ Return name of devices """
        self.initialize()
        if is_macos:
            names = [pynvx.cudaGetName(handle, ignore=True)
                    for handle in self.handles]
        else:
            names = [pynvml.nvmlDeviceGetName(handle).decode("utf-8")
                    for handle in self.handles]
        return names
        """ Return name of devices """
        self.initialize()
        if is_macos:
            names = [pynvx.cudaGetName(handle, ignore=True)
                    for handle in self.handles]
        else:
            names = [pynvml.nvmlDeviceGetName(handle).decode("utf-8")
                    for handle in self.handles]
        return names
  
      def get_vram(self):
          """ Return total vram in megabytes per device """
          vram = [pynvml.nvmlDeviceGetMemoryInfo(handle).total / (1024 * 1024)
                  for handle in self.handles]
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Fixed face extract with dlib on OS X (#510)

* fix: gpu stat for OS X
- Use pynvx to get GPU info on OS X
- fix face extract with dlib

Issue #488 
lib/gpu_stats.py