malcolmstill / ulubis

A Wayland compositor written in Common Lisp
BSD 3-Clause "New" or "Revised" License
239 stars 19 forks source link

Inappropriate ioctl for device #64

Closed ThomasBucaioni closed 3 years ago

ThomasBucaioni commented 3 years ago

By replacing

(trivial-backtrace:print-backtrace e)

with

(trivial-backtrace:print-backtrace e :output *standard-output* :verbose t)

in the file ulubis.lisp, it gives the following output:

> ./ulubis

Oops! Something went wrong with ulubis...we throw ourselves at your mercy! Exiting wih error:
An unhandled error condition has been signalled:
   #<ENOTTY OSICAT-POSIX::%IOCTL-WITH-ARG 25 :ENOTTY "Inappropriate ioctl for device">

Date/time: 2021-04-02-21:34!
An unhandled error condition has been signalled:
   #<ENOTTY OSICAT-POSIX::%IOCTL-WITH-ARG 25 :ENOTTY "Inappropriate ioctl for device">

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1000D880D3}>
0: (TRIVIAL-BACKTRACE:PRINT-BACKTRACE-TO-STREAM #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDOUT* {1000005563}>)
1: (TRIVIAL-BACKTRACE:PRINT-BACKTRACE #<OSICAT-POSIX:ENOTTY OSICAT-POSIX::%IOCTL-WITH-ARG 25 :ENOTTY "Inappropriate ioctl for device"> :OUTPUT #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDOUT* {1000005563}> :IF-EXISTS :APPEND :VERBOSE T)
2: ((FLET "H0" :IN ULUBIS::INITIALISE) #<OSICAT-POSIX:ENOTTY OSICAT-POSIX::%IOCTL-WITH-ARG 25 :ENOTTY "Inappropriate ioctl for device">)
3: (SB-KERNEL::%SIGNAL #<OSICAT-POSIX:ENOTTY OSICAT-POSIX::%IOCTL-WITH-ARG 25 :ENOTTY "Inappropriate ioctl for device">)
4: (ERROR #<OSICAT-POSIX:ENOTTY OSICAT-POSIX::%IOCTL-WITH-ARG 25 :ENOTTY "Inappropriate ioctl for device">)
5: (OSICAT-POSIX:POSIX-ERROR 25 NIL OSICAT-POSIX::%IOCTL-WITH-ARG)
6: (OSICAT-POSIX::SYSCALL-SIGNAL-POSIX-ERROR #<unused argument> NIL OSICAT-POSIX::%IOCTL-WITH-ARG)
7: (OSICAT-POSIX::%IOCTL-WITH-ARG 4 19268 #.(SB-SYS:INT-SAP #X7F0BAB9DFFF0))
8: ((:METHOD ULUBIS-BACKEND:INITIALISE-BACKEND (ULUBIS-BACKEND:BACKEND T T T)) #<ULUBIS-BACKEND:BACKEND {1004637983}> 1920 1080 NIL) [fast-method]
9: (ULUBIS::INITIALISE)
10: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
11: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-IMPL::START-LISP))
12: (SB-IMPL::START-LISP)

debugger invoked on a SB-KERNEL:CASE-FAILURE in thread
#<THREAD "main thread" RUNNING {1000D880D3}>:
  :SHUTTING-DOWN fell through ECASE expression.
  Wanted one of (:SUSPENDED :ACTIVE).

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit from the current thread.

(CEPL.LIFECYCLE::FROM-UNITIALIZED :SHUTTING-DOWN)
   source: (ECASE TARGET-STATE
             (:SUSPENDED (TO-SUSPENDED TARGET-STATE))
             (:ACTIVE (TO-SUSPENDED TARGET-STATE)))
0] 

Any idea what went wrong? My graphics card is an Nvidia, maybe it's related

malcolmstill commented 3 years ago

Hi @ThomasBucaioni,

You are right in that this is likely because your graphics card is nvidia. Nvidia support requires implementing functionality using a different API (EGLStreams used by nvidia, whilst intel and AMD use GBM).

That said there seems to be some movement on nvidia's part to play nicely with everyone else and also implement GBM (see for example https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-GBM-Mesa-Backend-Alt)

ThomasBucaioni commented 3 years ago

Hi Malcolm,

Thank you for the explanation. Maybe there's something I can change in the code to call a different API?