I want to use the Intel RAPL interface to record the energy consumption on CPUs. I am using two servers: an AWS EC2 instance and a physical machine.
However, I found that there is no powercap directory under the directory /sys/class on the AWS EC2 instance. After I changed the Linux kernel to version 5.13.19 and have the Intel RAPL configured, there is a power cap directory under /sys/class. But there is no intel-rapl under /sys/class/powercap, so I can not use the RAPL interface as well.
This is what I have under /sys/class/powercap on the AWS EC2 instance:
$ ls /sys/class/powercap
dtpm
This is what I have under /sys/class/powercap on the physical machine, and is also what I expect on the AWS EC2 instance:
$ ls /sys/class/powercap
dtpm intel-rapl intel-rapl:0 intel-rapl:0:0 intel-rapl:1 intel-rapl:1:0
These are the RAPL-related modules on the AWS EC2 instance, which are the same on my physical machine:
$ find /lib/modules/$(uname -r) -name *rapl*
/lib/modules/5.13.19/kernel/drivers/powercap/intel_rapl_common.ko
/lib/modules/5.13.19/kernel/drivers/powercap/intel_rapl_msr.ko
/lib/modules/5.13.19/kernel/drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.ko
/lib/modules/5.13.19/kernel/arch/x86/events/rapl.ko
I can tell from sudo dmidecode -t4 | grep Socket.Designation: | wc -l that there are 4 CPU sockets on the EC2 instance. The cpu for the EC2 instance is Intel Xeon. RAPL is supported for these cpus. So there should be something more under /sys/class/powercap!
I am using the Deep Learning AMI (Ubuntu 18.04) Version 61.2 for the AWS EC2 instance.
Does anyone know why I cannot use powercap and RAPL on the AWS EC2 instance? Is it because the EC2 instance is a virtual machine and the RAPL interface is not supported by the virtual machine? Or have I missed out any steps? I would really appreciate any help. Thank you!