It appears as though Octave (sci-mathematics/octave-4.2.1) links to the wrong version of libGL.so.1. Specifically, on a system with both mesa and nvidia installed, the library preference given by eselect does not appear to be respected. For reference: $ eselect opengl list Available OpenGL implementations: [1] nvidia * [2] xorg-x11 # ldconfig -p | grep 'libGL\.so' libGL.so.1 (libc6,x86-64) => /usr/lib64/opengl/nvidia/lib/libGL.so.1 libGL.so.1 (libc6,x86-64) => /usr/lib64/libGL.so.1 libGL.so.1 (libc6) => /usr/lib32/opengl/nvidia/lib/libGL.so.1 libGL.so.1 (libc6) => /usr/lib32/libGL.so.1 libGL.so (libc6,x86-64) => /usr/lib64/opengl/nvidia/lib/libGL.so libGL.so (libc6,x86-64) => /usr/lib64/libGL.so libGL.so (libc6) => /usr/lib32/opengl/nvidia/lib/libGL.so libGL.so (libc6) => /usr/lib32/libGL.so $ lddtree /usr/lib64/octave/4.2.1/liboctinterp.so.4.0.0 liboctinterp.so.4.0.0 => /usr/lib64/octave/4.2.1/liboctinterp.so.4.0.0 (interpreter => none) liboctave.so.4 => /usr/lib64/octave/4.2.1/liboctave.so.4 libcholmod.so.0 => /usr/lib64/libcholmod.so.0 libamd.so.0 => /usr/lib64/libamd.so.0 libcolamd.so.0 => /usr/lib64/libcolamd.so.0 libsuitesparseconfig.so.0 => /usr/lib64/libsuitesparseconfig.so.0 librt.so.1 => /lib64/librt.so.1 libumfpack.so.0 => /usr/lib64/libumfpack.so.0 libcxsparse.so.0 => /usr/lib64/libcxsparse.so.0 libarpack.so.2 => /usr/lib64/libarpack.so.2 libqrupdate.so.1 => /usr/lib64/libqrupdate.so.1 libblas.so.0 => /usr/lib64/blas/reference/libblas.so.0 libreadline.so.6 => /lib64/libreadline.so.6 libncurses.so.6 => /lib64/libncurses.so.6 libpcre.so.1 => /lib64/libpcre.so.1 libdl.so.2 => /lib64/libdl.so.2 ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 libgfortran.so.3 => /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgfortran.so.3 libquadmath.so.0 => /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libquadmath.so.0 libhdf5.so.10 => /usr/lib64/libhdf5.so.10 libmpi.so.20 => /usr/lib64/libmpi.so.20 libopen-rte.so.20 => /usr/lib64/libopen-rte.so.20 libopen-pal.so.20 => /usr/lib64/libopen-pal.so.20 libutil.so.1 => /lib64/libutil.so.1 libhwloc.so.5 => /usr/lib64/libhwloc.so.5 libnuma.so.1 => /usr/lib64/libnuma.so.1 libudev.so.1 => /lib64/libudev.so.1 libpciaccess.so.0 => /usr/lib64/libpciaccess.so.0 libevent-2.1.so.6 => /usr/lib64/libevent-2.1.so.6 libevent_pthreads-2.1.so.6 => /usr/lib64/libevent_pthreads-2.1.so.6 libMagick++-6.Q16.so.8 => /usr/lib64/libMagick++-6.Q16.so.8 libMagickWand-6.Q16.so.5 => /usr/lib64/libMagickWand-6.Q16.so.5 libMagickCore-6.Q16.so.5 => /usr/lib64/libMagickCore-6.Q16.so.5 libXext.so.6 => /usr/lib64/libXext.so.6 libbz2.so.1 => /lib64/libbz2.so.1 libltdl.so.7 => /usr/lib64/libltdl.so.7 libz.so.1 => /lib64/libz.so.1 libGL.so.1 => /usr/lib64/libGL.so.1 libexpat.so.1 => /usr/lib64/libexpat.so.1 libxcb-dri3.so.0 => /usr/lib64/libxcb-dri3.so.0 libxcb-present.so.0 => /usr/lib64/libxcb-present.so.0 libxcb-sync.so.1 => /usr/lib64/libxcb-sync.so.1 libxshmfence.so.1 => /usr/lib64/libxshmfence.so.1 libglapi.so.0 => /usr/lib64/libglapi.so.0 libXdamage.so.1 => /usr/lib64/libXdamage.so.1 libXfixes.so.3 => /usr/lib64/libXfixes.so.3 libX11-xcb.so.1 => /usr/lib64/libX11-xcb.so.1 libxcb.so.1 => /usr/lib64/libxcb.so.1 libXau.so.6 => /usr/lib64/libXau.so.6 libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 libbsd.so.0 => /usr/lib64/libbsd.so.0 libxcb-glx.so.0 => /usr/lib64/libxcb-glx.so.0 libxcb-dri2.so.0 => /usr/lib64/libxcb-dri2.so.0 libXxf86vm.so.1 => /usr/lib64/libXxf86vm.so.1 libdrm.so.2 => /usr/lib64/libdrm.so.2 libGLU.so.1 => /usr/lib64/libGLU.so.1 libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 libfreetype.so.6 => /usr/lib64/libfreetype.so.6 libpng16.so.16 => /usr/lib64/libpng16.so.16 libX11.so.6 => /usr/lib64/libX11.so.6 libgl2ps.so.1 => /usr/lib64/libgl2ps.so.1 liblapack.so.0 => /usr/lib64/lapack/reference/liblapack.so.0 libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libstdc++.so.6 libm.so.6 => /lib64/libm.so.6 libgomp.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgomp.so.1 libpthread.so.0 => /lib64/libpthread.so.0 libc.so.6 => /lib64/libc.so.6 libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libgcc_s.so.1 $ emerge -pv octave These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] sci-mathematics/octave-4.2.1:0/4.2.1::gentoo USE="X doc glpk gnuplot hdf5 imagemagick opengl qhull qrupdate readline sparse zlib -curl -fftw -graphicsmagick -gui -java -openssl -portaudio -postscript -sndfile -static-libs" $ emerge --info Portage 2.3.6 (python 2.7.12-final-0, hardened/linux/amd64, gcc-5.4.0, glibc-2.23-r4, 4.8.17-hardened-r2 x86_64) ================================================================= System uname: Linux-4.8.17-hardened-r2-x86_64-Intel-R-_Core-TM-_i7-4910MQ_CPU_@_2.90GHz-with-gentoo-2.3 KiB Mem: 16315444 total, 13735816 free KiB Swap: 8388604 total, 8388604 free Timestamp of repository gentoo: Sat, 05 Aug 2017 05:00:01 +0000 sh bash 4.3_p48-r1 ld GNU ld (Gentoo 2.28 p1.2) 2.28 ccache version 3.2.4 [disabled] app-shells/bash: 4.3_p48-r1::gentoo dev-java/java-config: 2.2.0-r3::gentoo dev-lang/perl: 5.24.1-r2::gentoo dev-lang/python: 2.7.12::gentoo, 3.4.5::gentoo dev-util/ccache: 3.2.4::gentoo dev-util/cmake: 3.7.2::gentoo dev-util/pkgconfig: 0.28-r2::gentoo sys-apps/baselayout: 2.3::gentoo sys-apps/openrc: 0.28::gentoo sys-apps/sandbox: 2.10-r3::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69::gentoo sys-devel/automake: 1.11.6-r1::gentoo, 1.15-r2::gentoo sys-devel/binutils: 2.28-r2::gentoo sys-devel/gcc: 4.9.4::gentoo, 5.4.0-r3::gentoo sys-devel/gcc-config: 1.7.3::gentoo sys-devel/libtool: 2.4.6-r3::gentoo sys-devel/make: 4.2.1::gentoo sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers) sys-libs/glibc: 2.23-r4::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 local location: /home/josyoun/usr/portage masters: gentoo ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=native -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -march=native -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="ftp://mirrors.rit.edu/gentoo/ ftp://gentoo.cites.uiuc.edu/pub/gentoo/" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j10" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" USE="a52 aac acl acpi alsa amd64 apm bash-completion berkdb bzip2 cdda cddb cli cracklib crypt css cxx dbus djvu dri dvd dvdr ffmpeg flac fortran gcj gdbm gif gnuplot gnutls hardened hdf5 iconv ipv6 jpeg jpeg2k justify mmx modules mono mozilla mp3 mp4 mpeg mpi mplayer multilib ncurses nls nptl ocaml ocamlopt offensive ogg opengl openmp pax_kernel pcre pdf pie png readline seccomp session sse sse2 ssl ssp svg tcpd theora threads tiff truetype unicode urandom usb vim-syntax vorbis x264 xattr xtpax xv zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="canon ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" L10N="en no nb" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en no nb" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="intel modesetting" XFCE_PLUGINS="brightness clock" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON octave:1> plot(1:10); libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast $ strace octave open("/usr/lib64/lapack/reference/libGLU.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib64/blas/reference/libGLU.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) open("/usr/lib64/libGLU.so.1", O_RDONLY|O_CLOEXEC) = 3 $ LD_LIBRARY_PATH=/usr/lib64/opengl/nvidia/lib/ octave octave:1> plot(1:10) octave:2> exit Basically, that last one shows that the library is fine, but the wrong path is used. $ readelf -d /usr/lib64/octave/4.2.1/liboctinterp.so.4.0.0 Dynamic section at offset 0x1147998 contains 42 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [liboctave.so.4] 0x0000000000000001 (NEEDED) Shared library: [libhdf5.so.10] 0x0000000000000001 (NEEDED) Shared library: [libMagick++-6.Q16.so.8] 0x0000000000000001 (NEEDED) Shared library: [libMagickCore-6.Q16.so.5] 0x0000000000000001 (NEEDED) Shared library: [libz.so.1] 0x0000000000000001 (NEEDED) Shared library: [libGL.so.1] 0x0000000000000001 (NEEDED) Shared library: [libGLU.so.1] 0x0000000000000001 (NEEDED) Shared library: [libfontconfig.so.1] 0x0000000000000001 (NEEDED) Shared library: [libfreetype.so.6] 0x0000000000000001 (NEEDED) Shared library: [libX11.so.6] 0x0000000000000001 (NEEDED) Shared library: [libgl2ps.so.1] 0x0000000000000001 (NEEDED) Shared library: [liblapack.so.0] 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6] 0x0000000000000001 (NEEDED) Shared library: [libm.so.6] 0x0000000000000001 (NEEDED) Shared library: [libgomp.so.1] 0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x000000000000000e (SONAME) Library soname: [liboctinterp.so.4] 0x000000000000001d (RUNPATH) Library runpath: [/usr/lib64/lapack/reference:/usr/lib64/blas/reference:/usr/lib64] 0x000000000000000c (INIT) 0x2d7698 0x000000000000000d (FINI) 0xea325c 0x0000000000000019 (INIT_ARRAY) 0x13051d8 0x000000000000001b (INIT_ARRAYSZ) 2808 (bytes) 0x000000000000001a (FINI_ARRAY) 0x1305cd0 0x000000000000001c (FINI_ARRAYSZ) 8 (bytes) 0x000000006ffffef5 (GNU_HASH) 0x190 0x0000000000000005 (STRTAB) 0x9f8e0 0x0000000000000006 (SYMTAB) 0x18070 0x000000000000000a (STRSZ) 1130441 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000003 (PLTGOT) 0x1347c78 0x0000000000000007 (RELA) 0x1bef10 0x0000000000000008 (RELASZ) 1148808 (bytes) 0x0000000000000009 (RELAENT) 24 (bytes) 0x000000000000001e (FLAGS) BIND_NOW 0x000000006ffffffb (FLAGS_1) Flags: NOW 0x000000006ffffffe (VERNEED) 0x1bed60 0x000000006fffffff (VERNEEDNUM) 7 0x000000006ffffff0 (VERSYM) 0x1b38aa 0x000000006ffffff9 (RELACOUNT) 1634 0x0000000000000000 (NULL) 0x0 Anyway, I may be wrong, but it looks like the rpath on liboctinterp is set in such a way that the wrong libGL.so.1 is getting picked up. From above strace seems to confirm this since Octave originally looked for libGL in both the BLAS and LAPACK directories also in the rpath. Thanks for the help!
Please re-open if the issue is reproduced with 5.2.0 and an up to date mesa/nvidia-drivers/libglvnd stack.
(In reply to Andreas Sturmlechner from comment #1) > Please re-open if the issue is reproduced with 5.2.0 and an up to date > mesa/nvidia-drivers/libglvnd stack. Just checked. Issue is resolved. Thanks!