lmstudio-ai / .github

34 stars 3 forks source link

PATCH: 0.2.19 Doesn't start because libOpenCL is not in AppImage LD_LIBRARY_PATH #39

Open deftdawg opened 2 months ago

deftdawg commented 2 months ago

Running appimage-run LM_Studio-0.2.19.appimage on NixOS fails with the following error:

Error: libOpenCL.so.1: cannot open shared object file: No such file or directory

This is caused by the folder ${APPDIR}/resources/app/.webpack/main/build/Release/OpenCL/ not being included in the LD_LIBRARY_PATH.

Here is a patch to AppRun that fixes it:

--- AppRun 2024-04-11 22:17:48.573070187 -0400
+++ AppRun      2024-04-11 22:17:05.739102788 -0400
@@ -24,7 +24,7 @@

 export PATH="${APPDIR}:${APPDIR}/usr/sbin:${PATH}"
 export XDG_DATA_DIRS="./share/:/usr/share/gnome:/usr/local/share/:/usr/share/:${XDG_DATA_DIRS}"
-export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"
+export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}:${APPDIR}/resources/app/.webpack/main/build/Release/OpenCL/"
 export XDG_DATA_DIRS="${APPDIR}"/usr/share/:"${XDG_DATA_DIRS}":/usr/share/gnome/:/usr/local/share/:/usr/share/
 export GSETTINGS_SCHEMA_DIR="${APPDIR}/usr/share/glib-2.0/schemas:${GSETTINGS_SCHEMA_DIR}"