Intel® Software Guard Extensions (Intel® SGX)
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

SGX test application missing sgx_urts.dll

EgremyB
Novice
2,015 Views
 

First, here is my setup :

  1. My CPU is the Intel(R) Core(TM) i7-6700 CPU which is SGX capable.
  2. As I have an Asus Z170 Pro Gaming motherboard bought in 2015, I needed to update the bios to show the SGX option. So I did and I choose the "Software Controlled" option because the bios don't give the "Enable" option.
  3. Then I followed this Intel guide to install the SGX SDK and PSW.
  4. Windows Update did not install the SGX requirements (I forced several update checks). I checked the device manager which did not show any SGX related driver.
  5. I installed the Intel Management Engine for Windows 10 64bits.
  6. I Installed the SDK using the .exe installer I got from here: https://registrationcenter.intel.com/en/forms/?productid=2614
  7. I installed the PSW using the base .INF and then the SDK .INF I got from the same place I got the SDK.
  8. Then I created a new Enclave project in Visual Studio 2017. See attachments for EnclaveHello.cpp and EnclaveHello.edl (both in one text file because of uploads reasons).
  9. I added a C++ Console Application to the solution and imported the EnclaveHello.edl using the right-click menu. See attachments for AppHello.cpp.

At this point, I should mention that I do not have the choice of an Intel C++ compiler in the settings nor do I have the Intel Debugger option in the debugger field, only the Local Windows Debugger.

As my bios is configured in "Software controlled" for the SGX feature, I should call the "sgx_enable_device()" function but it is not recognized by Visual Studio.

By running the above solution (the entry point is the AppHello main()), it crashes. Here is the debug output :

'AppHello.exe' (Win32): Loaded 'E:\XXXXX\XXXX\XXXX\Dev\EnclaveHello\Debug\AppHello.exe'. Symbols loaded.
'AppHello.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'AppHello.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'AppHello.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
The thread 0x4300 has exited with code -1073741515 (0xc0000135).
The thread 0x3e90 has exited with code -1073741515 (0xc0000135).
The program '[9704] AppHello.exe' has exited with code -1073741515 (0xc0000135) 'A dependent dll was not found'.

A pop-up tells me that the missing DLL is the "sgx_urts.dll".

What did I do wrong? Any ideas?

If some information is missing, I'll be glad to edit this post and provide it.

Thank you for your time!

Labels (5)
0 Kudos
1 Solution
JesusG_Intel
Moderator
1,883 Views

Hello EgremyB,


We may have found a solution. You will use a small utility to enable SGX in the BIOS then Windows Update will automatically install the SGX PSW.


  1. Download and install the Intel® Software Guard Extensions Activation App from the Microsoft Store
  2. Run the app to enable SGX in the BIOS
  3. Reboot
  4. Check that SGX is Enabled in BIOS
  5. When the OS boots, run Windows Update to install the SGX PSW
  6. Run your apps


Sincerely,

Jesus G.

Intel Customer Support


View solution in original post

10 Replies
JesusG_Intel
Moderator
1,961 Views

Hello EgremyB,


Refer to section "Setting up an Intel Software Guard Extensions Project" in the Intel SGX Developer Reference Guide for Windows, which is included in the documents directory of the folder where you expanded the SGX SDK.exe installer.


You can also use the SampleEnclave project, provided in the SGX SDK under C:\Program Files (x86)\Intel\IntelSGXSDK\src\SampleEnclave, as a base that you can modify or copy the settings from.


Sincerely,

Jesus G.

Intel Customer Support


EgremyB
Novice
1,938 Views

Hi,

Thank you for your fast reply!

I tried to use the SampleEnclave solution. I used VS2019, installed the Spectre Mitigations Tools as requested by the IDE then built the solution.

I still get the "missing sgx_urts.dll" message when running the SampleEnclave (unmodified) code.

JesusG_Intel
Moderator
1,940 Views

Hello EgremyB,


It seems that the SGX PSW was not installed correctly. You may have done the steps below already but I am adding them here for completeness.

 

Ensure that the SGX PSW installed successfully by finding sgx_urts.dll under C:\Windows\System32

 

If it is not already installed, follow the steps below to proceed with offline installation:

 

  1. Download the Intel® Software Guard Extensions Platform Software for Windows* (You will find it in your Products list in Intel Registration Center.)
  2. Double-click on Intel SGX PSW for Windows v2.12.100.4.exe
  3. Extract the files to your desired directory.
  4. Go to \Intel SGX PSW for Windows v2.12.100.4\PSW_INF_RS3_and_above
  5. Open Powershell as Administrator and run: pnputil /add-driver sgx_psw.inf /install
  6. Look for the successful installation message.
  7. Check that sgx_urts.dll is under C:\Windows\System32


When Intel® SGX is enabled and the Intel® SGX PSW is installed, Device Manager will include Intel® Software Guard Extensions in both the System Devices and in Software Components.


If all of the above are successful then try running your application again.


Sincerely,

Jesus G.

Intel Customer Support


EgremyB
Novice
1,927 Views

Yes, I did already do these steps. Still, I gave it another try.

First, the sgx_urts.dll is not present under C:\Windows\System32\.

The download link you gave doesn't allow me to download anything so I downloaded the following archive which seems to contain the same content: Is it the right one ? 

I used the command you gave me in the PSW_INF folder which is the equivalent to "PSW_INF_RS3_and_above" and I got a positive installation message.

Still, the DLL isn't in C:\Windows\System32\. The only one I can find is here : C:\Windows\System32\DriverStore\FileRepository\sgx_psw.inf_amd64_6add72377f42c7c6

By rebuilding and running the SampleEnclave, the DLL is still missing.

JesusG_Intel
Moderator
1,924 Views

Hello EgremyB,

 

You can find the Intel PSW v2.12.100.4 by selecting the Intel PSW under this link, https://registrationcenter.intel.com/en/forms/?productid=2614, as shown in the attached screenshot.

 

The PSW in Download Center is very outdated.

 

One other thing to check is that your operating system is installed in UEFI mode. Refer to this article for instructions on ensuring your OS is installed in UEFI mode.

 

Sincerely,

Jesus G.

Intel Customer Support

 

EgremyB
Novice
1,907 Views

I used the correct PSW and checked that I'm in UEFI mode but it did not resolve my issue. The sgx_urts.dll is not present in System32 and not found at the execution of the SampleEnclave.

EgremyB
Novice
1,897 Views

I tried placing the missing sgx_urts.dll in the C:\Windows\System32 folder manually but it did not resolve the issue.

JesusG_Intel
Moderator
1,884 Views

Hello EgremyB,


We may have found a solution. You will use a small utility to enable SGX in the BIOS then Windows Update will automatically install the SGX PSW.


  1. Download and install the Intel® Software Guard Extensions Activation App from the Microsoft Store
  2. Run the app to enable SGX in the BIOS
  3. Reboot
  4. Check that SGX is Enabled in BIOS
  5. When the OS boots, run Windows Update to install the SGX PSW
  6. Run your apps


Sincerely,

Jesus G.

Intel Customer Support


EgremyB
Novice
1,882 Views

MASSIVE THANK YOU, it solved the problem. I am now able to launch the SampleEnclave successfully!

JesusG_Intel
Moderator
1,859 Views

I'm glad everything is working, EgremyB.


This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.


Reply