Euterpea / HSoM

Supporting Impelementation for Haskell School of Music
zlib License
87 stars 12 forks source link

Running MUI example fails #11

Open ninioArtillero opened 4 months ago

ninioArtillero commented 4 months ago

The Bifurcate example from https://www.euterpea.com/compiling-to-executable/ throws the following error:

freeglut (Bifurcate):  ERROR:  Internal error <FBConfig with necessary capabilities not found> in function fgOpenWindow
I'm running ghc bifurcate -o Bifurcate from a nix-shell with the following packages in ghc's scope (ghc-pkg list): ``` Cabal-3.4.1.0 Euterpea-2.0.7 GLURaw-2.0.0.5 GLUT-2.7.0.16 HCodecs-0.5.2 HSoM-1.0.0 ObjectName-1.1.0.2 OpenGL-3.0.3.0 OpenGLRaw-3.3.4.1 PortMidi-0.2.0.0 QuickCheck-2.14.2 StateVar-1.2.2 Stream-0.4.7.2 UISF-0.4.0.0 array-0.5.4.0 arrows-0.4.4.2 base-4.15.1.0 binary-0.8.8.0 bytestring-0.10.12.1 containers-0.6.4.1 deepseq-1.4.5.0 directory-1.3.6.2 exceptions-0.10.4 fail-4.9.0.0 filepath-1.4.2.1 fixed-0.3 ghc-9.0.2 ghc-bignum-1.1 ghc-boot-9.0.2 ghc-boot-th-9.0.2 ghc-compact-0.1.0.0 ghc-heap-9.0.2 ghc-prim-0.7.0 ghci-9.0.2 half-0.3.1 haskeline-0.8.2 heap-1.0.4 hpc-0.6.1.0 integer-gmp-1.1 lazysmallcheck-0.6 libiserv-9.0.2 markov-chain-0.0.3.4 mtl-2.2.2 parsec-3.1.14.0 pretty-1.1.3.6 process-1.6.13.2 pure-fft-0.2.0 random-1.2.1 rts-1.0.2 semigroups-0.19.2 splitmix-0.1.0.4 stm-2.5.0.0 template-haskell-2.17.0.0 terminfo-0.4.1.5 text-1.2.5.0 time-1.9.3 transformers-0.5.6.2 unix-2.7.2.2 xhtml-3000.2.2.1 ```
System information ``` System: Kernel: 6.8.5-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.2.1 clocksource: tsc avail: hpet,acpi_pm parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen root=UUID=543c6354-5d39-4703-bb64-407600dc772d rw rootflags=subvol=@ quiet rd.udev.log_priority=3 vt.global_cursor_default=0 systemd.unified_cgroup_hierarchy=1 resume=UUID=65b1555e-e8e7-41cb-84a2-63265cdbd7db loglevel=3 threadirqs sysrq_always_enabled=1 ibt=off Desktop: KDE Plasma v: 6.0.3 tk: Qt v: N/A info: frameworks v: 6.1.0 wm: kwin_x11 with: krunner vt: 2 dm: SDDM Distro: Garuda base: Arch Linux Machine: Type: Desktop System: ASUS product: N/A v: N/A serial: Mobo: ASUSTeK model: TUF GAMING B550M-PLUS (WI-FI) v: Rev X.0x serial: part-nu: SKU uuid: UEFI: American Megatrends v: 2423 date: 08/10/2021 Battery: Device-1: hidpp_battery_0 model: Logitech MX Keys Wireless Keyboard serial: charge: 55% (should be ignored) rechargeable: yes status: discharging Device-2: hidpp_battery_1 model: Logitech Wireless Mouse M325 serial: charge: 55% (should be ignored) rechargeable: yes status: discharging CPU: Info: model: AMD Ryzen 5 5600X bits: 64 type: MT MCP arch: Zen 3+ gen: 4 level: v3 note: check built: 2022 process: TSMC n6 (7nm) family: 0x19 (25) model-id: 0x21 (33) stepping: 0 microcode: 0xA201016 Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache: L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB desc: 6x512 KiB L3: 32 MiB desc: 1x32 MiB Speed (MHz): avg: 3657 high: 3700 min/max: 2200/4650 boost: enabled scaling: driver: acpi-cpufreq governor: performance cores: 1: 3700 2: 3700 3: 3597 4: 3700 5: 3600 6: 3599 7: 3590 8: 3700 9: 3700 10: 3700 11: 3598 12: 3700 bogomips: 88800 Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm Vulnerabilities: Type: gather_data_sampling status: Not affected Type: itlb_multihit status: Not affected Type: l1tf status: Not affected Type: mds status: Not affected Type: meltdown status: Not affected Type: mmio_stale_data status: Not affected Type: reg_file_data_sampling status: Not affected Type: retbleed status: Not affected Type: spec_rstack_overflow status: Vulnerable: Safe RET, no microcode Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; IBRS_FW; STIBP: always-on; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not affected Type: srbds status: Not affected Type: tsx_async_abort status: Not affected Graphics: Device-1: NVIDIA GP108 [GeForce GT 1030] vendor: ASUSTeK driver: nvidia v: 550.67 alternate: nouveau,nvidia_drm non-free: 545.xx+ status: current (as of 2024-04; EOL~2026-12-xx) arch: Pascal code: GP10x process: TSMC 16nm built: 2016-2021 pcie: gen: 3 speed: 8 GT/s lanes: 4 bus-ID: 07:00.0 chip-ID: 10de:1d01 class-ID: 0300 Device-2: Logitech Webcam C270 driver: snd-usb-audio,uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-2:2 chip-ID: 046d:0825 class-ID: 0102 serial: Display: x11 server: X.Org v: 21.1.13 with: Xwayland v: 23.2.6 compositor: kwin_x11 driver: X: loaded: nvidia gpu: nvidia display-ID: :0 screens: 1 Screen-1: 0 s-res: 1920x1080 s-dpi: 81 s-size: 602x343mm (23.70x13.50") s-diag: 693mm (27.28") Monitor-1: Unknown-1 mapped: HDMI-0 res: 1920x1080 hz: 60 dpi: 82 size: 598x336mm (23.54x13.23") modes: 1024x768 API: EGL v: 1.5 hw: drv: nvidia platforms: device: 0 drv: nvidia device: 2 drv: swrast gbm: drv: kms_swrast surfaceless: drv: nvidia x11: drv: nvidia inactive: wayland,device-1 API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 550.67 glx-v: 1.4 direct-render: yes renderer: NVIDIA GeForce GT 1030/PCIe/SSE2 memory: 1.95 GiB API: Vulkan v: 1.3.279 layers: 1 device: 0 type: discrete-gpu name: NVIDIA GeForce GT 1030 driver: nvidia v: 550.67 device-ID: 10de:1d01 surfaces: xcb,xlib Audio: Device-1: NVIDIA GP108 High Definition Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 4 bus-ID: 07:00.1 chip-ID: 10de:0fb8 class-ID: 0403 Device-2: AMD Starship/Matisse HD Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 09:00.4 chip-ID: 1022:1487 class-ID: 0403 Device-3: Logitech Webcam C270 driver: snd-usb-audio,uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-2:2 chip-ID: 046d:0825 class-ID: 0102 serial: Device-4: Yamaha Steinberg UR22 driver: snd-usb-audio type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-4:3 chip-ID: 0499:1509 class-ID: ff00 API: ALSA v: k6.8.5-zen1-1-zen status: kernel-api with: aoss type: oss-emulator tools: alsactl,alsamixer,amixer Server-1: PipeWire v: 1.0.4 status: active with: 1: pipewire-pulse status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl Network: Device-1: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1 bus-ID: 05:00.0 chip-ID: 8086:2723 class-ID: 0280 IF: wlp5s0 state: up mac: Device-2: Realtek RTL8125 2.5GbE vendor: ASUSTeK driver: r8169 v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1 port: f000 bus-ID: 06:00.0 chip-ID: 10ec:8125 class-ID: 0200 IF: enp6s0 state: down mac: Info: services: NetworkManager, smbd, systemd-timesyncd, wpa_supplicant Bluetooth: Device-1: Intel AX200 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-5:2 chip-ID: 8087:0029 class-ID: e001 Report: btmgmt ID: hci0 rfk-id: 1 state: up address: bt-v: 5.2 lmp-v: 11 status: discoverable: no pairing: no class-ID: 6c0104 Drives: Local Storage: total: 1.14 TiB used: 921.34 GiB (79.1%) SMART Message: Required tool smartctl not installed. Check --recommends ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Seagate model: WDS250G3X0C-00SJG0 size: 232.89 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: fw-rev: 111110WD temp: 45.9 C scheme: GPT ID-2: /dev/sda maj-min: 8:0 vendor: Seagate model: ST1000LM035-1RK172 size: 931.51 GiB block-size: physical: 4096 B logical: 512 B type: USB rev: 3.0 spd: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 tech: HDD rpm: 5400 serial: fw-rev: 1053 scheme: MBR Partition: ID-1: / raw-size: 228.59 GiB size: 228.59 GiB (100.00%) used: 112.4 GiB (49.2%) fs: btrfs dev: /dev/nvme0n1p3 maj-min: 259:3 ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%) used: 580 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1 ID-3: /home raw-size: 228.59 GiB size: 228.59 GiB (100.00%) used: 112.4 GiB (49.2%) fs: btrfs dev: /dev/nvme0n1p3 maj-min: 259:3 ID-4: /var/log raw-size: 228.59 GiB size: 228.59 GiB (100.00%) used: 112.4 GiB (49.2%) fs: btrfs dev: /dev/nvme0n1p3 maj-min: 259:3 ID-5: /var/tmp raw-size: 228.59 GiB size: 228.59 GiB (100.00%) used: 112.4 GiB (49.2%) fs: btrfs dev: /dev/nvme0n1p3 maj-min: 259:3 Swap: Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no ID-1: swap-1 type: zram size: 15.53 GiB used: 6.2 MiB (0.0%) priority: 100 comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 12 dev: /dev/zram0 ID-2: swap-2 type: partition size: 4 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/nvme0n1p2 maj-min: 259:2 Sensors: System Temperatures: cpu: 47.0 C mobo: 42.0 C gpu: nvidia temp: 46 C Fan Speeds (rpm): fan-1: 1183 fan-2: 1841 fan-3: 1230 fan-7: 0 Info: Memory: total: 16 GiB available: 15.53 GiB used: 5 GiB (32.2%) Processes: 402 Power: uptime: 6h 20m states: freeze,mem,disk suspend: deep avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot, suspend, test_resume image: 6.17 GiB services: org_kde_powerdevil,upowerd Init: systemd v: 255 default: graphical tool: systemctl Packages: 2068 pm: nix-default pkgs: 0 pm: nix-sys pkgs: 0 pm: nix-usr pkgs: 12 libs: 3 pm: pacman pkgs: 2056 libs: 472 tools: aura,paru Compilers: clang: 17.0.6 gcc: 13.2.1 Shell: fish v: 3.7.1 running-in: yakuake inxi: 3.3.34 ```
donya commented 4 months ago

This issue is likely quite a ways outside the scope of HSoM's code base. It may even be outside the Haskell portion of the dependencies. A quick search on parts of the error turned up some things related to Linux versions having issues with freeglut, which is used down the dependency chain of the UISF library HSoM uses - but I don't think there's anything in UISF that would be the culprit here. It may be worth reporting the details of this error on the Haskell GLUT repo citing UISF via Euterpea/HSoM as the use case.

It is unclear to me if this is NixOS (sorry if I missed the obvious). If it is, that OS pretty commonly has issues with Euterpea and/or HSoM.

ninioArtillero commented 4 months ago

Thanks for pointing the way. I'll take the issue further and hopefully come back with a fix or a clearer description of the bug.

I'm using nix inside Arch Linux to have a fixed working environment with Euterpea. You can check out this script I've been using:

https://gist.github.com/ninioArtillero/ac5aa10125135e10809098ba0b079dc4

By the way, I didn't try to run the example from my system's ghc. So I will.

ninioArtillero commented 4 months ago

The example worked just fine under system ghc-9.2.8 (ghcup's), with both Euterpea and HSoM libraries installed from Hackage with --lib and --allow-newer flags. So this is indeed Nix related.