gpt4all-chat icon indicating copy to clipboard operation
gpt4all-chat copied to clipboard

Linux: RHEL 9.1: libjpeg.so.8: cannot open shared object file (SOLVED)

Open fastrizwaan opened this issue 1 year ago • 7 comments

Does not work in rhel 9.1 / rocky 9.1

/opt/gpt4all\ 0.1.0/bin/chat 
/opt/gpt4all 0.1.0/bin/chat: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory

Kindly include all the dependencies in /opt/gpt4all\ 0.1.0/lib/ for it to work.

[root@localhost jpeg-8d]# ldd /opt/gpt4all\ 0.1.0/bin/chat |grep -i not
/opt/gpt4all 0.1.0/bin/chat: /lib64/libm.so.6: version `GLIBC_2.35' not found (required by /opt/gpt4all 0.1.0/bin/chat)
/opt/gpt4all 0.1.0/bin/chat: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /opt/gpt4all 0.1.0/bin/chat)
	libjpeg.so.8 => not found
	libxcb-cursor.so.0 => not found

fastrizwaan avatar Apr 14 '23 16:04 fastrizwaan

Can confirm that it also fails with the same error on the latest linux mint. Just installed mint, just installed this. I get the error above as well.

MisterE123 avatar Apr 14 '23 16:04 MisterE123

On Linux Mint I got a similar issue, I got the following error: ./chat: error while loading shared libraries: libxcb-cursor.so.0: cannot open shared object file: No such file or directory

Then I installed libxcb-cursor by: sudo apt install libxcb-cursor0

Then running the binary again, I got different errors:

./chat: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.35' not found (required by ./chat)
./chat: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by ./chat)
./chat: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./chat)
./chat: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./chat)
./chat: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./chat)
./chat: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./chat)
./chat: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /opt/gpt4all 0.1.0/bin/../lib/libicuuc.so.70)
./chat: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /opt/gpt4all 0.1.0/bin/../lib/libicuuc.so.70)

hacker-szabo avatar Apr 14 '23 16:04 hacker-szabo

I've copied required files from ubuntu 22.04 livecd and https://packages.ubuntu.com/jammy/libxcb1

extract the tar archive, now it works in rhel 9.1 https://github.com/fastrizwaan/gpt4all-libs/releases/tag/0.1.0

image

fastrizwaan avatar Apr 14 '23 17:04 fastrizwaan

fixed for me with https://github.com/nomic-ai/gpt4all-chat/issues/3

MisterE123 avatar Apr 14 '23 17:04 MisterE123

[Solved] With Fedora 37, it was also not able to find libjpeg.so.8, but I was able to work around it:

$ locate libjpeg.so.8

/var/lib/snapd/snap/android-file-transfer-linux/199/usr/lib/x86_64-linux-gnu/libjpeg.so.8
/var/lib/snapd/snap/android-file-transfer-linux/199/usr/lib/x86_64-linux-gnu/libjpeg.so.8.1.2
/var/lib/snapd/snap/blue-recorder/126/usr/lib/x86_64-linux-gnu/libjpeg.so.8
/var/lib/snapd/snap/blue-recorder/126/usr/lib/x86_64-linux-gnu/libjpeg.so.8.1.2
/var/lib/snapd/snap/gnome-3-28-1804/161/usr/lib/x86_64-linux-gnu/libjpeg.so.8
/var/lib/snapd/snap/gnome-3-28-1804/161/usr/lib/x86_64-linux-gnu/libjpeg.so.8.1.2
/var/lib/snapd/snap/gnome-3-28-1804/194/usr/lib/x86_64-linux-gnu/libjpeg.so.8
/var/lib/snapd/snap/gnome-3-28-1804/194/usr/lib/x86_64-linux-gnu/libjpeg.so.8.1.2

$ sudo cp /var/lib/snapd/snap/blue-recorder/126/usr/lib/x86_64-linux-gnu/libjpeg.so.8 "/opt/gpt4all 0.1.0/lib/"

$ "/opt/gpt4all 0.1.0/bin/chat"

QML debugging is enabled. Only use this in a safe environment.
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
Qt: Session management error: Could not open network socket
gptj_model_load: loading model from 'ggml-gpt4all-j.bin' - please wait ...
gptj_model_load: n_vocab = 50400
gptj_model_load: n_ctx   = 2048
gptj_model_load: n_embd  = 4096
gptj_model_load: n_head  = 16
gptj_model_load: n_layer = 28
gptj_model_load: n_rot   = 64
gptj_model_load: f16     = 2
gptj_model_load: ggml ctx size = 5401.45 MB
gptj_model_load: memory_size =  1792.00 MB, n_mem = 57344
gptj_model_load: ................................... done
gptj_model_load: model size =  3609.38 MB / num tensors = 285

PenelopeFudd avatar Apr 15 '23 05:04 PenelopeFudd

Expanding on PenelopFudd's process of locating libjpeg.so.8 and copying it over, while making sure it's actually a ELF64 bit file.

#!/bin/bash

## Find LibJpeg ##
# Set the expected architecture for the libjpeg.so.8 file
EXPECTED_ARCH="ELF 64-bit LSB shared object"

# Use the locate command to find candidate files
candidates=$(locate libjpeg.so.8)

# We want to copy the found lib file to here
destination=/opt/gpt4all/lib/libjpeg.so.8

# Loop through each candidate file
for file_path in $candidates; do
  # Check the architecture of the file
  file_output=$(file "$file_path")
  if [[ "$file_output" == *"$EXPECTED_ARCH"* ]]; then
    # Copy the file to /opt/gpt4all 0.1.0/lib/
    echo "found 64bit lib file in $file_path"
    sudo cp "$file_path" "$destination"
    break
  fi
done

mofosyne avatar Apr 20 '23 09:04 mofosyne

I was actually kind of distressed that typing yum provides '*/libjpeg.so.8' didn't find anything:

Fedora 37 - x86_64 - Updates                                                                                                 791 kB/s |  17 MB     00:21    
google-chrome                                                                                                                2.9 kB/s | 3.6 kB     00:01    
Hashicorp Stable - x86_64                                                                                                    491 kB/s | 1.0 MB     00:02       
RPM Fusion for Fedora 37 - Free - Updates                                                                                    298 kB/s | 412 kB     00:01    
RPM Fusion for Fedora 37 - Nonfree - NVIDIA Driver                                                                            22 kB/s |  15 kB     00:00    
RPM Fusion for Fedora 37 - Nonfree - Updates                                                                                  50 kB/s |  86 kB     00:01    
Error: No matches found. If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.

It seems that's a normal problem encountered when running executables built on other systems.

PenelopeFudd avatar Apr 20 '23 18:04 PenelopeFudd

Duplicate and fixed.

manyoso avatar May 09 '23 16:05 manyoso