|
| 1 | +# Compile Anakin for Intel SGX |
| 2 | +Currently, only Linux is supported. You can either use Ubuntu or Cent OS, with |
| 3 | +the versions supported by Intel SGX Linux driver. Check out the latest versions |
| 4 | +of SGX software stack [here](https://01.org/intel-software-guard-extensions/downloads). |
| 5 | + |
| 6 | +## Steps |
| 7 | + |
| 8 | +Follow these steps to build and run Anakin in an SGX secure enclave. |
| 9 | + |
| 10 | + 1. Check out if your CPU and motherboard support SGX. Boot into your BIOS |
| 11 | + and see if there is an option controlling the availability of SGX. If |
| 12 | +there is such an option, turn it on. |
| 13 | + 2. Download and Install Intel SGX SDK and driver. The software packages and |
| 14 | + documentation can be found at [Intel Open |
| 15 | +Source](https://01.org/intel-software-guard-extensions/downloads). |
| 16 | + 3. Download and Install Intel MKL (not MKL-ML or MKL-DNN). You will need |
| 17 | + MKL 2019 Update 3. Older versions of MKL may cause problems like memory |
| 18 | +leak. |
| 19 | + 4. Run the [SGX build script](../../tools/sgx_build.sh). |
| 20 | + 5. If the build succeeds, you will find an executable called `anakin_app` |
| 21 | + under the `sgx_build/sgx` directory. The executable provides basic |
| 22 | +interfaces to help you quickly deploy a model and run some inference tasks. |
| 23 | +However, if you really need to use Anakin for SGX in production, you have to |
| 24 | +customize the ECALL/OCALL interfaces your self. the corresponding code can be |
| 25 | +found at [here](../../sgx). |
| 26 | + |
| 27 | +## Support |
| 28 | + |
| 29 | +SGX can be a complicated concept to understand for beginners. Feel free to |
| 30 | +submit any issues if you are interested in extra security but new to SGX. In |
| 31 | +case you are a systems developer and are knowledgeable about Intel chip |
| 32 | +technology, you may find this [paper](https://eprint.iacr.org/2016/086.pdf) |
| 33 | +helpful. |
| 34 | + |
| 35 | +## Disclaimer |
| 36 | + |
| 37 | +Anakin for SGX is still experimental and under active development. It is not |
| 38 | +extensively tested as on other platforms. Some operators and models may not be |
| 39 | +supported. Also, due to the limitations of the hardware, you will likely suffer |
| 40 | +from some performance degradation. You can report considerably slow cases to us |
| 41 | +to help improve Anakin for SGX. |
0 commit comments