DisplayLink / evdi

Extensible Virtual Display Interface
MIT License
689 stars 179 forks source link

Cannot `make install` on Pop-OS kernel 6.0.3 #387

Closed jtmackoy closed 1 year ago

jtmackoy commented 1 year ago

Problem started when I lost a DisplayPort connected monitor after a kernel upgrade from v5.19.0 to v6.0.3.

Uninstalled my (then) current DisplayLink driver and attempted to install the DisplayLink Ubuntu v5.6.1 driver but encountered errors related to EVDI. Learned (I believe, as per #381) that the version packaged with this driver didn't support v6 kernels, so I attempted to clean up dkms (there was an old EVDI version whose dir hadn't been removed upon a previous upgrade) so that dkms status showed no EVDI modules installed.

Followed @dominikzogg's advice here and attempted to manually compile EVDI v1.12.0.

Confirmed that the commit I was on was the merged commit from #381:

git log -1 --pretty=%B
commit bdc258b25df4d00f222fde0e3c5003bf88ef17b5 (HEAD -> devel, origin/devel, origin/HEAD)
...
Add support for kernel 6.0 + a minor fix (#381)
...

Ran sudo make while in /usr/src/evdi-1.12.0 (which was symlinked to the git repo in /usr/src/evdi):

> sudo make
make -C /lib/modules/6.0.3-76060003-generic/build M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-6.0.3-76060003-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-11 (Ubuntu 11.2.0-19ubuntu1) 11.2.0
  You are using:           gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
  CC [M]  /usr/src/evdi/module/evdi_platform_drv.o
  CC [M]  /usr/src/evdi/module/evdi_platform_dev.o
  CC [M]  /usr/src/evdi/module/evdi_sysfs.o
  CC [M]  /usr/src/evdi/module/evdi_modeset.o
  CC [M]  /usr/src/evdi/module/evdi_connector.o
  CC [M]  /usr/src/evdi/module/evdi_encoder.o
  CC [M]  /usr/src/evdi/module/evdi_drm_drv.o
  CC [M]  /usr/src/evdi/module/evdi_fb.o
  CC [M]  /usr/src/evdi/module/evdi_gem.o
  CC [M]  /usr/src/evdi/module/evdi_painter.o
  CC [M]  /usr/src/evdi/module/evdi_params.o
  CC [M]  /usr/src/evdi/module/evdi_cursor.o
  CC [M]  /usr/src/evdi/module/evdi_debug.o
  CC [M]  /usr/src/evdi/module/evdi_i2c.o
  CC [M]  /usr/src/evdi/module/evdi_ioc32.o
  LD [M]  /usr/src/evdi/module/evdi.o
  MODPOST /usr/src/evdi/module/Module.symvers
  LD [M]  /usr/src/evdi/module/evdi.ko
  BTF [M] /usr/src/evdi/module/evdi.ko
Skipping BTF generation for /usr/src/evdi/module/evdi.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-6.0.3-76060003-generic'

Then sudo make install from the same location:

> sudo make install
make -C /lib/modules/6.0.3-76060003-generic/build M=$PWD INSTALL_MOD_PATH= INSTALL_MOD_DIR=/kernel/drivers/gpu/drm/evdi modules_install
make[1]: Entering directory '/usr/src/linux-headers-6.0.3-76060003-generic'
  INSTALL /lib/modules/6.0.3-76060003-generic//kernel/drivers/gpu/drm/evdi/evdi.ko
  SIGN    /lib/modules/6.0.3-76060003-generic//kernel/drivers/gpu/drm/evdi/evdi.ko
At main.c:167:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
sign-file: ./certs/signing_key.pem
  DEPMOD  /lib/modules/6.0.3-76060003-generic
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-headers-6.0.3-76060003-generic'
true

This appeared to be the same signing errors that were referenced in #385. Unfortunately, I don't have the luxury of hopping distros like the OP there did.

For now, I've rebooted into the v5.19.0 kernel and re-ran the DisplayLink driver installer (still v5.6.1) and the install completed successfully. Rebooted into v5.19.0 kernel again and all three monitors work.

Looking for guidance on compiling EVDI v1.12.0 successfully under kernel v6.0.3 as I believe (hope) doing so will allow the DisplayLink installer to complete its installation successfully on the same kernel version.

VGerris commented 1 year ago

check https://github.com/DisplayLink/evdi/issues/384#issuecomment-1301739514 , that worked for me on the 1.11 version too.

jtmackoy commented 1 year ago

Thanks @VGerris, but that comment from @dominikzogg is exactly what I'm trying to do. Problem is I can't make install successfully because of SSL errors that are thrown.

jtmackoy commented 1 year ago

So, I'm going to file this under noob kernel driver compilation errors.

Apparently one must have the ability to cryptographically sign (with the use of a pub/priv key set) the compiled kernel driver, else it won't complete compilation (as my error messages demonstrated). When it's compiled for distribution with the DisplayLink driver, I'm sure whomever maintains the EVDI kernel driver has a public certificate (or at least one major linux distros trust) they use for this purpose.

For the rest of us plebes, one option is to create a self-signed certificate suitable for the purpose of signing the compiled driver. This comment from a completely unrelated repo was incredibly insightful.

After booting back into the v6.0.3 kernel and then creating a self-signed cert via those instructions, I was able to:

  1. move the DisplayLink compiled version of EVDI (from the last time I installed the DisplayLink drivers while booted into the v5.19.0 kernel) from /usr/src/evdi-1.12.0 to /usr/src/backup/evdi-1.12.0
  2. (picking up on @dominikzogg's instructions here: https://github.com/DisplayLink/evdi/issues/384#issuecomment-1301739514, create the symlink (while in /usr/src) by running: sudo ln -s evdi/module evdi-1.12.0

I then ran a check to see what dkms now knew was available using the dkms status command. Almost immediately after that, my DisplayPort connected monitor sprang to life. Rebooted just to make sure everything "stuck" and it appeared to be so.

Closing this issue. Learned something new today. :+1:

lgonzalezsa commented 1 year ago

Hi @jtmackoy, trying to bring back my monitors now I am in Pop_OS kernel 6.0.6, but facing this issue when make. Were you using devel branch in git@github.com:DisplayLink/evdi.git ?

(dev_env) gonluisr@gonluisr-hp-zbook-15-g3:/usr/src/evdi-1.12.0$ sudo make
make -C /lib/modules/6.0.6-76060006-generic/build M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-6.0.6-76060006-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: x86_64-linux-gnu-gcc-11 (Ubuntu 11.2.0-19ubuntu1) 11.2.0
  You are using:           gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
  CC [M]  /usr/src/evdi/module/evdi_platform_drv.o
  CC [M]  /usr/src/evdi/module/evdi_platform_dev.o
In file included from /usr/src/evdi/module/evdi_platform_dev.c:30:
/usr/src/evdi/module/evdi_drm_drv.h:87:32: error: field ‘base’ has incomplete type
   87 |         struct drm_framebuffer base;
      |                                ^~~~
make[2]: *** [scripts/Makefile.build:249: /usr/src/evdi/module/evdi_platform_dev.o] Error 1
make[1]: *** [Makefile:1858: /usr/src/evdi/module] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.0.6-76060006-generic'
make: *** [Makefile:81: module] Error 2
jerome-diver commented 1 year ago

exactly same error on the same point after to create SSL certificate and try to compil evdi-1.12.0 from source, with the same pop_os version with the same kernel version.

dbrandenstein commented 1 year ago

exactly same error on the same point after to create SSL certificate and try to compil evdi-1.12.0 from source, with the same pop_os version with the same kernel version.

I had the same issue after first following https://github.com/DisplayLink/evdi/issues/384#issuecomment-1301739514 and then when it failed with the SSL error at the last step "sudo make install" creating the self-signed certificate as described in https://github.com/andikleen/simple-pt/issues/8#issuecomment-813438385. What fixed it for me was doing a "git reset HEAD --hard" in the cloned evdi repo to reset it to the initial state and then repeating "sudo make" and "sudo make install".

Actually, "sudo make install" still failed for me at this point, however not because of the SSL error this time, but with (issue highlighted in bold):

make -C /lib/modules/6.0.6-76060006-generic/build M=$PWD INSTALL_MOD_PATH= INSTALL_MOD_DIR=/kernel/drivers/gpu/drm/evdi modules_install make[1]: Verzeichnis „/usr/src/linux-headers-6.0.6-76060006-generic“ wird betreten INSTALL /lib/modules/6.0.6-76060006-generic//kernel/drivers/gpu/drm/evdi/evdi.ko SIGN /lib/modules/6.0.6-76060006-generic//kernel/drivers/gpu/drm/evdi/evdi.ko DEPMOD /lib/modules/6.0.6-76060006-generic Warning: modules_install: missing 'System.map' file. Skipping depmod. make[1]: Verzeichnis „/usr/src/linux-headers-6.0.6-76060006-generic“ wird verlassen true

So what I did instead was follow the instructions from https://www.displaylink.org/forum/showpost.php?p=94504&postcount=8 to manually install the module. In my case I did not have any existing evdi version (as evident by running "dkms status") and did not need to copy the files to a "evdi-1.12.0" folder because I had created already created the link previously, so I started at the step "Register the dkms module":

sudo dkms add -m evdi -v 1.12.0 sudo dkms build -m evdi -v 1.12.0 sudo dkms install -m evdi -v 1.12.0

I also immediately followed the last step, which is to run the display link installation again, although I do not know whether that was necessary. The installer then told me to restart so I did at this point and when it booted back up everything was working.

lgonzalezsa commented 1 year ago

After creating self-signed certificates and having the issue with make, my line of thinking was: Kernel 5.19.16 was working then let's revert back. dpkg --list | grep linux-image* Installed again displaylink and rebooted, then after that magically I have my monitors back.

https://support.system76.com/articles/kernelstub/

jerome-diver commented 1 year ago

@dbrandenstein come one, you are the best one ! You make my day ! It was the step to unlock the situation to just git head. Very happy, thank you so much.

@lgonzalezsa i understand your point, i think it can be good to know that for the next update that will break again evdi, but as long as it works with new update, it is good to be at the edge, not only for profit from last upgrade, but also to test and share (we are a little but usual part of a big things that we can share together).

I love open source. Thank you, now it is working (and with version 1.12.0 evdi and kernel 6.0.6.76060006-generic from Pop_OS!-22.04-nvidia-LTS I have two screen added (one Full HD and one UHD) to my Gigabyte Aero-15 FHD 144Hz laptop (GPU GTX-1660-Ti) through a docking station plugged on USB-C thunderbolt 3.

bolek2000 commented 1 year ago

Big thanks to all of you sharing your solutions, helped me a lot too. For completeness I wanted to share as well...First I uninstalled with displaylink-installer uninstall then I ran all the steps mentioned here, but for my docking station (i-tec via USC-C) it seems to be crucial that I also run the sudo ./displaylink-driver-5.6.1-59.184.run after all the other steps and that seems to put some udev rules etc. in place without which it didn't work for me. This was pointed out here: https://www.displaylink.org/forum/showpost.php?p=94504&postcount=8 PopOS 22.04 Kernel 6.0.6