ChatGPT for IT

You know all those mind numbing problems that crop up in computers? Suddenly you can’t type anything into your browser. Suddenly everytime you type the letter ‘a’ the line your were typing is deleted? You finally find the right way to express your problem, then scour the internet and find forums where someone else has posted a somewhat similar question. Usually there are some solutions posted, along with some judgement and grand standing. Most of the solutions don’t work. Half the time the thread ends unhelpfully with the original poster saying, “oh, never mind, I solved it”. ChatGPT may end this.

My son had a glitch in one of his games today. Everytime he moved his mouse, the screen would glitch. Frames would slide together. This seemed to be a graphics card problem. No doubt online forums would tell us to update our drivers. So I asked chatGPT:

The graphics on my linux machine are glitching. Whenever I look around in a game, the frames slide around and there are seams running across the graphics. Can you tell me what is wrong? Here is my dmesg output:

$ dmesg
[    2.824727] kvm: support for 'kvm_amd' disabled by bios
[    2.829302] AMD-Vi: AMD IOMMUv2 loaded and initialized
[    3.013664] MCE: In-kernel MCE decoding enabled.
[    3.015593] kvm: support for 'kvm_amd' disabled by bios
[    3.020900] snd_hda_intel 0000:26:00.1: Force to non-snoop mode
[    3.021157] snd_hda_intel 0000:28:00.3: enabling device (0000 -> 0002)
[    3.023239] hdaudio hdaudioC0D0: no AFG or MFG node found
[    3.023266] snd_hda_intel 0000:26:00.1: no codecs initialized
[    3.096024] Generic FE-GE Realtek PHY r8169-0-2200:00: attached PHY driver (mii_bus:phy_addr=r8169-0-2200:00, irq=MAC)
[    3.776131] r8169 0000:22:00.0 enp34s0: Link is Down
[    4.192918] [drm] amdgpu kernel modesetting enabled.
[    4.193082] amdgpu: Ignoring ACPI CRAT on non-APU system
[    4.193087] amdgpu: Virtual CRAT table created for CPU
[    4.193100] amdgpu: Topology: Add CPU node
[    4.193434] [drm] initializing kernel modesetting (POLARIS10 0x1002:0x67DF 0x1DA2:0xE387 0xE1).
[    4.193446] [drm] register mmio base: 0xFCE00000

The “kvm: support for ‘kvm_amd’ disabled by bios” message appearing multiple times in your dmesg output indicates that the virtualization support for your AMD CPU is disabled in the BIOS of your machine. This might not be directly related to your graphical glitches, but if you’re using any kind of virtualization that could benefit from hardware acceleration (like running a virtual machine), you may want to enable this setting.

The graphical glitches you’re encountering during gaming could be due to a variety of factors, including graphics driver issues, in-game settings, or hardware problems. Here’s a few things you can try:

Update your GPU drivers: Ensure that you’re running the latest AMD graphics drivers. If you’re using the open source AMD drivers that come with your distribution, consider updating your kernel and Mesa drivers, as these include updates for the open source AMD drivers.

Check game settings: Some games have specific graphics settings that can cause problems on certain hardware configurations. Try reducing the graphics settings in your games to see if this resolves the issue.

Check for hardware problems: If your GPU is overheating, it can cause graphical glitches. Check the temperature of your GPU while gaming to see if it’s getting too hot. You might also want to check if your GPU is properly seated in its PCIe slot, and that it’s getting enough power from your power supply.

Disable compositing: If you’re using a desktop environment that uses compositing (like KDE or GNOME), try disabling compositing to see if that improves your gaming performance. You can typically do this in the settings for your desktop environment.

Check for known issues: Some GPUs have known issues with certain types of graphics operations. Check to see if your specific GPU model has any known issues that might be causing your problem.

If none of these suggestions help, it might be a good idea to ask for help on a Linux gaming forum or subreddit, as they might be able to provide more specific advice based on your exact hardware and software configuration.

That is a lot of useful information, but I don’t want to try all of that. I need to phrase the question better and give it more complete information. But ChatGPT can help with that:

Is there any other information you would need to diagnose the problem?

The dmesg output you’ve provided is generally quite informative about system events and hardware initialization, but the problem you’re experiencing with graphics in games might not be directly visible in this output. Here are a few more pieces of information that would be useful in diagnosing the issue:

Graphics Card Information: We can see from the dmesg output that you’re using an AMD GPU (specifically, one in the POLARIS10 family), but more specific information about your graphics card could be helpful. You can obtain this using the command lspci -nnk | grep -iA2 VGA.

Driver Information: It would also be helpful to know which graphics drivers you’re using. The glxinfo command can provide this; you can get the relevant information with glxinfo | grep “OpenGL renderer”.

Game and Settings: Knowing more about the specific game you’re trying to run (including its system requirements) and any graphics-related settings you’re using in the game could help diagnose the problem.

