  
          # Failed to load nvcc, manual check
          getattr(self, f"_cuda_check_{self._os}")()
  
      def _cuda_check_linux(self):
          """ For Linux check the dynamic link loader for libcudart. If not found with ldconfig then
          attempt to find it in LD_LIBRARY_PATH. """
          chk = os.popen("ldconfig -p | grep -P \"libcudart.so.\\d+.\\d+\" | head -n 1").read()
          if not chk and os.environ.get("LD_LIBRARY_PATH"):
              for path in os.environ["LD_LIBRARY_PATH"].split(":"):
 
</s> remove     def _get_checkfiles_linux(self):
 </s> add     def _get_checkfiles_linux(self) -> List[str]: </s> remove     def _cuda_check(self):
 </s> add     def _cuda_check(self) -> None: </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 __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     def _cuda_check_windows(self):
 </s> add     def _cuda_check_windows(self) -> None:
    def _cuda_check_linux(self) -> None:
  
          # Failed to load nvcc, manual check
          getattr(self, f"_cuda_check_{self._os}")()
  
    def _cuda_check_linux(self) -> None:
          """ For Linux check the dynamic link loader for libcudart. If not found with ldconfig then
          attempt to find it in LD_LIBRARY_PATH. """
          chk = os.popen("ldconfig -p | grep -P \"libcudart.so.\\d+.\\d+\" | head -n 1").read()
          if not chk and os.environ.get("LD_LIBRARY_PATH"):
              for path in os.environ["LD_LIBRARY_PATH"].split(":"):
keep keep keep keep replace keep keep keep keep keep
 pin protobuf

Setup: automatically detect for apple-silicon 
setup.py