Ubuntu on iMac: Fix disappearing cursor issue

Ubuntu on iMac: Fix disappearing cursor issue

A customer gave me an old iMac from 2009, which had no further use.

Knowing that there are no more updates for this model, I installed Ubuntu 24.04 on it, and I must say that I am impressed by the ease of installing a Linux OS on Apple hardware.

Anyway, after installing it I gave it to a relative who informed me that the cursor was disappearing randomly (!), but that it could be clicked.

After some research, it seems that the problem is related to an incompatibility between the Wayland graphics driver and the integrated graphics card in these Macs.

How to solve the problem?

First of all, save each file you modify so that you can go back if necessary.

First, restart your computer once to reduce the risk of the cursor disappearing, this will make it easier to follow this procedure.

A little trick to easily continue using it if it disappears is to activate localization by pressing CTRL.
This is configurable in the mouse settings.

Open a terminal, and type the following commands to reset the mouse

xset -dpms
xset s off

Check that all packages are up to date

sudo apt update
sudo apt dist-upgrade

Install libraries for mouse support (if not installed)

sudo apt install libinput10 xcb libxcb-cursor0 libxcb-cursor-dev

Create an xorg configuration by adding the file /etc/X11/xorg.conf.d/20-nouveau-swcursor.conf, and put the configuration below:

Section "Device"
Identifier  "Device0"
Driver      "intel" # replace with your driver name
Option      "AccelMethod" "uxa"
Option      "SWCursor"    "on"
EndSection

Reconnect the mouse

sudo modprobe -r psmouse sudo modprobe psmouse

Modify GRUB configuration to improve support for ATI Radeon cards (The file is located here: /etc/default/grub

This file contains several parameters, do not delete them. The goal is to add radeon.cik_support=0 amdgpu.cik_support=1 amdgpu.dc=1 in the GRUB_CMDLINE_LINUX_DEFAULT parameter.

Example:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.cik_support=0 amdgpu.cik_support=1 amdgpu.dc=1"

Finally, regenerate the GRUB, and reboot

sudo update-grub
sudo reboot

The mouse problem should now be resolved.