Skip to content

Instantly share code, notes, and snippets.

@MohamedElashri
Created April 24, 2025 08:51
Show Gist options
  • Save MohamedElashri/9a86cd665cbf2d3d59f418fd746bb9cf to your computer and use it in GitHub Desktop.
Save MohamedElashri/9a86cd665cbf2d3d59f418fd746bb9cf to your computer and use it in GitHub Desktop.
Fixing Electron App Crashes Caused by `amdgcn--` Triple Errors on Linux

⚠️ Fixing Electron App Crashes Caused by amdgcn-- Triple Errors on Linux

🧩 Problem

Electron-based applications (e.g., 1Password, VSCode, Discord, etc.) crash on Linux systems where AMD's ROCm or amdgpu-install driver stack is present. A representative error message looks like this:

Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)
...
[ERROR:gpu_process_host.cc(981)] GPU process exited unexpectedly: exit_code=139
...
[FATAL:gpu_data_manager_impl_private.cc(423)] GPU process isn't usable. Goodbye.

🔍 Root Cause

  • Electron apps rely on GPU acceleration via Mesa and Vulkan drivers.
  • ROCm or AMDGPU installs add LLVM components with AMDGPU-specific targets (amdgcn--) that are not usable by Electron apps.
  • Mesa ends up trying to load these targets for GPU shader compilation or Vulkan setup but fails because the LLVM backend is incomplete or mismatched.
  • Electron apps crash due to failed GPU process initialization.

📌 Example

1Password for Linux is an Electron app. On affected systems, launching it results in:

1password
# Fails with: "Cannot find target for triple amdgcn--"
# Followed by multiple GPU process crashes and a core dump.

✅ Solution

1. Remove ROCm/AMDGPU packages that interfere with Mesa

If you installed ROCm or used amdgpu-install, purge the conflicting packages:

sudo apt purge --auto-remove \
  amdgpu-core amdgpu-install \
  comgr hip-runtime-amd hsa-rocr \
  libdrm-amdgpu-amdgpu1 libdrm-amdgpu-common \
  libdrm-amdgpu-radeon1 libdrm-amdgpu1 libdrm2-amdgpu \
  libllvm18.1-amdgpu \
  libva-amdgpu-drm2 libva-amdgpu-wayland2 libva-amdgpu-x11-2 libva2-amdgpu \
  libwayland-amdgpu-client0 \
  mesa-amdgpu-va-drivers \
  miopen-hip rocblas rocprofiler-sdk rocprofiler-sdk-roctx \
  rocm-core rocm-hip-runtime rocm-language-runtime rocm-smi-lib rocminfo

2. Clean up apt + fix broken packages

sudo apt clean
sudo apt update
sudo apt-mark unhold libclc-dev
sudo apt --fix-broken install
sudo apt full-upgrade

3. Reinstall stock Mesa and OpenCL stack

This ensures Mesa does not try to load any ROCm-specific LLVM targets.

sudo apt install --reinstall \
  libgl1-mesa-dri \
  mesa-vulkan-drivers \
  mesa-opencl-icd \
  ocl-icd-libopencl1 \
  libclc-dev

4. Delete rogue LLVM target files

If ROCm left behind intermediate compiler targets:

sudo find /usr/lib/llvm*/ -name '*amdgcn*' -delete
sudo find /usr/lib/llvm*/ -name '*gfx*' -delete

5. Verify fix with 1Password (or other Electron apps)

Try launching 1Password again:

1password

Alternatively, override the GPU driver to use Mesa’s default:

MESA_LOADER_DRIVER_OVERRIDE=radeonsi 1password

Or disable hardware acceleration entirely:

LIBGL_ALWAYS_SOFTWARE=1 1password

If successful, the app will launch without crashing, and the amdgcn-- error will no longer appear.


💡 Notes

  • This issue applies broadly to Electron apps using GPU acceleration on systems with ROCm/AMDGPU stack.
  • Avoid installing ROCm on systems where Electron GUI apps are expected to run unless you isolate them in containers or separate environments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment