This repository intends to provides a set of benchmarks that can be used to measure the memory bandwidth performance of SGX EPC memory.
Note: Remember to "make clean" before switching build mode
-
Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux OS
-
Figure out the necessary parameters before testing.
- The highest frequency of our platform is 2.7GHz, so set
CPU_MAX_FREQ=2.7
to make the timer in enclave working; - Stream array size is default to 120000000 (approximatly 2.7 GiB memory), set this value to match your requirements.
- The highest frequency of our platform is 2.7GHz, so set
-
Make sure your environment is set:
$ source ${sgx-sdk-install-path}/environment
-
Build the project with the prepared Makefile:
-
Benchmark the EPC memory (hardware mode, and set PRERELEASE=1 to get compiler optimization)
$ make SGX_PRERELEASE=1 SGX_DEBUG=1 CPU_MAX_FREQ=2.7 STREAM_ARRAY_SIZE=120000000
-
Benchmark the normal memory (Simulation Mode, Pre-release build)
$ make clean $ make SGX_MODE=SIM SGX_PRERELEASE=1 SGX_DEBUG=0 CPU_MAX_FREQ=2.7 STREAM_ARRAY_SIZE=120000000
-
You may also need to modify
HeapMaxSize
inEnclave/Enclave.config.xml
for largerSTREAM_ARRAY_SIZE
.
-
-
Execute the binary directly:
$ ./app