              stdout, stderr = chk.communicate()
          if not stderr:
              version = re.search(r".*release (?P<cuda>\d+\.\d+)",
                                  stdout.decode(locale.getpreferredencoding()))
              self.cuda_version = version.groupdict().get("cuda", None)
              locate = "where" if self._os == "windows" else "which"
              path = os.popen(f"{locate} nvcc").read()
              if path:
                  path = path.split("\n")[0]  # Split multiple entries and take first found
                  while True:  # Get Cuda root folder
 
</s> remove     def _cuda_check_windows(self):
 </s> add     def _cuda_check_windows(self) -> None: </s> remove     def __init__(self):
        self.cuda_path = None
        self.cuda_version = None
        self.cudnn_version = None
 </s> add     def __init__(self) -> None:
        self.cuda_path: Optional[str] = None
        self.cuda_version: Optional[str] = None
        self.cudnn_version: Optional[str] = None </s> remove         self._os = platform.system().lower()
        self._cuda_keys = [key for key in os.environ if key.lower().startswith("cuda_path_v")]
        self._cudnn_header_files = ["cudnn_version.h", "cudnn.h"]
 </s> add         self._os: str = platform.system().lower()
        self._cuda_keys: List[str] = [key
                                      for key in os.environ
                                      if key.lower().startswith("cuda_path_v")]
        self._cudnn_header_files: List[str] = ["cudnn_version.h", "cudnn.h"] </s> remove         if (not self.updater and
                self.os_version[0].lower() == "darwin" and
                platform.machine() == "arm64" and not self.is_conda):
            self.output.error("Setting up Faceswap for Apple Silicon outside of a Conda "
                              "environment is unsupported")
            sys.exit(1)
 </s> add         if self.os_version[0].lower() == "darwin" and platform.machine() == "arm64":
            self.enable_apple_silicon = True

            if not self.updater and not self.is_conda:
                self.output.error("Setting up Faceswap for Apple Silicon outside of a Conda "
                                  "environment is unsupported")
                sys.exit(1) </s> remove     def _cuda_check_linux(self):
 </s> add     def _cuda_check_linux(self) -> None:
            if version is not None:
                self.cuda_version = version.groupdict().get("cuda", None)
              stdout, stderr = chk.communicate()
          if not stderr:
              version = re.search(r".*release (?P<cuda>\d+\.\d+)",
                                  stdout.decode(locale.getpreferredencoding()))
            if version is not None:
                self.cuda_version = version.groupdict().get("cuda", None)
              locate = "where" if self._os == "windows" else "which"
              path = os.popen(f"{locate} nvcc").read()
              if path:
                  path = path.split("\n")[0]  # Split multiple entries and take first found
                  while True:  # Get Cuda root folder
keep keep keep keep replace keep keep keep keep keep
 pin protobuf

Setup: automatically detect for apple-silicon 
setup.py