MCPcopy Create free account
hub / github.com/RightNow-AI/rightnow-cli / detect_nsys

Method detect_nsys

rightnow_cli/utils/detection.py:735–803  ·  view source on GitHub ↗

Detect NSYS (NVIDIA Nsight Systems profiler). Checks: 1. Configured path (from config) 2. PATH 3. CUDA installation directories Returns: ToolInfo with availability, path, version

(self)

Source from the content-addressed store, hash-verified

733 # ============================================================================
734
735 def detect_nsys(self) -> ToolInfo:
736 """
737 Detect NSYS (NVIDIA Nsight Systems profiler).
738
739 Checks:
740 1. Configured path (from config)
741 2. PATH
742 3. CUDA installation directories
743
744 Returns:
745 ToolInfo with availability, path, version
746 """
747 if 'nsys' in self._cache:
748 return self._cache['nsys']
749
750 # Check configured path first (highest priority)
751 if 'nsys' in self.config_paths and self.config_paths['nsys']:
752 nsys_configured = Path(self.config_paths['nsys'])
753 if nsys_configured.exists():
754 version = self._get_tool_version(str(nsys_configured), ['--version'])
755 info = ToolInfo(
756 available=True,
757 path=str(nsys_configured),
758 version=version
759 )
760 self._cache['nsys'] = info
761 return info
762
763 # Check PATH
764 nsys_path = shutil.which('nsys')
765
766 if nsys_path:
767 version = self._get_tool_version(nsys_path, ['--version'])
768 info = ToolInfo(
769 available=True,
770 path=nsys_path,
771 version=version
772 )
773 self._cache['nsys'] = info
774 return info
775
776 # Check CUDA directories
777 cuda_paths = self._get_cuda_common_paths()
778
779 for cuda_path in cuda_paths:
780 nsys_paths = [
781 cuda_path / 'nsight-systems' / 'bin' / ('nsys.exe' if self.platform == 'Windows' else 'nsys'),
782 cuda_path / 'bin' / ('nsys.exe' if self.platform == 'Windows' else 'nsys'),
783 ]
784
785 for nsys_bin in nsys_paths:
786 if nsys_bin.exists():
787 version = self._get_tool_version(str(nsys_bin), ['--version'])
788 info = ToolInfo(
789 available=True,
790 path=str(nsys_bin),
791 version=version
792 )

Callers 2

get_all_toolsMethod · 0.95
detect_nsysFunction · 0.80

Calls 4

_get_tool_versionMethod · 0.95
ToolInfoClass · 0.85
existsMethod · 0.80

Tested by

no test coverage detected