def get_driver(): """ Get the driver version """ if is_macos: driver = pynvx.cudaSystemGetDriverVersion(ignore=True) else: try: driver = pynvml.nvmlSystemGetDriverVersion().decode("utf-8") except pynvml.NVMLError: driver = "No Nvidia driver found" return driver
def _get_driver(self) -> str: """ Obtain the Nvidia driver version currently in use. Returns ------- str The current GPU driver version """ driver = pynvx.cudaSystemGetDriverVersion(ignore=True) # pylint:disable=no-member self._log("debug", f"GPU Driver: {driver}") return driver
def get_driver(self): """ Get the driver version """ if IS_MACOS: driver = pynvx.cudaSystemGetDriverVersion(ignore=True) else: try: driver = pynvml.nvmlSystemGetDriverVersion().decode("utf-8") except pynvml.NVMLError: driver = "No Nvidia driver found" if self.logger: self.logger.debug("GPU Driver: %s", driver) return driver
def _get_driver(self): """ Obtain and return the installed driver version for the system's GPUs. Returns ------- str The currently installed GPU driver version """ if self._is_plaidml: driver = self._plaid.drivers elif IS_MACOS: driver = pynvx.cudaSystemGetDriverVersion(ignore=True) else: try: driver = pynvml.nvmlSystemGetDriverVersion().decode("utf-8") except pynvml.NVMLError: driver = "No Nvidia driver found" self._log("debug", "GPU Driver: {}".format(driver)) return driver
def print_info(): try: pynvx.cudaInit() except RuntimeError as e: print(e) return print('================ CUDA INFO =====================') print('Driver Version : {}'.format(pynvx.cudaSystemGetDriverVersion())) print('Runtime Version : {}'.format(pynvx.cudaSystemGetRuntimeVersion())) print('Device Count : {}'.format(pynvx.cudaDeviceGetCount())) handles = pynvx.cudaDeviceGetHandles() for handle in handles: print('------------------------------------------------') print('Device {}:'.format(handle)) print('Device Name : {}'.format( pynvx.cudaGetName(handle))) print('Device ClockRate : {} MHz'.format( pynvx.cudaGetClockRate(handle) / 1024)) print('Device ComputeCapability : {}'.format( pynvx.cudaGetComputeCapability(handle))) print('Device ProcessorCount : {}'.format( pynvx.cudaGetMultiProcessorCount(handle))) print('Device PciBusID : {}'.format( pynvx.cudaGetPciBusID(handle))) print('Device PciDeviceID : {}'.format( pynvx.cudaGetPciDeviceID(handle))) print('Device PciDomainID : {}'.format( pynvx.cudaGetPciDomainID(handle))) print('Device MemTotal : {} MiB'.format( pynvx.cudaGetMemTotal(handle) / (1024 * 1024))) print('Device MemFree : {} MiB'.format( pynvx.cudaGetMemFree(handle) / (1024 * 1024))) print('Device MemUsed : {} MiB'.format( pynvx.cudaGetMemUsed(handle) / (1024 * 1024)))
def test_driver_version(): v = m.cudaSystemGetDriverVersion(ignore=True) assert isinstance(v, int)