/u/abbidabbi Thank you very much for the pointers! I have simply used Bisect to find the commits that fixed the issues that I ran into, and cherry-picked them whenever I was testing an untestable range. This allowed me to finally pinpoint the exact commit that introduced the regression. I have bisected multiple different issues (to find each fix commit) and ended up compiling the kernel and rebooting many more times than I can care to admit, but thankfully it proved to be fruitful.
Thank you very much again for the pointers, sanity check and the PKGBUILD. It definitely helped to have a good starting point. Bug report here in case you are curious: https://gitlab.freedesktop.org/drm/amd/-/issues/2419
Okay, so it seems like I was doing my bisects just fine, and I was running into an actual kernel bug that prevented me from bisecting it properly. Unfortunately, the frame pacing issue seems to have been introduced somewhere in the untestable range, so I am unable to pinpoint the exact commit that introduced the issue. Hopefully knowing it was introduced in the 5.19 kernel is sufficient for the developers to find the issue. I will file a bug report soon.
One more idea came to mind: I am simply going to bisect this unbootable issue instead of the framepacing issue. I am hoping that is going to give me a clue why so many builds end up not being bootable for me. Once I sort that out, I can try tackling the framepacing issue again instead.
One more thing did catch my eye though. I am not sure if it's related, nor how to fix it, but while building I saw this in my log:
vmlinux.o: warning: objtool: sme_enable+0x82: unreachable instruction
My apologies if I caused any confusion. So the issue I am trying to track down is where the frame pacing in Cyberpunk is all over the place as can be seen via mangohud, with very erratic frametimings. This is causing a massive amount of stuttering, which is not there on the LTS kernel.
This generic AMDGPU issue is making it very hard to bisect though. If the kernel ends up being unbootable, I cannot test the framepacing issue and therefor I cannot mark a commit as good or bad, and have to skip it instead.
I was able to compile older versions of the linux package like you suggested. v5.18.16 did NOT have this issue, while v5.19.0 did have this issue. I used those as my starting point for the actual bisect. I was asked to compile the v5.18 merge commit before I could continue, and I was successfully able to do so. It ended up being good, so I marked it as such:
[jaap@Jaap-Desktop linux]$ git bisect log
git bisect start
# status: waiting for both good and bad commits
# bad: [3d7cb6b04c3f3115719235cc6866b10326de34cd] Linux 5.19
git bisect bad 3d7cb6b04c3f3115719235cc6866b10326de34cd
# status: waiting for good commit(s), bad commit known
# good: [8843bf1f0737ecea456d2bbd19d4263d49f2d110] Linux 5.18.16
git bisect good 8843bf1f0737ecea456d2bbd19d4263d49f2d110
# good: [4b0986a3613c92f4ec1bdc7f60ec66fea135991f] Linux 5.18
git bisect good 4b0986a3613c92f4ec1bdc7f60ec66fea135991f
This in turn asked me to test the following commit: c011dd537ffe47462051930413fed07dbdc80313
Unfortunately, this one exhibited the same issue as reported earlier again, so I am unable to use this build to test for the framepacing issue. I used the 5.19 config file straight from Arch's repo. I figured since it worked fine both with 5.18 and 5.19, this should be a good config file to use.
The error is always different for different untestable kernels, but this is the most recent one. This happens when GDM tries to load, and causes the entire screen to freeze. Switching TTY is also no longer possible:
Feb 16 07:30:13 Jaap-Desktop kernel: [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx_0.0.0 timeout, but soft recovered
Feb 16 07:30:23 Jaap-Desktop kernel: [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx_0.0.0 timeout, but soft recovered
I copied a larger part of the log, but that caused my replies not to be visible. However, there wasn't anything interesting in the log before or after these error messages.
Thank you very much for your thorough answer! A couple of questions if you don't mind:
Do you still have access to your PKGBUILD, and if so, would you mind sharing it? I would love to be able to start from a known good one.
I also suspected the kernel config, since I just download the latest config from Arch's repo and simply used that as a base with make olddefconfig on top. However, that's probably not ideal. How would you fetch the correct config file for each build though? Did you just do that manually?
Thank you very much for the pointer on pahole btw, it does allow the latest version to successfully build the kernel, so that's one less problem to worry about!
I tried replying to you twice, but my post keeps disappearing the moment I press post. I have to go to work now, but I will get back to you as soon as I can. Thank you very much for the pointers you have already given me so far!
This issue has become even more relevant with the release of the 7900 xtx and 7900 xt cards. They have day 1 support under the opensource mesa drivers on most major distro's....except arch. They need llvm 15 + mesa stack to work, which means that a stock arch installation will not work with the 7900 series card currently. You either need to use AMD's closed source drivers OR compile llvm + mesa from source via the AUR, since mesa is tied to the LLVM version it was compiled with. Not a great user experience unfortunately.
You will compile and install llvm-minimal-git and lib32-llvm-minimal-git as mentioned in my comment. These conflict and will replace the regular versions of these packages.
However, llvm-minimal-git and lib32-llvm-minimal-git depend on llvm-libs-minimal-git and lib32-llvm-libs-minimal-git. These will be installed alongside the regular versions of these packages.
They both run just fine for me! Just ran glxgears32 without any issues, and I also used steam previously to launch some games to test the GPU. Are you sure you completed the steps (compiling & installing llvm & mesa) for the lib32 version as well?
I finally managed get to a working LLVM/Mesa combination now! It takes quite a while unfortunately, but it's the only way I managed to get it to work. I am definitely looking forward to llvm 15 hitting the normal repos so this is no longer needed.
First, we need to compile llvm. This can be done by using your favorite AUR helper. Make sure we disable the check() function by passing on the makeflags, since tests will fail if not building in a clean chroot:
yay --mflags "--nocheck" -S llvm-minimal-git lib32-llvm-minimal-git
Optionally, if you are scared prompts for sudo will time out, you can either disable the timeout via visudo, or use the --sudoloop flag like so:
yay --mflags "--nocheck" --sudoloop -S llvm-minimal-git lib32-llvm-minimal-git
Once we have compiled and installed llvm, we can now compile mesa-git. Mesa git MUST be compiled via makepkg directly instead of using an AUR helper, since AUR helpers will ignore the environment flag and will try to compile with llvm 14:
Download a snapshot for "mesa-git" and "lib32-mesa-git" from their respective AUR pages and extract both to their own folder.
Within each folder, run the following command to compile: MESA_WHICH_LLVM=1 makepkg -si
The environment variable will tell makepkg to build mesa with llvm-minimal-git instead of llvm 14, which is needed to get it to work. Afterwards you can reboot to a working 7900 XTX :)
It works on other distros fine with stable mesa and kernel versions. The reason why it's not working on Arch, is because Arch is still on LLVM 14, while LLVM 15 seems to be required for this new architecture.
I am currently compiling llvm-git and will compile mesa-git once that's done.
I am also unable to get my 7900 XTX to work. I am able to boot into Linux, but everything is just a corrupted graphical mess. Video: https://youtu.be/1GK0OsYdnUA
What I have done:
Edited the MAKEPKG file of the linux-firmware package to build the 20221214 release. This was required to even boot in the first place. I rebuilt the initramfs afterwards.
I compiled and installed mesa-git. This would give me the same 'llvm doesn't support gfx1100 bailing out' error that other people mentioned.
Switched to the testing repo to pull in the 6.1.1 kernel and mesa 22.3.1. (I know mesa 22.3.1 just hit the regular repos, but that wasn't the case when I was playing around with my 7900 xtx yesterday. This didn't solve the graphical corruption shown in the above video either.
To rule out a hardware error, I even installed Windows-to-go on an USB stick and ran some 3DMark benchmarks. Everything was working just fine there. I am quite at a loss now, since from what I gathered from Phoronix's review, I would have expected it to be close to plug & play, but it's obviously not.
Edit: This was all done under Wayland. Xorg was a bit better in that it did not show any graphical corruption, but animations are slow and games wouldn't start or be an absolute slideshow. I am assuming I was also running under llvmpipe, but I did not realize that before.
Actually, my bad. I mixed up PWM and RPM values indeed. You have to configure the PWM values here. This value goes from 0 to 255 (8 bit value) if I am reading the documentation correctly. Where 0 is completely turned off, and 255 is max speed.
MINSTART is the minimum PWM value that is required for the fan to start spinning from completely standing still. This value will need to be configured on a per-fan basis. Some fans will require higher values before they actually start spinning than others. However, make sure that you use safe values. A fan might start spinning at a PWM value of 50 right now. But wear and tear will make the fan spin a bit worse over time, which might make it require a value of 60 later on to actually start spinning. So basically you will have to set a fan to a PWM value at 0. And then slowly increase this value. As soon as the fan starts spinning, that's the value you are interested in, but you should add a safety net to this value to make sure it will also still start spinning when the fan gets a bit older.
MINSTOP is very similar. This is the lowest PWM value at which the fan still spins. It sounds very similar to the previous value, but it's not. A fan will require a higher PWM value to actually start spinning (MINSTART), but once it's actually spinning the minimum value at which it still spins is probably lower than MINSTART. So basically you set a PWM value that makes a fan spin. Then slowly you lower the PWM value. The lowest value at which it still spins is the MINSTOP value. The wear and tear argument also holds true here. You want to pick a higher value to make sure the fan will still actually spin at that value, even when it's a bit more older.
Basically, the MINSTART and MINSTOP values are how you calibrate the fans, so the program knows what values to use when controlling the fans to make sure the fans actually start (MINSTART) and remain spinning (MINSTOP).
The speed when it's NOT spinning is 0 obviously. So when the fan starts, MINSTART will determine at which speed it will start spinning. If that value is 500, when it turns on it will starting spinning at 500 RPM. Temperature increases might make it spin even faster, but that's the MINIMUM speed at which it will START spinning (hence the name). A too low value will prevent the fan from spinning at all, hence the need for a safe value.
MINSTOP will set the lowest speed at which the fan still spins. Say this value is 300, the fan will slow down as temperatures come down all the way until 300 RPM. If it needs even less cooling, the fans will STOP instead. That's the minimum speed it will spin at before stopping, hence the name.
Hmmm, unfortunately I wasn't able to find any issues regarding fan speed on mesa's bug tracker, but the search functionality isn't the best. If you could send the link as soon as you are back on your regular machine that would be much appreciated <3
Less than optimal fan curves I would understand. But if this isn't an isolated case with my specific setup, then this could turn into a pretty big issue once the summer is here and ambient temperatures are much higher. It wouldn't surprise me if this card would need a fan speed above 1650 RPM in the summer with high ambient temperatures, so if the same thing happens, it's just going to cook itself.
I think the best way forward would be for me to write a bug report, but frankly I have no idea what the correct place would be, as I don't even know which particular thing is controlling the fan speeds of these cards under Linux.
Thanks! This fixed the crashes for me as well. Is there information on the ROCm team looking into this issue? Any open issues or something?
/u/abbidabbi Thank you very much for the pointers! I have simply used Bisect to find the commits that fixed the issues that I ran into, and cherry-picked them whenever I was testing an untestable range. This allowed me to finally pinpoint the exact commit that introduced the regression. I have bisected multiple different issues (to find each fix commit) and ended up compiling the kernel and rebooting many more times than I can care to admit, but thankfully it proved to be fruitful.
Thank you very much again for the pointers, sanity check and the PKGBUILD. It definitely helped to have a good starting point. Bug report here in case you are curious: https://gitlab.freedesktop.org/drm/amd/-/issues/2419
Okay, so it seems like I was doing my bisects just fine, and I was running into an actual kernel bug that prevented me from bisecting it properly. Unfortunately, the frame pacing issue seems to have been introduced somewhere in the untestable range, so I am unable to pinpoint the exact commit that introduced the issue. Hopefully knowing it was introduced in the 5.19 kernel is sufficient for the developers to find the issue. I will file a bug report soon.
Thank you very much again for all the pointers!
One more idea came to mind: I am simply going to bisect this unbootable issue instead of the framepacing issue. I am hoping that is going to give me a clue why so many builds end up not being bootable for me. Once I sort that out, I can try tackling the framepacing issue again instead.
One more thing did catch my eye though. I am not sure if it's related, nor how to fix it, but while building I saw this in my log:
vmlinux.o: warning: objtool: sme_enable+0x82: unreachable instructionMy apologies if I caused any confusion. So the issue I am trying to track down is where the frame pacing in Cyberpunk is all over the place as can be seen via mangohud, with very erratic frametimings. This is causing a massive amount of stuttering, which is not there on the LTS kernel.
This generic AMDGPU issue is making it very hard to bisect though. If the kernel ends up being unbootable, I cannot test the framepacing issue and therefor I cannot mark a commit as good or bad, and have to skip it instead.
I was able to compile older versions of the
linuxpackage like you suggested. v5.18.16 did NOT have this issue, while v5.19.0 did have this issue. I used those as my starting point for the actual bisect. I was asked to compile the v5.18 merge commit before I could continue, and I was successfully able to do so. It ended up being good, so I marked it as such:This in turn asked me to test the following commit:
c011dd537ffe47462051930413fed07dbdc80313Unfortunately, this one exhibited the same issue as reported earlier again, so I am unable to use this build to test for the framepacing issue. I used the 5.19 config file straight from Arch's repo. I figured since it worked fine both with 5.18 and 5.19, this should be a good config file to use.
This is the current PKGBUILD I am trying to use, and it fails to boot. I am even building in a completely empty folder to ensure it's not caused by previous builds, but that is not helping either. Do you see anything that could be wrong with it?: https://privatebin.net/?7d4a10188cda7c10#HRPwukhKE9pYPUyz4VYQv1xDRHuiKkkrESwWMC9awwfZ
The error is always different for different untestable kernels, but this is the most recent one. This happens when GDM tries to load, and causes the entire screen to freeze. Switching TTY is also no longer possible:
I copied a larger part of the log, but that caused my replies not to be visible. However, there wasn't anything interesting in the log before or after these error messages.
Thank you very much for your thorough answer! A couple of questions if you don't mind:
make olddefconfigon top. However, that's probably not ideal. How would you fetch the correct config file for each build though? Did you just do that manually?Thank you very much for the pointer on pahole btw, it does allow the latest version to successfully build the kernel, so that's one less problem to worry about!
I tried replying to you twice, but my post keeps disappearing the moment I press post. I have to go to work now, but I will get back to you as soon as I can. Thank you very much for the pointers you have already given me so far!
I do not have access to an intel machine unfortunately.
No, I got them as well. Did you use the
--mflags "--nocheck"part of the command to disable the tests that are failing?You need to reply yes to all.
As a workaround, you can compile llvm-git + mesa-git to get a working 7900 series card. Not ideal since compiling takes ages, but it's better than a non-working card: https://www.reddit.com/r/archlinux/comments/zn8fhb/comment/j0gljn1/?utm_source=share&utm_medium=web2x&context=3
This issue has become even more relevant with the release of the 7900 xtx and 7900 xt cards. They have day 1 support under the opensource mesa drivers on most major distro's....except arch. They need llvm 15 + mesa stack to work, which means that a stock arch installation will not work with the 7900 series card currently. You either need to use AMD's closed source drivers OR compile llvm + mesa from source via the AUR, since mesa is tied to the LLVM version it was compiled with. Not a great user experience unfortunately.
You will compile and install llvm-minimal-git and lib32-llvm-minimal-git as mentioned in my comment. These conflict and will replace the regular versions of these packages.
However, llvm-minimal-git and lib32-llvm-minimal-git depend on llvm-libs-minimal-git and lib32-llvm-libs-minimal-git. These will be installed alongside the regular versions of these packages.
llvm-libs and lib32-llvm-libs are not in conflict with llvm-libs-minimal-git and lib32-llvm-libs-minimal-git and will coexists.
llvm and lib32-llvm ARE in conflict with llvm-minimal-git and lib32-llvm-minimal-git and should be replaced by answering Y during the prompt.
Notice the "libs" difference for the ones that are not in conflict.
They both run just fine for me! Just ran glxgears32 without any issues, and I also used steam previously to launch some games to test the GPU. Are you sure you completed the steps (compiling & installing llvm & mesa) for the lib32 version as well?
I finally managed get to a working LLVM/Mesa combination now! It takes quite a while unfortunately, but it's the only way I managed to get it to work. I am definitely looking forward to llvm 15 hitting the normal repos so this is no longer needed.
First, we need to compile llvm. This can be done by using your favorite AUR helper. Make sure we disable the check() function by passing on the makeflags, since tests will fail if not building in a clean chroot:
Optionally, if you are scared prompts for sudo will time out, you can either disable the timeout via visudo, or use the --sudoloop flag like so:
Once we have compiled and installed llvm, we can now compile mesa-git. Mesa git MUST be compiled via makepkg directly instead of using an AUR helper, since AUR helpers will ignore the environment flag and will try to compile with llvm 14:
MESA_WHICH_LLVM=1 makepkg -siThe environment variable will tell makepkg to build mesa with llvm-minimal-git instead of llvm 14, which is needed to get it to work. Afterwards you can reboot to a working 7900 XTX :)
It works on other distros fine with stable mesa and kernel versions. The reason why it's not working on Arch, is because Arch is still on LLVM 14, while LLVM 15 seems to be required for this new architecture.
I am currently compiling llvm-git and will compile mesa-git once that's done.
I am also unable to get my 7900 XTX to work. I am able to boot into Linux, but everything is just a corrupted graphical mess. Video: https://youtu.be/1GK0OsYdnUA
What I have done:
To rule out a hardware error, I even installed Windows-to-go on an USB stick and ran some 3DMark benchmarks. Everything was working just fine there. I am quite at a loss now, since from what I gathered from Phoronix's review, I would have expected it to be close to plug & play, but it's obviously not.
Edit: This was all done under Wayland. Xorg was a bit better in that it did not show any graphical corruption, but animations are slow and games wouldn't start or be an absolute slideshow. I am assuming I was also running under llvmpipe, but I did not realize that before.
Any process can just get root permissions without any verification on your part. It's just as insecure as always being root. Don't do it :)
Actually, my bad. I mixed up PWM and RPM values indeed. You have to configure the PWM values here. This value goes from 0 to 255 (8 bit value) if I am reading the documentation correctly. Where 0 is completely turned off, and 255 is max speed.
MINSTART is the minimum PWM value that is required for the fan to start spinning from completely standing still. This value will need to be configured on a per-fan basis. Some fans will require higher values before they actually start spinning than others. However, make sure that you use safe values. A fan might start spinning at a PWM value of 50 right now. But wear and tear will make the fan spin a bit worse over time, which might make it require a value of 60 later on to actually start spinning. So basically you will have to set a fan to a PWM value at 0. And then slowly increase this value. As soon as the fan starts spinning, that's the value you are interested in, but you should add a safety net to this value to make sure it will also still start spinning when the fan gets a bit older.
MINSTOP is very similar. This is the lowest PWM value at which the fan still spins. It sounds very similar to the previous value, but it's not. A fan will require a higher PWM value to actually start spinning (MINSTART), but once it's actually spinning the minimum value at which it still spins is probably lower than MINSTART. So basically you set a PWM value that makes a fan spin. Then slowly you lower the PWM value. The lowest value at which it still spins is the MINSTOP value. The wear and tear argument also holds true here. You want to pick a higher value to make sure the fan will still actually spin at that value, even when it's a bit more older.
Basically, the MINSTART and MINSTOP values are how you calibrate the fans, so the program knows what values to use when controlling the fans to make sure the fans actually start (MINSTART) and remain spinning (MINSTOP).
The speed when it's NOT spinning is 0 obviously. So when the fan starts, MINSTART will determine at which speed it will start spinning. If that value is 500, when it turns on it will starting spinning at 500 RPM. Temperature increases might make it spin even faster, but that's the MINIMUM speed at which it will START spinning (hence the name). A too low value will prevent the fan from spinning at all, hence the need for a safe value.
MINSTOP will set the lowest speed at which the fan still spins. Say this value is 300, the fan will slow down as temperatures come down all the way until 300 RPM. If it needs even less cooling, the fans will STOP instead. That's the minimum speed it will spin at before stopping, hence the name.
Hmmm, unfortunately I wasn't able to find any issues regarding fan speed on mesa's bug tracker, but the search functionality isn't the best. If you could send the link as soon as you are back on your regular machine that would be much appreciated <3
Less than optimal fan curves I would understand. But if this isn't an isolated case with my specific setup, then this could turn into a pretty big issue once the summer is here and ambient temperatures are much higher. It wouldn't surprise me if this card would need a fan speed above 1650 RPM in the summer with high ambient temperatures, so if the same thing happens, it's just going to cook itself.
I think the best way forward would be for me to write a bug report, but frankly I have no idea what the correct place would be, as I don't even know which particular thing is controlling the fan speeds of these cards under Linux.
What happens if you accidentally do that though? And if you happen to have done that, how do you fix it again?