Linux Distribution and Kernel Version: Different distributions and kernel versions may have different quirks, especially when it comes to hardware support. You can get this information with uname -a and cat /etc/release.

Xorg or Wayland: Knowing whether you’re using Xorg or Wayland for your display server protocol could be helpful. You can find this information in the output of echo $XDG_SESSION_TYPE.

Other Logs: The Xorg logs (/var/log/Xorg.0.log) and system logs (journalctl) may contain more specific error messages related to your issue.

Behavior in Other Applications: Does this problem occur only in games, or do you see graphical glitches in other types of applications as well? This information can help narrow down whether the problem is with the game, the graphics drivers, or the hardware itself.

Great, so I collect that info and paste it in:

Here is some more information:

$ lspci -nnk | grep -iA2 VGA
26:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] [1002:67df] (rev e1)
Subsystem: Sapphire Technology Limited Radeon RX 580 Pulse 4GB [1da2:e387]
Kernel driver in use: amdgpu

$ uname -a
Linux me-MS-7C02 5.19.0-41-generic #42~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 17:40:00 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"
VERSION="22.04.2 LTS (Jammy Jellyfish)"

Thank you for providing more detailed information about your system. The details confirm that you’re using the AMD RX 580 GPU, and the amdgpu driver is in use, which is the correct one for your card. You’re also running Ubuntu 22.04.2 LTS with a relatively recent kernel version.

It is interesting to note that you didn’t mention any specific error messages or odd behavior in other applications, which suggests that the problem may be specific to the games you’re trying to run.

Here’s what you could try next:

Check Game Settings and Requirements: Ensure the games you’re trying to play are compatible with your hardware and driver versions. Some games might not be optimized for Linux or have specific hardware requirements. Try adjusting the in-game graphics settings to see if certain features or settings are causing the issue.

Check for Driver Updates: Make sure your amdgpu driver is up to date. You can do this by checking the AMD website or using the package manager in Ubuntu (sudo apt update && sudo apt upgrade).

Check Xorg or Wayland: You’re running Ubuntu, which switched to Wayland as the default display server since Ubuntu 21.04. However, not all games are compatible with Wayland, and you might have to switch back to Xorg. Check if you’re running Wayland with echo $XDG_SESSION_TYPE. If it returns ‘wayland’, try switching to Xorg (you can do this from the login screen by clicking the gear icon and selecting ‘Ubuntu on Xorg’).

Check Error Logs: Check the Xorg logs (/var/log/Xorg.0.log) and system logs (journalctl) for any error messages that might relate to your issue. You can filter the journalctl logs for the driver messages with journalctl | grep amdgpu.

Check Game-Specific Logs: Some games create their own logs which might contain more specific error messages. These are usually located in the game’s directory or in a hidden folder in your home directory.

Reinstall the Game or Steam: If the issue is isolated to one or two games, try reinstalling those games or the entire Steam client. Sometimes, issues can be resolved this way.

Try a Different Linux Distribution: While this is a bit of an extreme step, different distributions can sometimes have different levels of hardware support. If you’re comfortable with trying out a different distribution, something like Pop!_OS, which is known for good gaming support, might be worth a try.

Remember to back up any important data before making significant changes to your system.

Almost there, now the description of possible problems are much more specific. I fill in a few more missing pieces of data:

I am seeing problems in other games, including browser based games. Also this problem appeared suddenly in games that worked yesterday. No settings were changed.

I do not see an /var/log/Xorg.0.log file.

The variable XDG_SESSION_TYPE stores “wayland”.

Thank you for the additional information. The fact that you are experiencing issues across multiple games, including browser-based ones, and that these issues appeared suddenly without any changes in settings, suggests that the problem may lie somewhere in the system-level graphics configuration, rather than being specific to any one game.

You mentioned that your XDG_SESSION_TYPE is Wayland. While Wayland is the default in Ubuntu 22.04, it’s possible that some games or applications might not fully support it yet.

Here’s how you can switch to Xorg to see if that resolves your issue:

Log out of your current session.

At the login screen, click the gear icon (⚙️) or similar, which is typically located near the sign-in button.

Select ‘Ubuntu on Xorg’ from the list.

Log back in and see if the problem persists.

For the missing /var/log/Xorg.0.log, this is expected if you’re running a Wayland session, as Xorg logs wouldn’t be generated under Wayland. If you switch to Xorg and still don’t see any Xorg logs, there might be an issue with your Xorg configuration.

If switching to Xorg does not resolve your problem, or if you still can’t find any Xorg logs, please let me know. We can look further into other potential causes, such as a recent system update that might have introduced an issue, or a problem with your GPU or driver.

And that solved the problem. Less than 10 minutes. No hassle digging through forums, or waiting with responses, or worries about inconveniencing others. Human IT forums and help desks may be dead. There will still be a place for highly specialized discussions of truly novel bugs. For open source projects, this will be the GitHub issues. These human discussions will likely be one of the main sources of training material for the AIs.