Skip to content

flutter-pi AOT support #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
limbouser opened this issue Jun 29, 2020 · 27 comments · Fixed by #70
Closed

flutter-pi AOT support #65

limbouser opened this issue Jun 29, 2020 · 27 comments · Fixed by #70
Labels
enhancement New feature or request

Comments

@limbouser
Copy link

Can flutter-pi be modified to include AOT support?

 

@ardera
Copy link
Owner

ardera commented Jun 29, 2020

Can flutter-pi be modified to include AOT support?

Yep, that's a good idea.

Unfortunately, the wiki page you linked is outdated, dart AOT snapshots no longer work that way. However, the API flutter provides to embedders doesn't support the new way AOT snapshots work either. So right now it's impossible / very hard to get AOT to work, until the features from this issue become available in flutter stable.

@ardera ardera added the enhancement New feature or request label Jun 29, 2020
@stonezju
Copy link

stonezju commented Jul 15, 2020

Thanks to @ardera .
I tried following things and can work in AOT mode on my Amlogic ARM device.

1. choose one flutter version, for example I used 1.17.2

2. download the engine source code according to the flutter version.

cat flutter/bin/internal/engine.version
f5a5031e9487d8b1c83050a37ffb1914cc5ecf33
cd flutter-engine/src/flutter && git reset cat ${FLUTTER_ROOT}/bin/internal/engine.version && git stash && gclient sync --with_branch_heads --with_tags

If the engine mismatch with the flutter tool, it will encounter the following error.

Unhandled exception:
Unexpected Kernel version x (expected xx).

3. build the engine source for my target device.

4. following the hard way steps

Take the myapp as example,

cd flutter-engine/engine/src
third_party/dart/tools/sdks/dart-sdk/bin/dart
third_party/dart/tools/sdks/dart-sdk/bin/snapshots/frontend_server.dart.snapshot
--sdk-root out/linux_release_arm/flutter_patched_sdk/
--target=flutter --aot --tfa -Ddart.vm.product=true --packages myapp/.packages --output-dill build/kernel_snapshot.dill
package:myapp/main.dart

We get build/kernel_snapshot.dill now.

out/linux_release_arm/clang_x64/gen_snapshot --causal_async_stacks --deterministic --snapshot_kind=app-aot-elf --elf=myapp/build/aot/app.so --strip --sim_use_hardfp --no-use-integer-division build/kernel_snapshot.dill

We get app.so for our target device.

5. readelf -a app.so

I only paste the information we need as below.

Symbol table '.dynsym' contains 6 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00001000 4 FUNC GLOBAL DEFAULT 1 _kDartBSSData
2: 00002000 12856 FUNC GLOBAL DEFAULT 2 _kDartVmSnapshotInstructi
3: 00006000 0x226e98 FUNC GLOBAL DEFAULT 3 _kDartIsolateSnapshotInst
4: 0022d000 23656 FUNC GLOBAL DEFAULT 4 _kDartVmSnapshotData
5: 00233000 0x16c190 FUNC GLOBAL DEFAULT 5 _kDartIsolateSnapshotData

As @ardera told me by email:

That "app.so" contains (amongst others) two .text sections and two .rodata sections (which contain the stuff that was before contained in 4 files) and also 4 symbols "_kDartVmSnapshotInstructions", "_kDartIsolateSnapshotInstructions", "_kDartVmSnapshotData", "_kDartIsolateSnapshotData" which point to the sections.
To run flutter in AOT mode in current flutter stable, the address & size of each of the 4 sections need to be specified in FlutterProjectArgs. One approach would be to use dlopen to load the "app.so" into memory and use dlsym to resolve the address of each of the 4 sections, however, it's not possible to find out the size of each section that way, so this doesn't work.

For now I hard code the section sizes, which can be parsed by code like "readelf" does.
vm_snapshot_data_size is 0x5c68
vm_snapshot_instructions_size is 0x3238
isolate_snapshot_data_size is 0x16c190
isolate_snapshot_instructions_size is 0x226e98
And pass them to FlutterProjectArgs to initialize Flutter engine in your embedder code.

