schrodinger.gpgpu module¶
schrodinger::gpgpu C++ wrappers
- class schrodinger.gpgpu.CudaDevice¶
schrodinger::gpgpu::CudaDevice Container for device specific query information
- __init__(*args, **kwargs)¶
- computeCapability(self) std::array< int,2 >¶
Retrieves the compute capability for this device. Compute capability is specified as (major version, minor version)
- computeMode(self) std::string¶
Retrieves the current compute mode for the device.
- cores(self) int¶
Retrieves the total number of CUDA device cores
- description(self) std::string¶
String describing the given GPGPU device.
- discountedCores(self) int¶
Retrieves scaled down number of CUDA device core for customer discount. :rtype: int :return: scaled down number of cuda cores if pciDeviceId
(The combined 16-bit device id and 16-bit vendor id) and CUDA core counts match the discounted GPU card/s. Otherwise, it returns actual CUDA device cores.
- get_device_info(self) DeviceInfo¶
Retrieve general device information, such as index, name, UUID, compute mode, and capability.
- get_mig_info(self) MIGInfo¶
Retrieve MIG device information, such as index, GPU and CPU instances, UUID, and memory size. This getter is added for swig. This method must be called after checking mig_enabled() is true, otherwise it will throw. :raises: if device does not support MIG or not enabled
- mig_enabled(self) bool¶
Is MIG enabled for this device or not?
- name(self) std::string¶
Retrieves the ASCII string identifying this device.
- number(self) int¶
Retrieves the CUDA device number.
- uuid(self) std::string¶
Retrieves the globally unique immutable UUID associated with this device.
- class schrodinger.gpgpu.DeviceInfo¶
schrodinger::gpgpu::DeviceInfo Container for general device information
- __init__(*args, **kwargs)¶
- capability¶
- compute_mode¶
- cores¶
- name¶
- number¶
- pci_device_id¶
Combination of Device Id + Vendor Id
- uuid¶
- class schrodinger.gpgpu.MIGInfo¶
schrodinger::gpgpu::MIGInfo Container for MIG device information
- __init__(*args, **kwargs)¶
- cpu_count¶
MIG compute instance slice count
- gpu_count¶
MIG gpu instance slice count
- memory_size_MB¶
MIG memory size in MiB
- number¶
MIG device index
- sm_count¶
Multiprocessor count
- uuid¶
MIG UUID
- schrodinger.gpgpu.get_available_devices() std::vector< schrodinger::gpgpu::CudaDevice,std::allocator< schrodinger::gpgpu::CudaDevice > > const &¶
Retrieves device information for the available cuda devices. Note that CUDA runtime examines environment variables once.
- schrodinger.gpgpu.get_device_uuid(pci_bus_id) std::string¶
Retrieves the device UUID using nvml call for given device PCI bus id. :type pci_bus_id: string :param pci_bus_id: string, the PCI bus id of the gpu :raises: runtime_error if nvml initialization, nvmlDeviceGetUUID, or
nvmlDeviceGetHandleByPciBusId call fails.
- Return type:
string
- Returns:
UUID string
- schrodinger.gpgpu.get_minimum_nvml_driver() std::string¶
Get the minimum compatible NVML driver given the CUDA version.
- schrodinger.gpgpu.get_scaled_token_count(host, default_tokens) int¶
Scales the number of default tokens with respect to the number of cores on a V100 card for a given host. If the host does not have a core count defined, default_tokens is returned
- Parameters:
host (string) – name of the host entry
default_tokens (int) – number of tokens a V100 should checkout
- Return type:
int
- Returns:
number of tokens to checkout for the requested host
- schrodinger.gpgpu.in_dev_env() bool¶
Return True if the process is running in a development environment - where SCHRODINGER_SRC or SCHRODINGER_DEV_DEBUG is set.
- schrodinger.gpgpu.is_any_gpu_available() bool¶
Determines if a GPGPU is available for use.
- Return type:
boolean
- Returns:
whether a GPGPU is available on this machine
- schrodinger.gpgpu.print_gpgpu_devices(verbose=True)¶
Writes a summary of available GPGPU devices to stdout.
- Parameters:
verbose (boolean, optional) – whether to print verbose GPGPU descriptions
- schrodinger.gpgpu.verify_any_gpu_available()¶
Verifies that a GPGPU is available for use.
- Raises:
std::runtime_error if no usable GPGPU is available on this machine
- schrodinger.gpgpu.verify_cuda_runtime()¶
Call verify_any_gpu_available with additional CUDA runtime debug information
- Raises:
std::runtime_error if no usable GPGPU is available on this machine
- schrodinger.gpgpu.verify_nvml_driver_supported()¶
Verify if NVML library is loaded successfully and check whether the NVML driver is compatible with the CUDA version. 1. The NVML library is unavailable and we return an empty CudaQuery: we catch it here and throw an runtime error. 2. The NVML library is available, but we have a bad GPU hardware: we will throw runtime error, when we call get_query_singleton(). 3. The NVML library is available and CUDA query is successful: we compare the driver version and throw runtime error if we it does not meet the minimum driver version.
- Raises:
std::runtime_error if NVML library is unavailable, CUDA query failed, or NVML library does not meet the minimum requirement.