Colab 系統資源
The Virtual Machine(VM) used for Colaboratory has 13GB RAM and 2 vCPU
- 2-core Xeon 2.3GHz
- 13GB RAM
- 359GB HDD
- Telsa K80 GPU
maximum lifetime of a VM is 12 hours. Idle VMs time out after 90mins [0].
See System Information Using Command Line Tools
type
!cat /proc/cpuinfo
Figure 1 CPU of Colab (Dual-core 2.3GHz XEON chip)
type
!cat /proc/meminfo
Figure 2 Memory of Colab (13GB total)
type
!df -h
Figure 3 Disk space of Colab (359GB total)
type
!nvidia-smi
Figure 4 GPU info. of Colab (Telsa K80)
See CPU and GPU info using Python Package
type
# memory footprint support libraries/code
!ln -sf /opt/bin/nvidia-smi /usr/bin/nvidia-smi
!pip install gputil
!pip install psutil
!pip install humanize
import psutil
import humanize
import os
import GPUtil as GPU
GPUs = GPU.getGPUs()
# XXX: only one GPU on Colab and isn’t guaranteed
gpu = GPUs[0]
def printm():
process = psutil.Process(os.getpid())
print("Gen RAM Free: " + humanize.naturalsize( psutil.virtual_memory().available ), " | Proc size: " + humanize.naturalsize( process.memory_info().rss))
print("GPU RAM Free: {0:.0f}MB | Used: {1:.0f}MB | Util {2:3.0f}% | Total {3:.0f}MB".format(gpu.memoryFree, gpu.memoryUsed, gpu.memoryUtil*100, gpu.memoryTotal))
printm()
Figure 5 CPU and GPU memory usage
[0]
https://stackoverflow.com/questions/47805170/whats-the-hardware-spec-for-google-colaboratory
[1]
Detail of Memory, CPU, Disk usage
[2]
VM Spec.