@misc{https://doi.org/10.48550/arxiv.2209.03125,
doi = {10.48550/ARXIV.2209.03125},
url = {https://arxiv.org/abs/2209.03125},
author = {Ivanov, Andrei and Rothenberger, Benjamin and Dethise, Arnaud and Canini, Marco and Hoefler, Torsten and Perrig, Adrian},
keywords = {Cryptography and Security (cs.CR), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {SAGE: Software-based Attestation for GPU Execution},
publisher = {arXiv},
year = {2022},
copyright = {arXiv.org perpetual, non-exclusive license}
}
引用如上,paper title: SAGE:software-based attestation for GPU execution
github链接是:GitHub - spcl/sage
第一部分:SGX
Prerequisites installation instructions (~30-60 min)
-
Install SGX SDK (this may take around 30-60 minutes depending on the hardware). Follow installation instructions here (default configuration, Ubuntu 20.04): GitHub - intel/linux-sgx: Intel SGX for Linux*
-
Install NVCC
sudo apt update
sudo apt install nvidia-cuda-toolkit
上述都没有任何问题,很顺利。
SAGE Compilation instructions (~5 min)
Before compiling make sure that the environment variables for SGX SDK are set:
source ${sgx-sdk-install-path}/environment
Compile in simulation mode using:
make SGX_MODE=SIM
Run using:
./app
上述仍然没有任何问题。
End-to-end build inside container (~30-60 min)
podman run -it --rm -v ./:/SGX -w /SGX --security-opt label=disable docker.io/nvidia/cuda:11.8.0-devel-ubuntu20.04 /bin/bash -c "\
export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y build-essential ocaml ocamlbuild automake autoconf libtool wget python-is-python3 libssl-dev git cmake perl && \
apt-get install -y libssl-dev libcurl4-openssl-dev protobuf-compiler libprotobuf-dev debhelper cmake reprepro unzip pkgconf libboost-dev libboost-system-dev libboost-thread-dev lsb-release libsystemd0 && \
git clone -b sgx_2.19 https://github.com/intel/linux-sgx.git ; \
cd linux-sgx && make preparation && \
cp external/toolset/ubuntu20.04/* /usr/local/bin && \
make sdk_install_pkg && \
cd /SGX && \
(echo yes | ./linux/installer/bin/sgx_linux_x64_sdk_2.19.100.3.bin) && \
source sgxsdk/environment && \
export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:$LD_LIBRARY_PATH && \
export LIBRARY_PATH=/usr/local/cuda/lib64/:$LIBRARY_PATH && \
make SGX_MODE=SIM && \
exec bash"
首先,podman安装在我的另一篇文章里写到了,这里不赘述。
其次,podman根本run不成功,因此我把上述代码改成了
docker run -it --rm -v ./:/SGX -w /SGX --security-opt label=disable docker.io/nvidia/cuda:11.8.0-devel-ubuntu20.04 /bin/bash
仍然显示timeout
解决办法:去到hub.docker.com/r/nvidia/cuda这个网站,搜索我的cuda版本11.4,按照网站里给的命令
docker pull nvidia/cuda:11.4.3-devel-ubuntu20.04
先拉取镜像。
在拉取过程中,时而会卡,我切换了网络,多试几次就好了。
完成之后可以输入docker image,看到确实已经存在了nvidia/cuda。
此时重复run的这行代码,但是请注意需要改为
docker run -it --rm -v ./:/SGX -w /SGX --security-opt label=disable docker.io/nvidia/cuda:11.4.3-devel-ubuntu20.04 /bin/bash
立刻就进入容器了。
我个人认为没必要一行运行这么多命令,所以我分步进行下述操作。
我没有提到的命令行都是没有问题的。
git clone -b sgx_2.19 https://github.com/intel/linux-sgx.git
上述这行需要删除掉“-b sgx_2.19”
(echo yes | ./linux/installer/bin/sgx_linux_x64_sdk_2.19.100.3.bin)
上述这行显示没有这个文件。
我需要先
cd /SGX/linux-sgx/linux/installer/bin/
再
(echo yes | ./sgx_linux_x64_sdk_2.19.100.3.bin)
成功之后会显示
The SDK package can be found in /SGX/linux-sgx/linux/installer/bin/sgxsdk
make SGX_MODE=SIM && \
上述这行显示没有这个文件。
我需要先
cd /SGX/linux-sgx/SampleCode/SampleEnclave
再继续上述make操作即可。
运行./app就显示SGX内的样例代码已经成功运行起来。
第一部分结束。