vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
533 stars 89 forks source link

error: GLSL 3.00 is not supported #369

Closed verga closed 1 year ago

verga commented 1 year ago

Running with asy -f pdf b.asy the file b.asy

import settings;
render = 4;
prc = false;

import three;
import solids;
texpreamble("\usepackage{bm}");

size(250, 0);

currentprojection  =  perspective(9, 3, 3);

pen pr = rgb(0.5, 0.3, 0.3);

// barre
real l = 1.6;
real a = 0.05;
real t = 45;
real theta = t*pi/180;
real q = 60;
real phi = q*pi/180;
triple ax = (sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta));
revolution C = cylinder(O, a, l, ax);
draw(surface(C),  gray(0.95));

gives 0:1(10): error: GLSL 3.00 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.50, 3.30, 1.00 ES, 3.00 ES, and 3.10 ES

My configuration is

glxinfo  | grep -i versionserver glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Version: 22.3.5
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.3.5
OpenGL core profile shading language version string: 4.60
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.3.5
OpenGL shading language version string: 4.60
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.3.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
    GL_EXT_shader_implicit_conversions, GL_EXT_shader_integer_mix,

and

inxi -GaS
System:
  Host: eka Kernel: 6.1.12-1-default arch: x86_64 bits: 64 compiler: gcc
    v: 12.2.1 parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.12-1-default
    root=UUID=3bca1aa0-a9a9-4ee9-8a9c-4aebb95a7419 splash=silent
    resume=/dev/disk/by-id/nvme-KXG5AZNV512G_NVMe_SED_TOSHIBA_512GB_884S1065T9TQ-part4
    quiet loglevel=3 mem_sleep_default=deep nosimplefb=1 mitigations=auto
  Desktop: KDE Plasma v: 5.27.0 tk: Qt v: 5.15.8 wm: kwin_x11 vt: 7 dm: SDDM
    Distro: openSUSE Tumbleweed 20230217
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Dell
    driver: i915 v: kernel arch: Gen-9.5 process: Intel 14nm built: 2016-20
    ports: active: DP-3,eDP-1 empty: DP-1,DP-2 bus-ID: 00:02.0
    chip-ID: 8086:3e9b class-ID: 0300
  Device-2: NVIDIA GP107GLM [Quadro P2000 Mobile] vendor: Dell
    driver: nvidia v: 470.161.03 alternate: nouveau,nvidia_drm non-free: 520.xx+
    status: current (as of 2022-10) arch: Pascal code: GP10x
    process: TSMC 16nm built: 2016-21 pcie: gen: 1 speed: 2.5 GT/s lanes: 16
    link-max: gen: 3 speed: 8 GT/s bus-ID: 01:00.0 chip-ID: 10de:1cba
    class-ID: 0302
  Device-3: Microdia Integrated_Webcam_HD type: USB driver: uvcvideo
    bus-ID: 1-12:4 chip-ID: 0c45:671d class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.7 with: Xwayland v: 22.1.8
    compositor: kwin_x11 driver: X: loaded: modesetting,nvidia dri: iris
    gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 5760x2160 s-dpi: 168 s-size: 870x326mm (34.25x12.83")
    s-diag: 929mm (36.58")
  Monitor-1: DP-3 pos: right model: Wacom One 13 serial: 0HQ0171000242
    built: 2020 res: 1920x1080 hz: 60 dpi: 166 gamma: 1.2
    size: 294x166mm (11.57x6.54") diag: 338mm (13.3") ratio: 16:9 modes:
    max: 1920x1080 min: 720x400
  Monitor-2: eDP-1 pos: primary,left model: Sharp 0x148d built: 2018
    res: 3840x2160 hz: 60 dpi: 284 gamma: 1.2 size: 344x194mm (13.54x7.64")
    diag: 395mm (15.5") ratio: 16:9 modes: 3840x2160
  API: OpenGL v: 4.6 Mesa 22.3.5 renderer: Mesa Intel UHD Graphics 630 (CFL
    GT2) direct render: Yes

I configured the nvidia with prime-select offload (current) | intel | nvidia with the same result

Asymptote version is

asy --version
Asymptote version 2.79 [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince]

ENABLED OPTIONS:
WebGL    3D HTML rendering
OpenGL   3D OSMesa offscreen rendering
SSBO     GLSL shader storage buffer objects
GSL      GNU Scientific Library (special functions)
FFTW3    Fast Fourier transforms
Readline Interactive history and editing
Sigsegv  Distinguish stack overflows from segmentation faults
GC       Boehm garbage collector
threads  Render OpenGL in separate thread

DISABLED OPTIONS:
V3D      3D vector graphics output
XDR      External Data Representation (portable binary file format for V3D)
CURL     URL support
LSP      Language Server Protocol
verga commented 1 year ago

I found that

MESA_GL_VERSION_OVERRIDE=3.3 asy -f pdf b.asy

works fine.

johncbowman commented 1 year ago

It's good to know that this issue has been resolved.

verga commented 1 year ago

Do you think it would be possible to avoid passing explicitly the Mesa variable when calling asy? Thank you!

Le mer. 22 févr. 2023 à 22:41, John Bowman @.***> a écrit :

It's good to know that this issue has been resolved.

— Reply to this email directly, view it on GitHub https://github.com/vectorgraphics/asymptote/issues/369#issuecomment-1440838776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHTPOY3LRQ5DLK4V6DXMCTWY2BW5ANCNFSM6AAAAAAVEUKPRI . You are receiving this because you authored the thread.Message ID: @.***>

johncbowman commented 1 year ago

Wouldn't it be better to set that environment variable system wide, say in a file in /etc/profile.d? There's no reason to continue using obsolete versions of OpenGL; not setting this variable will cause problems with other OpenGL programs too.

verga commented 1 year ago

OK It is then related to a configuration problem in my system: I use Tumbleweed (openSuse) with the latest updates!

Best wishes,

Le mer. 22 févr. 2023 à 23:11, John Bowman @.***> a écrit :

Wouldn't it be better to set that environment variable system wide, say in a file in /etc/profile.d? There's no reason to continue using obsolete versions of OpenGL; not setting this variable will cause problems with other OpenGL programs too.

— Reply to this email directly, view it on GitHub https://github.com/vectorgraphics/asymptote/issues/369#issuecomment-1440877735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHTPO4Z55MHYP2NLNRVM2DWY2FJLANCNFSM6AAAAAAVEUKPRI . You are receiving this because you authored the thread.Message ID: @.***>