JuliaGL / GLFW.jl

Julia interface to GLFW, a multi-platform library for creating windows with OpenGL contexts and managing input and events.
http://www.glfw.org/
MIT License
138 stars 32 forks source link

Compatability with julia-vscode? #210

Closed tbenst closed 3 years ago

tbenst commented 3 years ago

Since VScode is now the platform of choice for a Julia IDE/editor, it would be great to be able to use GLFW.jl and Makie.

Unfortunately, I receive the dreaded "ERROR: GLFWError (API_UNAVAILABLE): GLX: No GLXFBConfigs returned" message when attempting to run the following from within VSCode (eg the terminal):

using GLFW; window = GLFW.CreateWindow(640, 480, "GLFW.jl")

Any tips on successfully using GLFW with VScode? Many thanks!!

tbenst commented 3 years ago

Ah, the issue in my case is my opengl .so files are on LD_LIBRARY_PATH, and so struck once again by https://github.com/julia-vscode/julia-vscode/issues/1684. If I open VScode from terminal where the path is properly set, then this propagates, otherwise setting via ENV does nothing since used at julia init time

Edit: I was able to fix this by setting "julia.executablePath": "/home/tyler/.nix-profile/bin/julia"! This is what my system returns for which julia, but it seems that somehow julia-vscode was jumping straight to /nix/store/lqyhf3ympk18f41prmhaxd450xpmp8h9-julia-1.5.2/bin/julia, and dropping the key export statements.

