gramineproject / gramine

A library OS for Linux multi-process applications, with Intel SGX support
GNU Lesser General Public License v3.0
595 stars 197 forks source link

SGX driver device error while running pytorch example. #2048

Closed mayank64ce closed 10 hours ago

mayank64ce commented 19 hours ago

Description of the problem

I am trying to run the pytorch ppml example, but when I try to run the example with SGX Enclave , I get SGX driver device error.

Steps to reproduce

Follow steps from PyTorch PPML Tutorial.

Expected results

Generation of result.txt with correct prediction.

Actual results

Gramine is starting. Parsing TOML manifest file, this may take some time...
error: Cannot open SGX driver device. Please make sure you're using an up-to-date kernel or the standalone Intel SGX kernel module is loaded.
error: load_enclave() failed with error: No such file or directory (ENOENT)

Gramine commit hash

Gramine on Ubuntu 23 with jammy

monavij commented 18 hours ago

What kernel version are you using? Also what hardware are you running this on?

mayank64ce commented 17 hours ago

My kernel version is 6.5.0-44-generic on Ubuntu 23.

I was unable to find a package for mantic so I installed jammy instead.

Result of neofetch:

            .-/+oossssoo+/-.               mayank@lab3 
        `:+ssssssssssssssssss+:`           ----------- 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 23.10 x86_64 
    .ossssssssssssssssssdMMMNysssso.       Host: MS-7D25 1.0 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 6.5.0-44-generic 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 16 days, 3 hours, 6 mins 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 2097 (dpkg), 19 (snap) 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: bash 5.2.15 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Resolution: 1920x1080 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   Terminal: /dev/pts/6 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   CPU: 12th Gen Intel i5-12600K (16) @ 4.900GHz 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   GPU: NVIDIA GeForce RTX 3090 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   GPU: Intel AlderLake-S GT1 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Memory: 11596MiB / 64068MiB 
  +sssssssssdmydMMMMMMMMddddyssssssss+
   /ssssssssssshdmNNNNmyNMMMMhssssss/                              
    .ossssssssssssssssssdMMMNysssso.                               
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.

Result of lscpu:

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         46 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  16
  On-line CPU(s) list:   0-15
Vendor ID:               GenuineIntel
  Model name:            12th Gen Intel(R) Core(TM) i5-12600K
    CPU family:          6
    Model:               151
    Thread(s) per core:  2
    Core(s) per socket:  10
    Socket(s):           1
    Stepping:            2
    CPU(s) scaling MHz:  30%
    CPU max MHz:         4900.0000
    CPU min MHz:         800.0000
    BogoMIPS:            7372.80
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss
                          ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonsto
                         p_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16
                          xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowpr
                         efetch cpuid_fault ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_ad
                         just bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1
                          xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req 
                         hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pcon
                         fig arch_lbr ibt flush_l1d arch_capabilities
Virtualization features: 
  Virtualization:        VT-x
Caches (sum of all):     
  L1d:                   416 KiB (10 instances)
  L1i:                   448 KiB (10 instances)
  L2:                    9.5 MiB (7 instances)
  L3:                    20 MiB (1 instance)
NUMA:                    
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-15
Vulnerabilities:         
  Gather data sampling:  Not affected
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Not affected
  Spec rstack overflow:  Not affected
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
  Srbds:                 Not affected
  Tsx async abort:       Not affected
kailun-qin commented 10 hours ago

@mayank64ce: Thanks for the info! 12th Gen Intel(R) Core(TM) i5-12600K does not support SGX (as implied by the output of lscpu CPU flags, also see the product spec).

mayank64ce commented 10 hours ago

thanks @kailun-qin .. I understand. Closing the issue now.