kaveh808 / kons-9

Common Lisp 3D Graphics Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error for GLSL 4.10 not supported

alejandrogallo opened this issue · comments

Hi!

I'm on master, using nixos 22.05.

sbcl --version
SBCL 2.2.4.nixos

Apparently the OpenGL version in nixos is 3.1 and is not compatible with GLSL 4.10?

I'm not an expert in OpenGL or anything, maybe this is best asked over at nixos,
but maybe you have some pointers about it.

Error backtrace

CL-USER> (kons-9:run)
#<SIMPLE-TASKS:CALL-TASK :FUNC #<FUNCTION (LAMBDA () :IN KONS-9:RUN) {53C188BB}> :STATUS :SCHEDULED {10070E99D3}>

OpenGL Version: 3.1
WARNING: vertex shader failed to compile
Date/time: 2022-11-08-00:10!
An unhandled error condition has been signalled:
   0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES



Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10015D0263}>
0: (TRIVIAL-BACKTRACE:PRINT-BACKTRACE-TO-STREAM #<SYNONYM-STREAM :SYMBOL SLYNK::*CURRENT-DEBUG-IO* {10015A0FC3}>)
1: (TRIVIAL-BACKTRACE:PRINT-BACKTRACE #<SIMPLE-ERROR "0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
" {10041598E3}> :OUTPUT NIL :IF-EXISTS :APPEND :VERBOSE NIL)
2: ((FLET "H0" :IN KONS-9:SHOW-WINDOW) #<SIMPLE-ERROR "0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
" {10041598E3}>)
3: (SB-KERNEL::%SIGNAL #<SIMPLE-ERROR "0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
" {10041598E3}>)
4: (ERROR "0:1(10): error: GLSL 4.10 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
")
5: (KONS-9::CHECK-SHADER 1 "vertex shader")
6: (KONS-9::CREATE-DEVICE-OBJECTS)
7: (KONS-9::INITIAL-TEXT-ENGINE-SETUP)
8: (KONS-9:SHOW-WINDOW #<KONS-9::SCENE , frame bounds: 0 240, current: 0  {1001ED4283}>)
9: ((:METHOD SIMPLE-TASKS:RUN-TASK (SIMPLE-TASKS:CALL-TASK)) #<SIMPLE-TASKS:CALL-TASK :FUNC #<FUNCTION (LAMBDA NIL :IN KONS-9:RUN) {53C188BB}> :STATUS :RUNNING {10070E99D3}>) [fast-method]
10: ((:METHOD SIMPLE-TASKS:RUN-TASK :AROUND (SIMPLE-TASKS:TASK)) #<SIMPLE-TASKS:CALL-TASK :FUNC #<FUNCTION (LAMBDA NIL :IN KONS-9:RUN) {53C188BB}> :STATUS :RUNNING {10070E99D3}>) [fast-method]
11: ((:METHOD SIMPLE-TASKS:START-RUNNER (SIMPLE-TASKS:QUEUED-RUNNER)) #<SIMPLE-TASKS:QUEUED-RUNNER :STATUS :RUNNING {1003ACB0E3}>) [fast-method]
12: ((SB-PCL::EMF SIMPLE-TASKS:START-RUNNER) #<unused argument> #<unused argument> #<SIMPLE-TASKS:QUEUED-RUNNER :STATUS :RUNNING {1003ACB0E3}>)
13: ((:METHOD SIMPLE-TASKS:START-RUNNER :AROUND (SIMPLE-TASKS:RUNNER)) #<SIMPLE-TASKS:QUEUED-RUNNER :STATUS :RUNNING {1003ACB0E3}>) [fast-method]
14: ((LAMBDA NIL :IN TRIVIAL-MAIN-THREAD::RUNNER-STARTER))
15: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-THREAD::%INTERRUPT-THREAD))
16: (SB-UNIX::SIGURG-HANDLER #<unused argument> #<unused argument> #.(SB-SYS:INT-SAP #X7F1D51946F00))
17: ((FLET SB-THREAD::EXEC :IN SB-SYS:INVOKE-INTERRUPTION))
18: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-SYS:INVOKE-INTERRUPTION))
19: (SB-SYS:INVOKE-INTERRUPTION #<FUNCTION (FLET SB-UNIX::INTERRUPTION :IN SB-UNIX::%INSTALL-HANDLER) {7F1D51946CBB}>)
20: ((FLET SB-UNIX::RUN-HANDLER :IN SB-UNIX::%INSTALL-HANDLER) 23 #.(SB-SYS:INT-SAP #X7F1D51947030) #.(SB-SYS:INT-SAP #X7F1D51946F00))
21: ("foreign function: call_into_lisp_")
22: ("foreign function: funcall3")
23: ("foreign function: interrupt_handle_now")
24: ("foreign function: #x419E2E")

I have same problem, trying to run on Linux Mint. I think the answer is we need to upgrade OpenGL lib to v4, but packages may not be available for that (proprietary drivers may be needed + hardware support). I haven't been able to upgrade here.

We are currently using an older version of OpenGL for the Mac.

In the file kons-9.asd, try manually commenting in opengl2-text and commenting out opengl3-text and see if that helps.

These are the lines:

   #+darwin(:file "src/graphics/opengl/opengl2-text")
   #-darwin(:file "src/graphics/opengl/opengl3-text")

That solved it for me. Thanks!

I did it like this:

#+(or darwin linux)(:file "src/graphics/opengl/opengl2-text")
#-(or darwin linux)(:file "src/graphics/opengl/opengl3-text")
``

that also did it for me! Thanks @kaveh808 and @mmontone.
However, I don't know what is the best way of fixing this for most people

kons-9 is work in progress. Perhaps there's a way of selecting the opengl doing some library detection. But I think they are developing some other backend based on Vulkan.

@alejandrogallo FYI I have a nixpkgs branch that includes kons-9 over here: NixOS/nixpkgs#197694

ah that's interesting, it would be cool to know exactly what your workflow ist, mine it's quite dumb, I just add the nix paths to cffi

(defun load-kons9 ()
  (progn
    (ale.nix::add-to-cffi-lib "libGL")
    (ale.nix::add-to-cffi-lib "libGLU")
    (ale.nix::add-to-cffi-lib "glfw"))
  (ql:quickload :kons-9))

@alejandrogallo I'm still feeling my way along but for now I have two different ways to pull kons-9 into nix.

First is a stand-alone derivation that builds on the lispPackages_new infrastructure in nixpkgs by @Uthar: https://github.com/nuddyco/lispnix/blob/main/kons-9.nix

Second is just adding kons-9 to that package collection alongside everything else from quicklisp etc: NixOS/nixpkgs@62acee1

I really like the lispPackages_new infrastructure because you can just say the names of the Lisp packages you depend on and Nix will automatically pull in all of their native dependencies like compatible versions of glfw etc.

I also a ways back setup a Github Actions CI to test kons-9 and using nix to deploy it. I dropped that idea though because there didn't seem to be much appetite on this upstream repo. Meanwhile I am cooking up broader Lisp/Nix CI things over at Uthar/nix-cl#13

that's great thanks @lukego I'll be taking a look at it, it would be good to leverage nix to test kons-9, I'm looking to build a crystal viewer for different tasks of the computational chemist toolset, something like http://jp-minerals.org/vesta/en/download.html, but I have to find time for this.