❯ cat $(which julia)
#! /nix/store/2jysm3dfsgby5sw5jgj43qjrb5v79ms9-bash-4.4-p23/bin/bash -e
export LD_LIBRARY_PATH='/nix/store/l393bs74dwjbs77vfpri52m1jwkjay0g-nvidia-x11-455.38-5.4.80/lib:/run/opengl-driver/lib:/nix/store/7xkbxjxaryrz8ka1padvgh61ljfn85cr-mbedtls-2.16.3/lib:/nix/store/pkpyl7ibq1f2miq6swzz4gdx1d6pzd07-zeromq-4.3.2/lib:/nix/store/v7f93m47iwry8aaslrrlnzgxq9xn71fk-imagemagick-6.9.11-14/lib:/nix/store/1ciffw1l2vmaj45p362y5j6gfgzfs7ba-hdf5-1.10.6/lib:/nix/store/wr2yz1lcv6llc14c9fx7ycg3a4bp4ddd-cmake-3.18.2/lib:/nix/store/ach8xwprcl4frpwjfzbizn2hn4m3zncl-cairo-1.16.0/lib:/nix/store/cnd12dw83ajbj55b9raa9alrlss94bmr-gettext-0.21/lib:/nix/store/sf6iah3xvmqd3p453r8qd27gph9zjryv-pango-1.45.5/lib:/nix/store/j50h3j69jp0kmv7pkaj67wnw16dk0kra-glib-2.64.5/lib:/nix/store/l1zvwaszlpfxp3r3q3969856lzx1xq4s-gtk+3-3.24.21/lib:/nix/store/0yg4w1xmdyy47qqgs7qd9lkijl8xz3qf-gdk-pixbuf-2.40.0/lib:/nix/store/d37p4m3i5jkxqqrvxpd88fif5ar7jbm8-graphite2-1.3.14/lib:/nix/store/970klxrpqwh9x0l5jhj3wbrpsdmhhncy-qt-4.8.7/lib:/nix/store/8pbwywcj6vbswz7xmy2dh716x8blgh8w-gcc-wrapper-9.3.0/lib:/nix/store/9df65igwjmf2wbw0gbrrgair6piqjgmi-glibc-2.31/lib:/nix/store/vran8acwir59772hj4vscr7zribvp7l5-gcc-9.3.0-lib/lib:/nix/store/ljjm1r3hn8wmlh5gp38vms13hipjmygy-gzip-1.10/lib:/nix/store/9sfmwj09ij65qnc8dgv8h56gf12b60nn-zlib-1.2.11/lib:/nix/store/kkbk28yacwx084kbbhki3zx353jl85rz-libXt-1.2.0/lib:/nix/store/8lfnjk923yvf1q296hj3pgal1y58hl33-libX11-1.6.12/lib:/nix/store/jf1pp67s9yagrpskxqr5s3sl1q5rh6r3-libXrender-0.9.10/lib:/nix/store/af4qyza36l1kpwhdx7lzq68wpwbzjf0r-libXext-1.3.4/lib:/nix/store/f601br2nhhkl645zj401idvxqxw5h1ql-libXcomposite-0.4.5/lib:/nix/store/l5xahlxdm313kqviykny26kh6sqc9qcv-glfw-3.3.2/lib:/nix/store/bgg0iminqvpl22v0n2fzcqx6knh6v9cj-glxinfo-8.4.0/lib:/nix/store/g44ff4vpp4s5dyh42inczan8ckv9bh6j-freetype-2.10.2/lib:/nix/store/0y1y2rixnvk5g4aph2impa0hl54f0wj1-cudatoolkit-10.2.89-lib/lib:/nix/store/l393bs74dwjbs77vfpri52m1jwkjay0g-nvidia-x11-455.38-5.4.80/lib:/nix/store/57gsbs8hr1bmd6dbb5sdx4c6m4ghzg62-git-2.28.0/lib:/nix/store/qpvh3mmixf9abdcwq306g3gx63ggbf1l-git-repo-2.9/lib:/nix/store/3sj18y1gp7r108bh7hsiw97807sdsbb1-gnupg-2.2.23/lib:/nix/store/nlxwqib9h0kd440va4ycq8lm5x2ajccs-autoconf-2.69/lib:/nix/store/wmp5y493sfx864nrmn4gy94gza0d30ck-curl-7.72.0/lib:/nix/store/xv7cmqyp6a8da8y8avxpqakpjgdnlifg-procps-3.3.16/lib:/nix/store/n6pcva97lbir5fi50hqa6wpq5m493482-gnumake-4.3/lib:/nix/store/mz6j9b6p1qdwhlvni7h9gyl8dc0qh7i7-util-linux-2.36/lib:/nix/store/z5h3ddrsnx40zara73sadq2ml0skhdyk-gnum4-1.4.18/lib:/nix/store/zmi23k8aqagkgwqs39gc13mf99chiwp9-gperf-3.1/lib:/nix/store/bs0d5iz7isfa8spbp2d4w31sbkkbd6ff-unzip-6.0/lib:/nix/store/8b29scxsj8v03ghhjp4yvs4vfp3w2r27-libGL-1.3.2/lib:/nix/store/cik4yr2ddifxhnwcsidg1ym5whkfzhwb-glu-9.0.1/lib:/nix/store/nrrxdc21i6imnd64f5q44i67j7qc39jh-libXi-1.7.10/lib:/nix/store/2mdzclvq4n492qnjb7hqdwxh8vda0cks-libXmu-1.1.3/lib:/nix/store/iqv3pwg9ilrbgdn2s44kyk8dsfa9ybz0-freeglut-3.2.1/lib:/nix/store/af4qyza36l1kpwhdx7lzq68wpwbzjf0r-libXext-1.3.4/lib:/nix/store/8lfnjk923yvf1q296hj3pgal1y58hl33-libX11-1.6.12/lib:/nix/store/wzlhggng74yzhcm7f7k499ax6wagi93p-libXv-1.0.11/lib:/nix/store/56iqvz2s03ig407qa7h9si4nbwc067hz-libXrandr-1.5.2/lib:/nix/store/9sfmwj09ij65qnc8dgv8h56gf12b60nn-zlib-1.2.11/lib:/nix/store/ngk87jpy17aj9jxq1a99fk78pj201r9z-ncurses-6.2-abi5-compat/lib:/nix/store/8pbwywcj6vbswz7xmy2dh716x8blgh8w-gcc-wrapper-9.3.0/lib:/nix/store/5sj06x18pd8an12ndl65hlwmp8afnrwa-binutils-wrapper-2.31.1/lib:/nix/store/amfl8fs25n5ivx4a332gdilkr9ixqqhk-libXcursor-1.2.0/lib:/nix/store/ikx4saa0wm8r135ml6m2pgnlv914r306-libXinerama-1.1.4/lib:/nix/store/4xp5b5al94f7ir3lsb3pvhc5yn45dai7-arpack-3.7.0/lib:/nix/store/z5g0y84g2iknwwgfhw9wslbbzgw1w22k-gfortran-9.3.0-lib/lib:/nix/store/y51x749y1y2vqcsdvrid8k8r9dn6c038-ANTs-2.2.0/lib:/nix/store/9sfmwj09ij65qnc8dgv8h56gf12b60nn-zlib-1.2.11/lib'${LD_LIBRARY_PATH:+':'}$LD_LIBRARY_PATH
export CUDA_PATH='/nix/store/h684kk18183c8d0v1jnaphlrd3zba88q-cudatoolkit-10.2.89'
export JULIA_PKGDIR=''
exec "/nix/store/lqyhf3ympk18f41prmhaxd450xpmp8h9-julia-1.5.2/bin/julia"  "$@"