Then flutter project myapp works in AOT mode on my target device.

References

@ardera
Copy link
Owner

ardera commented Jul 15, 2020

Thanks @stonezju !

I haven't thought of just hardcoding the section sizes or letting the user specify them. That's a great idea actually.

@stonezju
Copy link

Thanks @stonezju !

I haven't thought of just hardcoding the section sizes or letting the user specify them. That's a great idea actually.

I haven't got too much time to parse the sizes by code, so just use hardcode hex numbers now.
I think this can be done as below.
https://stackoverflow.com/questions/18418839/how-can-i-get-the-offset-and-size-of-the-text-section-of-a-binary

@DisDis
Copy link
Contributor

DisDis commented Jul 29, 2020

@stonezju ,

  1. I build release engine ( https://github.com/jwinarske/flutter_embedded )
    now work only dev channel.
    cmake .. -DCHANNEL=dev -DENGINE_RUNTIME_MODE=release
  2. I build libapp.so
    build_aot.sh
#!/bin/bash
TARGET=linux_release_arm
FLUTTER_ENG=~/workspace/flutter/flutter_embedded/third_party/engine/src
APP_NAME=dslideshow_flutter
$FLUTTER_ENG/third_party/dart/tools/sdks/dart-sdk/bin/dart $FLUTTER_ENG/third_party/dart/tools/sdks/dart-sdk/bin/snapshots/frontend_server.dart.snapshot --sdk-root $FLUTTER_ENG/out/$TARGET/flutter_patched_sdk/ --target=flutter --aot --tfa -Ddart.vm.product=true --packages .packages --output-dill $FLUTTER_ENG/build/kernel_snapshot.dill package:$APP_NAME/main.dart
$FLUTTER_ENG/out/$TARGET/clang_x64/gen_snapshot --causal_async_stacks --deterministic --snapshot_kind=app-aot-elf --elf=./libapp.so --strip --sim_use_hardfp --no-use-integer-division $FLUTTER_ENG/build/kernel_snapshot.dill
readelf -a ./libapp.so
  1. But ldd ./libapp.so :(

not a dynamic executable

...
Now, i try to manual parse ELF section in libapp.so and load _kDartVmSnapshotInstructi, _kDartVmSnapshotData, _kDartIsolateSnapshotInst, _kDartIsolateSnapshotData in memory.

Do you have any problem with ldd and dlopen("libapp.so",RTLD_LAZY)?

@limbouser
Copy link
Author

The issue with ldd might be that the so built is a ARM library and you are trying ldd from Linux system. try file on your so and verify that it's an ARM library. Also try the below command to list the symbols in your binary.

nm -gD

@DisDis
Copy link
Contributor

DisDis commented Jul 29, 2020

The issue with ldd might be that the so built is a ARM library and you are trying ldd from Linux system. try file on your so and verify that it's an ARM library. Also try the below command to list the symbols in your binary.

nm -gD

Yes i ran ldd on RaPi4.
pi@raspberrypi:/out$ ldd ./libapp.so
not a dynamic executable
pi@raspberrypi:/out$ file ./libapp.so
./libapp.so: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[md5/uuid]=96ed5820ded2ccf31d7e32cdfa0a24c1, stripped

@DisDis
Copy link
Contributor

DisDis commented Jul 29, 2020

@limbouser
nm -gD ./libapp.so

00001000 B _kDartBSSData
00385000 R _kDartIsolateSnapshotData
0000c000 T _kDartIsolateSnapshotInstructions
00006000 R _kDartVmSnapshotData
00002000 T _kDartVmSnapshotInstructions

@ardera
Copy link
Owner

ardera commented Jul 29, 2020

why use ldd? app.so has no library dependencies, it's just a container for the binary blobs.

The issue with ldd might be that the so built is a ARM library and you are trying ldd from Linux system. try file on your so and verify that it's an ARM library. Also try the below command to list the symbols in your binary.

I'm not sure that's the case, format of the app.so is the same on all platforms. It's just the AOT code that is different

Now, i try to manual parse ELF section in libapp.so and load _kDartVmSnapshotInstructi, _kDartVmSnapshotData, _kDartIsolateSnapshotInst, _kDartIsolateSnapshotData in memory.

Why, when there's dlopen? The only thing you can't do with dlopen and dlsym is getting the section sizes, that you can do as described in the stackoverflow thread @stonezju posted.

@DisDis
Copy link
Contributor

DisDis commented Jul 29, 2020

@ardera because dlopen doesn't open libapp.so. It is same problem meta-flutter/flutter_embedded#36

@DisDis
Copy link
Contributor

DisDis commented Jul 29, 2020

I found solution:

#include <elf.h>
#include <sys/mman.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

void* _kDartIsolateSnapshotData = NULL;
void* _kDartIsolateSnapshotInstructions = NULL;
void* _kDartVmSnapshotData = NULL;
void* _kDartVmSnapshotInstructions = NULL;

long _kDartIsolateSnapshotDataSize = 0;
long _kDartIsolateSnapshotInstructionsSize = 0;
long _kDartVmSnapshotDataSize = 0;
long _kDartVmSnapshotInstructionsSize = 0;


int main(int argc, char ** argv) {  
  int fd = open("./libapp.so", O_RDONLY);
  if (!fd) {
    printf("Error\n");
    return -1;
  }
  struct stat statbuf;
  fstat(fd, & statbuf);
  char * fbase = mmap(NULL, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
  close(fd);

  Elf32_Ehdr * ehdr = (Elf32_Ehdr * ) fbase;
  Elf32_Shdr * sects = (Elf32_Shdr * )(fbase + ehdr -> e_shoff);
  int shsize = ehdr -> e_shentsize;
  int shnum = ehdr -> e_shnum;
  int shstrndx = ehdr -> e_shstrndx;

  Elf32_Shdr * shstrsect = & sects[shstrndx];
  char * shstrtab = fbase + shstrsect -> sh_offset;

  int i, ii;
  Elf32_Shdr dynamic_str;
  Elf32_Shdr dynamic_sym;
  for (i = 0; i < shnum; i++) {
    if (!strcmp(shstrtab + sects[i].sh_name, ".dynstr")) {
      dynamic_str = sects[i];
//      printf("I found '.dynstr' %i \n", sects[i].sh_size);
    }else
    if (!strcmp(shstrtab + sects[i].sh_name, ".dynsym")) {
      dynamic_sym = sects[i];
      unsigned long number = dynamic_sym.sh_size / dynamic_sym.sh_entsize;
//      printf("I found '.dynsym' %li \n", number);
    }
  }

  char * d_strs = (char * )(fbase + dynamic_str.sh_offset);
  Elf32_Sym * d_syms = (Elf32_Sym * )(fbase + dynamic_sym.sh_offset);
  unsigned long number = dynamic_sym.sh_size / dynamic_sym.sh_entsize;
//void* _kDartIsolateSnapshotData = NULL;
//void* _kDartIsolateSnapshotInstructions = NULL;
//void* _kDartVmSnapshotData = NULL;
//void* _kDartVmSnapshotInstructions = NULL;
  for (ii = 0; ii < number; ii++) {
    printf("Symbol value:%i, size:%i name:%s\n", d_syms[ii].st_value, d_syms[ii].st_size, d_strs + d_syms[ii].st_name);
    if (!strcmp(d_strs + d_syms[ii].st_name, "_kDartIsolateSnapshotData")) {
      _kDartIsolateSnapshotData = malloc(d_syms[ii].st_size);
      _kDartIsolateSnapshotDataSize = d_syms[ii].st_size;
      memcpy(_kDartIsolateSnapshotData, fbase + d_syms[ii].st_value, d_syms[ii].st_size);
    } 
    else if (!strcmp(d_strs + d_syms[ii].st_name, "_kDartIsolateSnapshotInstructions")) {
      _kDartIsolateSnapshotInstructions = malloc(d_syms[ii].st_size);
      _kDartIsolateSnapshotInstructionsSize = d_syms[ii].st_size;
      memcpy(_kDartIsolateSnapshotInstructions, fbase + d_syms[ii].st_value, d_syms[ii].st_size);
    } 
    else if (!strcmp(d_strs + d_syms[ii].st_name, "_kDartVmSnapshotData")) {
      _kDartVmSnapshotData = malloc(d_syms[ii].st_size);
      _kDartVmSnapshotDataSize = d_syms[ii].st_size;
      memcpy(_kDartVmSnapshotData, fbase + d_syms[ii].st_value, d_syms[ii].st_size);
    } 
    else if (!strcmp(d_strs + d_syms[ii].st_name, "_kDartVmSnapshotInstructions")) {
      _kDartVmSnapshotInstructions = malloc(d_syms[ii].st_size);
      _kDartVmSnapshotInstructionsSize = d_syms[ii].st_size;
      memcpy(_kDartVmSnapshotInstructions, fbase + d_syms[ii].st_value, d_syms[ii].st_size);
    }
  }
  
  munmap(fbase,statbuf.st_size);
}

Output:

Symbol value:0, size:0 name:
Symbol value:4096, size:12 name:_kDartBSSData
Symbol value:8192, size:14064 name:_kDartVmSnapshotInstructions
Symbol value:24576, size:24216 name:_kDartVmSnapshotData
Symbol value:49152, size:3640112 name:_kDartIsolateSnapshotInstructions
Symbol value:3690496, size:2596816 name:_kDartIsolateSnapshotData

@ardera
Copy link
Owner

ardera commented Jul 29, 2020

The reason one would use dlopen and dlsym is because it maps all the sections into memory with the correct privileges. (apart from being secure and battle-tested) Your DIY ELF parser will probably fail to work in practice because the sections don't have the right permissions.

The engineers behind the flutter engine themselves suggested to use dlopen & dlsym to load the app.so. It's probably better to fix the underlying issue. dlopen with app.so should definitely work.

@DisDis
Copy link
Contributor

DisDis commented Jul 29, 2020

@ardera Yes, it is not run

[ERROR:flutter/shell/platform/embedder/embedder_surface_gl.cc(108)] Could not create a resource context for async texture uploads. Expect degraded performance. Set a valid make_resource_current callback on FlutterOpenGLRendererConfig.
[ERROR:flutter/runtime/dart_isolate.cc(104)] CreateDartIsolateGroup failed: Snapshot is misaligned
[FATAL:flutter/runtime/runtime_controller.cc(68)] Check failed: strong_root_isolate. Could not create root isolate.
Aborted

I don't understand why dlopen doesn't work. (clang 8.0?)

@ardera
Copy link
Owner

ardera commented Jul 29, 2020

@DisDis Can you try running LD_DEBUG=all ldd libapp.so and paste the output of that here?

@DisDis
Copy link
Contributor

DisDis commented Jul 29, 2020

@DisDis
Copy link
Contributor

DisDis commented Jul 29, 2020

strace /lib/ld-linux-armhf.so.3 --verify ./libapp.so

execve("/lib/ld-linux-armhf.so.3", ["/lib/ld-linux-armhf.so.3", "--verify", "./libapp.so"], 0xbeaf9678 /* 23 vars */) = 0
brk(NULL)                               = 0x836000
openat(AT_FDCWD, "./libapp.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\0\0\0\0004\0\0\0"..., 512) = 512
_llseek(3, 6291584, [6291584], SEEK_SET) = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 480) = 480
close(3)                                = 0
exit_group(1)                           = ?
+++ exited with 1 +++

@DisDis
Copy link
Contributor

DisDis commented Jul 30, 2020

readelf -S ./libapp.so

There are 12 section headers, starting at offset 0x600080:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .bss              PROGBITS        00001000 001000 00000c 00  WA  0   0  4
  [ 2] .text             PROGBITS        00002000 002000 0036f0 00  AX  0   0 4096
  [ 3] .rodata           PROGBITS        00006000 006000 005e98 00   A  0   0 16
  [ 4] .text             PROGBITS        0000c000 00c000 378b30 00  AX  0   0 4096
  [ 5] .rodata           PROGBITS        00385000 385000 279fd0 00   A  0   0 16
  [ 6] .note.gnu.build-i NOTE            005fefd0 5fefd0 000020 00   A  0   0  4
  [ 7] .dynstr           STRTAB          005feff0 5feff0 00007d 00   A  0   0  1
  [ 8] .dynsym           DYNSYM          005ff070 5ff070 000060 10   A  7   1  4
  [ 9] .hash             HASH            005ff0d0 5ff0d0 000038 04   A  8   0  4
  [10] .dynamic          DYNAMIC         00600000 600000 000030 08  WA  7   0  4
  [11] .shstrtab         STRTAB          00000000 600030 000050 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  y (purecode), p (processor specific)

section (.ARM.attributes [ARM_ATTRIBUTES] )is missing

@DisDis
Copy link
Contributor

DisDis commented Jul 30, 2020

readelf -A ./libapp.so
<empty>

For example:
flutter-engine-dev-release $ readelf -A ./libflutter_engine.so

Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "6"
  Tag_CPU_arch: v6
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv2
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_HardFP_use: Deprecated
  Tag_ABI_VFP_args: VFP registers

@DisDis
Copy link
Contributor

DisDis commented Jul 30, 2020

Ok finally, i copy section '.ARM.attributes' from ./libflutter_engine.so to libapp.so

Change '.ARM.attributes' type to 0x70000003 (ARM_ATTRIBUTES)

@ardera
I run flutter-pi on AOT, but how can i validate it?
I use libflutter_engine.so in release mode.
flutter-pi output:

<CUT>
[elm327plugin] running pid query queue processor
Symbol value:0, size:0 name:
Symbol value:4096, size:12 name:_kDartBSSData
Symbol value:8192, size:14064 name:_kDartVmSnapshotInstructions
Symbol value:24576, size:24216 name:_kDartVmSnapshotData
Symbol value:49152, size:3640112 name:_kDartIsolateSnapshotInstructions
Symbol value:3690496, size:2596816 name:_kDartIsolateSnapshotData
[ERROR:flutter/shell/platform/embedder/embedder_surface_gl.cc(108)] Could not create a resource context for async texture uploads. Expect degraded performance. Set a valid make_resource_current callback on FlutterOpenGLRendererConfig.
[ERROR:flutter/shell/platform/embedder/embedder_surface_gl.cc(108)] Could not create a resource context for async texture uploads. Expect degraded performance. Set a valid make_resource_current callback on FlutterOpenGLRendererConfig.
flutter engine successfully started up.
Initializing Input devices...
Warning: No evdev input devices configured.
Running IO thread...
Running message loop...
flutter: 2020-07-30 22:09:23.662200 [flutter] INFO:main: Run, isLinuxEmbedded: true
<CUT>
<Normal work....>

Instruction:

#Step 1. Create dump arm_attr
objcopy ./libflutter_engine.so /dev/null --dump-section .ARM.attributes=arm_attr
# readelf -S ./libflutter_engine.so
#Section Headers:
# [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
# [27] .ARM.attributes   ARM_ATTRIBUTES  00000000 8245dc 000023 00      0   0  1
#Key to Flags:
#  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
#  L (link order), O (extra OS processing required), G (group), T (TLS),
#  C (compressed), x (unknown), o (OS specific), E (exclude),
#  y (purecode), p (processor specific)

#
# size: ls -l
# -rw-r--r-- 1 pi pi       35 Jul 30 20:58 arm_attr
#
# objdump -s -jobjdump -s -j .ARM.attributes ./libflutter_engine.so
# Contents of section .ARM.attributes:
# 0000 41220000 00616561 62690001 18000000  A"...aeabi......
# 0010 05360006 06080109 010a0218 0119011b  .6..............
# 0020 031c01     

#Step 2 add section
objcopy --add-section .ARM.attributes=arm_attr libapp.so libapp_new.so
# readelf -S ./libapp_new.so
# [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
# [11] .ARM.attributes   PROGBITS        00000000 600030 000023 00      0   0  1

#Step 3
# Manual change type 'PROGBITS' to 'ARM_ATTRIBUTES'(0x01 -> 0x70000003) 
# Off= 600030 
# Find '30 00 60' in HexEdit and move left to 11 byte and replace '01' to '03 00 00 70'

#Result:
#ldd ./libapp_new.so 
#	statically linked

@DisDis
Copy link
Contributor

DisDis commented Jul 30, 2020

Yes it is AOT, i run old flutter-pi w/o AOT config and i got output:

[flutter_spidev] Done.
[ERROR:flutter/runtime/dart_vm_data.cc(18)] VM snapshot invalid and could not be inferred from settings.
[ERROR:flutter/runtime/dart_vm.cc(247)] Could not setup VM data to bootstrap the VM from.
[ERROR:flutter/runtime/dart_vm_lifecycle.cc(84)] Could not create Dart VM instance.
[FATAL:flutter/shell/common/shell.cc(264)] Check failed: vm. Must be able to initialize the VM.
Aborted

I'm preparing MR

@DisDis
Copy link
Contributor

DisDis commented Jul 30, 2020

@ardera #68

@DisDis DisDis mentioned this issue Aug 3, 2020
@ardera
Copy link
Owner

ardera commented Aug 5, 2020

I also just noticed these comments in the flutter_embedder.h. So actually, we don't need to bother with the section sizes at all. dlopen and dlsym is enough to do the job.

Also, you can also compile a dart kernel snapshot to assembly using gen_snapshot --app-aot-assembly ... and then compile that assembly into a shared library with an ARM-targeted toolchain. That way you have the .ARM.attributes section without a "zombie" ELF file.

@ardera
Copy link
Owner

ardera commented Aug 5, 2020

@DisDis can you try if AOT works for you with the newest version of flutter-pi? I'm getting a SIGBUS somehow (an alignment exception to be precise) but I don't know if that's caused by flutter-pi, the engine, or the AOT snapshot

@DisDis
Copy link
Contributor

DisDis commented Aug 5, 2020

@ardera
i have bug:

Package libsystemd was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsystemd' found
Package libinput was not found in the pkg-config search path.
Perhaps you should add the directory containing `libinput.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libinput' found
Package libudev was not found in the pkg-config search path.
Perhaps you should add the directory containing `libudev.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libudev' found
cc -c -I./include  -DBUILD_TEXT_INPUT_PLUGIN -DBUILD_GPIOD_PLUGIN -DBUILD_SPIDEV_PLUGIN -DBUILD_TEST_PLUGIN -DBUILD_OMXPLAYER_VIDEO_PLAYER_PLUGIN -O0 -ggdb  src/flutter-pi.c -o out/obj/flutter-pi.o
In file included from src/flutter-pi.c:30:
/usr/include/xf86drm.h:40:10: fatal error: drm.h: No such file or directory
 #include <drm.h>
          ^~~~~~~
compilation terminated.
make: *** [Makefile:43: out/obj/flutter-pi.o] Error 1

whereis libdrm
libdrm: /usr/lib/arm-linux-gnueabihf/libdrm.so /usr/include/libdrm /usr/share/libdrm

UPDATE:
@ardera please add 'sudo apt-get install libsystemd-dev libinput-dev' to description

@DisDis
Copy link
Contributor

DisDis commented Aug 5, 2020

@ardera
WORK
Dart VM running

./run.sh: 2: ./run.sh: screenOn.sh: not found
[flutter-pi] WARNING: display didn't provide valid physical dimensions.
             The device-pixel ratio will default to 1.0, which may not be the fitting device-pixel ratio for your display.
===================================
display mode:
  resolution: 2560 x 1600
  refresh rate: 15Hz
  physical size: 0mm x 0mm
  flutter device pixel ratio: 1.000000
===================================
EGL information:
  version: 1.4
  vendor: "Mesa Project"
  client extensions: "EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_wayland EGL_EXT_platform_x11 EGL_MESA_platform_gbm EGL_MESA_platform_surfaceless EGL_EXT_platform_device"
  display extensions: "EGL_ANDROID_blob_cache EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_WL_bind_wayland_display "
===================================
OpenGL ES information:
  version: "OpenGL ES 3.1 Mesa 19.3.2"
  shading language version: "OpenGL ES GLSL ES 3.10"
  vendor: "Broadcom"
  renderer: "V3D 4.2"
  extensions: "GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_EXT_texture_sRGB_decode GL_OES_EGL_image GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_EXT_occlusion_query_boolean GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_texture_compression_astc_ldr GL_OES_depth_texture_cube_map GL_OES_required_internalformat GL_OES_surfaceless_context GL_EXT_color_buffer_float GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_base_instance GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_draw_elements_base_vertex GL_EXT_primitive_bounding_box GL_EXT_shader_io_blocks GL_EXT_texture_border_clamp GL_EXT_texture_norm16 GL_KHR_context_flush_control GL_NV_image_formats GL_OES_draw_elements_base_vertex GL_OES_primitive_bounding_box GL_OES_shader_io_blocks GL_OES_texture_border_clamp GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_EXT_buffer_storage GL_EXT_float_blend GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_OES_EGL_image_external_essl3 GL_OES_shader_image_atomic GL_MESA_shader_integer_functions GL_KHR_parallel_shader_compile GL_MESA_framebuffer_flip_y GL_EXT_texture_query_lod "
===================================
flutter: 2020-08-05 21:35:03.949321 [flutter] INFO:main: Run, isLinuxEmbedded: true
flutter: 2020-08-05 21:35:03.980868 [flutter] INFO:main: Config path: 'Directory: '/home/pi/workspace/dslideshow''
flutter: 2020-08-05 21:35:03.981198 [flutter] INFO:main: externalStorage: '/home/pi/workspace/dslideshow'
flutter: 2020-08-05 21:35:03.981709 [flutter] INFO:AppConfig: Config loaded
flutter: 2020-08-05 21:35:04.009948 [hw_frame] INFO:main: Run
flutter: 2020-08-05 21:35:04.036558 [hw_frame] INFO:AppConfig: Config loaded
flutter: 2020-08-05 21:35:04.037489 [web] INFO:main: Run
flutter: 2020-08-05 21:35:04.044203 [web] INFO:AppConfig: Config loaded
flutter: 2020-08-05 21:35:04.083641 [hw_frame] INFO:GPIOFlutterService: initing...
flutter: 2020-08-05 21:35:04.086630 [hw_frame] SEVERE:GPIOFlutterService: initialization error:  NoSuchMethodError: The getter 'address' was called on null.
Receiver: null
Tried calling: address
flutter: 2020-08-05 21:35:04.086765 [hw_frame] INFO:GPIOFlutterService: GPIO Status:
[flutter-pi] Error handling platform message. plugin_registry_on_platform_message: Invalid argument
flutter: 2020-08-05 21:35:04.151556 [hw_frame] INFO:DiskStorage: File cache has 2086 file(s)
flutter: 2020-08-05 21:35:04.400358 [hw_frame] INFO:HardwareService: Command: [0]0:get_system_info_command duration: 199ms

@ardera
Copy link
Owner

ardera commented Aug 6, 2020

Thanks @DisDis

Then the issue was probably caused by way to workaround the .ARM.attributes issue. Luckily 1.20 was released yesterday, so my workaround probably isn't needed anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants