Skip to content

Instantly share code, notes, and snippets.

@plembo
Last active February 18, 2025 15:45
Show Gist options
  • Save plembo/0d048f127fcf46fafd6729ff35452d19 to your computer and use it in GitHub Desktop.
Save plembo/0d048f127fcf46fafd6729ff35452d19 to your computer and use it in GitHub Desktop.
phantom unknown display in ubuntu with nvidia

Workaround for "Phantom Unknown Display"

UPDATE: According to the Ubuntu bug history cited below, this problem was fixed with an update of ubuntu-drivers-common on September 10, 2024. After removing the workaround udev rule and verifying the package was updated on my system, I confirmed that the troublesome behavior didn't return for me. That said, at least one other person has advised that they're still experiencing it even with the workaround.

Got bit by Ubuntu Linux bug #2060268 on the latest kernel update for 22.04 LTS (6.8.0-40-generic).

As in the bug report (and many forum posts across the Internet) this appears to be due to a collision between the simpledrm kernel module and NVIDIA drivers. The symptom is a nonexistent display device being assigned as card0. The practical effect is to throw off any previous configuration of the display system (display 1 becoming display 2, display 2 becoming display 3). As a result, customizations like joined or mirrored displays break and need to be reconfigured.

This bug was filed in April 2024 for a 24.04 desktop running the NVIDIA 545 drivers. Since then it has also been reported in 22.04 (my current system, where I am running the NVIDIA 535 drivers with Xorg).

Many solutions have been proposed on the Internet involving passing special flags to the kernel. These have sometimes proved disruptive to system operations (like booting).

A fix was released by the Ubuntu dev team for 24.10 in August 2024. Fixes for 24.04 and 22.04 are marked as "Committed - In Progress".

The fix implemented by the Ubuntu team was this addition to udev rule 71-u-d-c-gpu-detection.rules:

ACTION=="add", SUBSYSTEM=="module", KERNEL=="nvidia_drm", TEST=="/sys/devices/platform/simple-framebuffer.0/drm/card0", RUN+="/bin/rm /dev/dri/card0"

Making this change manually to /usr/lib/udev/rules.d/71-u-d-c-gpu-detection.rules in my system fixed the problem for me.

As always, YMMV.

@nyarian
Copy link

nyarian commented Sep 2, 2024

thank you, this did fix it for me

@dade-hms
Copy link

Phantom screen appeared today here, this trick does not seem to work, even after a reboot.

@plembo
Copy link
Author

plembo commented Dec 17, 2024

I'm still good here, even after recently removing the workaround udev rule. Bug history shows that they pushed a fix through ubuntu-drivers-common 1:0.9.6.2~0.22.04.7 on or around September 10, 2024. Note that I'm running ubuntu-drivers-common 1:0.9.6.2-0.22.04.8 with the 6.8.0-49-generic kernel, but still on the old nvidia-535.183.01 driver (because that's what the system recommends for me) on X11 (because Wayland is still a train wreck for what I need to work).

@golubenkonick
Copy link

golubenkonick commented Jan 16, 2025

I have the same bug with Intel Arc Graphics in Ubuntu 24.04 desktop
I created the file /etc/udev/rules.d/71-my-custom-gpu.rules
and added the following rule to the file:

ACTION=="add", SUBSYSTEM=="module", KERNEL=="i915", TEST=="/sys/devices/platform/simple-framebuffer.0/drm/card0", RUN+="/bin/rm -f /dev/dri/card0"

This fixed the problem.

@ShadowSeick
Copy link

@golubenkonick Thank you! I was struggling with this for two months. Can you explain how this works? I am really new at this. Thank you anyhow!

@plembo
Copy link
Author

plembo commented Feb 18, 2025

So what is does is set up a system rule that deletes the "phantom" device before it has a chance to confuse your display manager. From what I've read, these devices are created by SimpleDRM during boot and are supposed to give way to the appropriate driver for your hardware. An update pushed last September was supposed to have fixed this (it did for me, I no longer need that udev rule -- but as I note above, I'm still on X11 with a relatively old version of the NVIDIA driver).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment