def print_gpu_info(devices): gpu_groups = {} for device in devices: name = device.get_info(cl.device_info.NAME) if not gpu_groups.has_key(name): gpu_groups[name] = {'count': 1} gpu_groups[name]['compute units'] = \ device.get_info(cl.device_info.MAX_COMPUTE_UNITS) gpu_groups[name]['global mem size'] = \ device.get_info(cl.device_info.GLOBAL_MEM_SIZE) gpu_groups[name]['local mem size'] = \ device.get_info(cl.device_info.LOCAL_MEM_SIZE) gpu_groups[name]['constant mem size'] = \ device.get_info(cl.device_info.MAX_CONSTANT_BUFFER_SIZE) else: gpu_groups[name]['count'] += 1 for name, props in gpu_groups.items(): print('Device : %d GPU' % props['count']) print(' name: %s' % name) print(' compute units: %d' % props['compute units']) print(' global mem size: %1.2f %s' % \ common.binary_prefix_nbytes(props['global mem size']) ) print(' local mem size: %1.2f %s' % \ common.binary_prefix_nbytes(props['local mem size']) ) print(' constant mem size: %1.2f %s' % \ common.binary_prefix_nbytes(props['constant mem size']) ) print('')
def print_gpu_info(devices): gpu_groups = {} for device in devices: name = device.get_info(cl.device_info.NAME) if not gpu_groups.has_key(name): gpu_groups[name] = {'count':1} gpu_groups[name]['compute units'] = \ device.get_info(cl.device_info.MAX_COMPUTE_UNITS) gpu_groups[name]['global mem size'] = \ device.get_info(cl.device_info.GLOBAL_MEM_SIZE) gpu_groups[name]['local mem size'] = \ device.get_info(cl.device_info.LOCAL_MEM_SIZE) gpu_groups[name]['constant mem size'] = \ device.get_info(cl.device_info.MAX_CONSTANT_BUFFER_SIZE) else: gpu_groups[name]['count'] += 1 for name, props in gpu_groups.items(): print('Device : %d GPU' % props['count']) print(' name: %s' % name) print(' compute units: %d' % props['compute units']) print(' global mem size: %1.2f %s' % \ common.binary_prefix_nbytes(props['global mem size']) ) print(' local mem size: %1.2f %s' % \ common.binary_prefix_nbytes(props['local mem size']) ) print(' constant mem size: %1.2f %s' % \ common.binary_prefix_nbytes(props['constant mem size']) ) print('')
def print_gpu_info(): print('CUDA version : %d.%d.%d' % cuda.get_version()) gpu0 = cuda.Device(0) ngpu = gpu0.count() gpu_list = [cuda.Device(i) for i in range(ngpu)] gpu_groups = {} for gpu in gpu_list: name = gpu.name() if not gpu_groups.has_key(name): gpu_groups[name] = {'count' : 1} gpu_groups[name]['compute capability'] = gpu.compute_capability() gpu_groups[name]['global mem size'] = gpu.total_memory() gpu_groups[name]['multiprocessor'] = \ gpu.get_attribute(cuda.device_attribute.MULTIPROCESSOR_COUNT) else: gpu_groups[name]['count'] += 1 for name, props in gpu_groups.items(): print('Device : %d GPU' % props['count']) print(' name: %s' % name) print(' compute capability: %d.%d' % props['compute capability']) print(' multiprocessor: %d' % props['multiprocessor']) print(' global mem size: %1.2f %s' % \ common.binary_prefix_nbytes(props['global mem size']) ) print('')
def print_gpu_info(): print('CUDA version : %d.%d.%d' % cuda.get_version()) gpu0 = cuda.Device(0) ngpu = gpu0.count() gpu_list = [cuda.Device(i) for i in range(ngpu)] gpu_groups = {} for gpu in gpu_list: name = gpu.name() if not gpu_groups.has_key(name): gpu_groups[name] = {'count': 1} gpu_groups[name]['compute capability'] = gpu.compute_capability() gpu_groups[name]['global mem size'] = gpu.total_memory() gpu_groups[name]['multiprocessor'] = \ gpu.get_attribute(cuda.device_attribute.MULTIPROCESSOR_COUNT) else: gpu_groups[name]['count'] += 1 for name, props in gpu_groups.items(): print('Device : %d GPU' % props['count']) print(' name: %s' % name) print(' compute capability: %d.%d' % props['compute capability']) print(' multiprocessor: %d' % props['multiprocessor']) print(' global mem size: %1.2f %s' % \ common.binary_prefix_nbytes(props['global mem size']) ) print('')
def print_cpu_info(): for line in open('/proc/cpuinfo'): if 'model name' in line: cpu_name0 = line[line.find(':')+1:-1] break cpu_name = ' '.join(cpu_name0.split()) for line in open('/proc/meminfo'): if 'MemTotal' in line: mem_nbytes = int(line[line.find(':')+1:line.rfind('kB')]) * 1024 break print('Host Device :') print(' name: %s' % cpu_name) print(' mem size: %1.2f %s' % common.binary_prefix_nbytes(mem_nbytes)) print('')
def print_cpu_info(): for line in open('/proc/cpuinfo'): if 'model name' in line: cpu_name0 = line[line.find(':') + 1:-1] break cpu_name = ' '.join(cpu_name0.split()) for line in open('/proc/meminfo'): if 'MemTotal' in line: mem_nbytes = int(line[line.find(':') + 1:line.rfind('kB')]) * 1024 break print('Host Device :') print(' name: %s' % cpu_name) print(' mem size: %1.2f %s' % common.binary_prefix_nbytes(mem_nbytes)) print('')