Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

Error when running code 'sgx_uae_service.dll' not found

Marella__Praneeth
1,338 Views

I am trying to run a simple code using the enclave and when I try to run it, I get this error: 'sgx_uae_service.dll' not found. I checked the Intel SGX Enclave directory and that specific file is there. I was wondering how to go about fixing this error.

I am running the code on Visual Studio Pro 15.

0 Kudos
12 Replies
Francisco_C_Intel
1,338 Views

It sounds like you have the SGX SDK installed, but not the runtime (SGX PSW). If the SGX PSW is installed that binary should be in the c:\windows\system32 dir.

Is your machine SGX-capable and SGX-enabled? What OS are you running?

Thanks,

Francisco

0 Kudos
Marella__Praneeth
1,338 Views

Yes my machine is SGX capable and it was a developer NUC machine that was bought directly from Intel. I am running Windows 10 Pro.

I am trying to install the latest PSW from Intel installer using admin rights, it gives me an error that it doesn't support enterprise windows even though I am running windows 10 pro...

0 Kudos
Francisco_C_Intel
1,338 Views

The installer mechanism varies based on the release/build number of Windows 10 (it changed in the Fall Creators Update aka Version 1709 aka RS3). Which one are you using?

There are more details here:

https://software.intel.com/en-us/download/intel-software-guard-extensions-intel-sgx-sdk-for-windows-os-installation

If you are running a recent version of Windows 10 you cannot install the PSW using the .exe installer. The PSW will be automatically installed (via Windows Update) when SGX is enabled in the BIOS. Is SGX enabled in the BIOS?

Thanks,
Francisco

0 Kudos
Marella__Praneeth
1,338 Views

It is enabled in the BIOS and I think I was able to fix it.

But now I have a new error when I try to debug using Local Windows Debugger: [sgx_create_enclave_exa_ c:\sgxwindows\src_release\trunk\psw\urts\win\urts.cpp:164] Couldn't open file with CreateFile()

I changed the debugger working directory to $(OutDir) and that didn't not fix it.

0 Kudos
Francisco_C_Intel
1,338 Views

Did you change the settings for the Local Windows Debugger or for the Intel(R) SGX Debugger?

The working dir settings are different for each debugger. I would double check that you changed the one for the Intel(R) SGX Debugger and that that is the debugger you are using when debugging your application.

Thanks,

Francisco

0 Kudos
Marella__Praneeth
1,338 Views

I made sure change that in the Intel SGX Debugger settings AND used the Intel Compiler and still get this error once the application builds and runs:

[sgx_create_enclave_exa_ c:\sgxwindows\src_release\trunk\psw\urts\win\urts.cpp:164] Couldn't open file with CreateFile()

Am I missing something obvious here?

0 Kudos
Francisco_C_Intel
1,338 Views

You stated that you changed the Intel SGX Debugger settings, but also indicated you "try to debug using Local Windows Debugger".

Can you double check that when it is time to debug, you are using "Intel SGX Debugger" and not the "Local Windows Debugger"?

And to double check, you can open a command-prompt to the $(OutDir) and run your app from the command-line (without a debugger) right?

0 Kudos
Marella__Praneeth
1,338 Views

I haven't tried to run it from the command line, I only used Visual Studio 2015 to run my project.

I did make sure it is using Intel SGX Debugger when I try to run it and its Working Dir is $(OutDir) on both App and Enclave properties.

0 Kudos
Marella__Praneeth
1,338 Views

I actually fixed it. My project builds and runs without any errors now. Thanks for helping me!

One of the things I am doing in my code is using the sgx_read_rand and I am calling it correctly. I included the header #include "sgx_trts.h" and I call it like this: 

if (SGX_SUCCESS != sgx_read_rand((unsigned char *)&val, 4))
        printf("\nApp: error, failed to generate a random number in enclave.\n");

Am I doing something wrong because I am getting unresolved external symbol and 1 unresolved externals error.

0 Kudos
bashar__golam
Beginner
1,338 Views

int a = 0;
    for (int i = 0; i<4; ++i){
            sgx_status_t status = sgx_read_rand((unsigned char *)&a, sizeof(a));
            printf("random:%d\n", a);
         }

I tried this  returning Error    LNK2019    unresolved external symbol _sgx_read_rand referenced in function _main. I added    #include<sgx_trts.h> but don't know how and where i add sgx_trts.lib. Do i need to define it in edl?

0 Kudos
Scott_R_Intel
Employee
1,338 Views

Hello Golam.

In Visual Studio, you should add sgx_trts.lib in your enclave project->Properties->Configuration Properties->Linker->Input->Additional Dependencies.

Regards.

Scott

0 Kudos
mike__neon
Beginner
1,338 Views

Francisco C. (Intel) wrote:

It sounds like you have the SGX SDK installed, but not the runtime (SGX PSW). If the SGX PSW is installed that binary should be in the c:\windows\system32 dir.

Is your machine SGX-capable and SGX-enabled? What OS are you running?

Thanks,

Francisco

I have some error information however my computer does not   support PSW,I have been used sdk and visual studio 2017  to get it . can I run  it without  PSW on  my computer?  

0 Kudos
Reply