-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Description
Environment information:
- AGI version: 3.3.3
- Host OS: Linux Ubuntu 20.04
If tracing on Android: - Device model: /
- Android Version: /
Bug description
AGI does not start on Ubuntu 20.04 with
- gcc 9.4.0
- GLIBC 2.31
Reproduction steps
Start AGI on an system with GCC 9 + GLIBC 2.31. It works perfectly fine on newer Ubuntu systems
Stacktrace
I20250509-204106821[server.ChildProcess-gapis][server.ChildProcess.runProcess] Starting gapis as [/home/user123/Downloads/agi-3.3.3-linux(1)/agi/gapis, -enable-local-files, -log-file, /tmp/gapis.log, -log-level, Info, -gapir-args, --log /tmp/gapir.log --log-level I, --strings, /home/user123/Downloads/agi-3.3.3-linux(1)/agi/strings, --gapis-auth-token, zo4kPGr9, --idle-timeout, 60000ms, --adb, /home/user123/Android/Sdk/platform-tools/adb]
W20250509-204106829[server.ChildProcess$LoggingStringHandler][server.ChildProcess$LoggingStringHandler.lambda$new$0] gapis: /home/user123/Downloads/agi-3.3.3-linux(1)/agi/gapis: /lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.13' not found (required by /home/user123/Downloads/agi-3.3.3-linux(1)/agi/gapis)
W20250509-204106830[server.ChildProcess$LoggingStringHandler][server.ChildProcess$LoggingStringHandler.lambda$new$0] gapis: /home/user123/Downloads/agi-3.3.3-linux(1)/agi/gapis: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/user123/Downloads/agi-3.3.3-linux(1)/agi/gapis)
W20250509-204106830[server.ChildProcess$LoggingStringHandler][server.ChildProcess$LoggingStringHandler.lambda$new$0] gapis: /home/user123/Downloads/agi-3.3.3-linux(1)/agi/gapis: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.32' not found (required by /home/user123/Downloads/agi-3.3.3-linux(1)/agi/gapis)
W20250509-204106830[server.ChildProcess$LoggingStringHandler][server.ChildProcess$LoggingStringHandler.lambda$new$0] gapis: /home/user123/Downloads/agi-3.3.3-linux(1)/agi/gapis: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/user123/Downloads/agi-3.3.3-linux(1)/agi/gapis)
Screenshots
/
Resolution
Statically build gapis with clang (libc++ / musl) in order to remove gcc/glibc dependencies if possible. This will allow running AGI on "older" devices. Alternatively using 3.3.0 works as expected even on older Linux devices.
Workaround
flake.nix
{
description = ''
Nix flake for Android GPU Inspector (AGI) -- v3.3.3
This flake patches the AGI v3.3.3 for Linux OS's with old GLIBC / GCC configurations, because AGI is compiled against a modern GCC / GLIBC.
Use `nix develop` to start the shell, which downloads AGI and ANGLE APK
Commands in the shell:
+ `adb` -- Android default tooling to connect to a device
+ `install` -- installs the ANGLE APK on a connected device (adb connect required & remount)
+ `agi` -- start the application
'';
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.11";
};
outputs = { self, nixpkgs }:
let
angle_apk_name = "angle-arm_64.apk";
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
packages.${system} = {
default = pkgs.mkShell.override {
stdenv = pkgs.stdenvNoCC;
} {
name = "agi-shell-env";
buildInputs = [
pkgs.glibc
pkgs.gcc13
# IMPORTANT TO USE THE JRE, or it will fail with an Unsatisfied
# SWT OS.java Error: Failed to load swt-pi3, loading swt-pi4 as fallback.
# Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
# no swt-pi4-gtk-4952r11 in java.library.path: [/home/user123/.swt/lib/linux/x86_64/]
# no swt-pi4-gtk in java.library.path: [/home/user123/.swt/lib/linux/x86_64/]
# no swt-pi4 in java.library.path: [/home/user123/.swt/lib/linux/x86_64/]
# Can't load library: /home/user123/Downloads/agi-3.3.3-linux/agi/?/.swt/lib/linux/x86_64/libswt-pi4-gtk-4952r11.so
# Can't load library: /home/user123/Downloads/agi-3.3.3-linux/agi/?/.swt/lib/linux/x86_64/libswt-pi4-gtk.so
# Can't load library: /home/user123/Downloads/agi-3.3.3-linux/agi/?/.swt/lib/linux/x86_64/libswt-pi4.so
pkgs.temurin-jre-bin-11
pkgs.gtk3
pkgs.android-tools
];
# Environment setup
shellHook = ''
# Set environment variables
export AGI_DIR=${self.packages.${system}.agi-bootstrap}/agi
export LD_LIBRARY_PATH="${pkgs.glibc}/lib:${pkgs.gtk3}/lib:/home/user123/.swt/lib/linux/x86_64/"
export PATH="${pkgs.glibc}/bin:$PATH"
export AGI_ANGLE_APK=${self.packages.${system}.angle-bootstrap}/${angle_apk_name}
export ADB_X=${pkgs.android-tools}/bin/adb
alias adb="LD_LIBRARY_PATH=${pkgs.gcc.cc.lib}/lib:${pkgs.glibc}/lib:${pkgs.gtk3}/lib ${pkgs.glibc}/lib/ld-linux-x86-64.so.2 --library-path ${pkgs.glibc}/lib $ADB_X"
alias agi="JAVA_HOME=${pkgs.temurin-jre-bin-11} PATH=${pkgs.temurin-jre-bin-11}/bin:$PATH LD_LIBRARY_PATH=${pkgs.gcc.cc.lib}/lib:${pkgs.glibc}/lib:${pkgs.gtk3}/lib ${pkgs.glibc}/lib/ld-linux-x86-64.so.2 --library-path ${pkgs.glibc}/lib $AGI_DIR/agi --verbose-startup --adb $ADB_X"
alias install="adb install --force-queryable -r -g $AGI_ANGLE_APK"
'';
};
angle-bootstrap = pkgs.stdenv.mkDerivation {
name = "agi-angle-apk-103.0.5024.0";
src = pkgs.fetchurl {
url = "https://agi-angle.storage.googleapis.com/103.0.5024.0/17154_angle-arm_64.apk";
sha256 = "9e76e1311b5c021d87155189e520485ebbe399d7cb20de546ba21e7e606eec17";
};
buildInputs = [ ];
unpackPhase = "true";
buildPhase = "true";
installPhase = ''
# Copy the APK file to the output directory
mkdir -p $out
cp $src $out/${angle_apk_name}
'';
};
agi-bootstrap = pkgs.stdenv.mkDerivation {
name = "agi-3.3.3-linux";
src = pkgs.fetchurl {
url = "https://github.com/google/agi/releases/download/v3.3.3/agi-3.3.3-linux.zip";
sha256 = "972ef21a68608f173117054dd1db6337826bee0abd55b4bc09d9496360b6d3a1";
};
buildInputs = [ pkgs.unzip pkgs.patchelf ];
unpackPhase = ''
mkdir -p $out
unzip $src -d $out
'';
buildPhase = ''
# Patch gapis binary
GAPIS_BINARY="$out/agi/gapis"
if [ -f "$GAPIS_BINARY" ]; then
echo "Patching gapis binary..."
patchelf --set-interpreter ${pkgs.glibc}/lib/ld-linux-x86-64.so.2 "$GAPIS_BINARY"
patchelf --set-rpath ${pkgs.glibc}/lib:${pkgs.gcc.cc.lib}/lib "$GAPIS_BINARY"
fi
'';
installPhase = ''
# Nothing to install, everything is already in $out
echo "AGI setup complete."
'';
};
};
};
}This seems to work, but pathelf seems to be a little bit excessive.
Metadata
Metadata
Assignees
Labels
No labels