Only the legacy out-of-tree (OOT) Intel® SGX Linux* driver supports (Intel® SGX) SGX2.
Execute these commands to check which Intel® SGX driver is installed:
ls /dev/*sgx* #Should return /dev/isgx
lsmod | grep -i sgx #Should return: isgx
If the return values are not as above then the OOT driver is not installed and you probably have the Data Center Attestation Primitives (DCAP). Uninstall the DCAP driver before installing the OOT driver.
If the uninstall.sh script is missing, uninstall as follows:
sudo service aesmd stop
sudo rm -f $(find /lib/modules -name intel_sgx.ko)
sudo /sbin/depmod
sudo sed -i '/^intel_sgx$/d' /etc/modules
sudo rm -f /etc/sysconfig/modules/intel_sgx.modules
sudo rm -f /etc/modules-load.d/intel_sgx.conf
chmod 777 sgx_linux_x64_driver_2.11.054c9c4c.bin
sudo ./sgx_linux_x64_driver_2.11.054c9c4c.bin