Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laptop won't start after Python 3.13 update #586

Closed
username227 opened this issue Dec 23, 2024 · 39 comments
Closed

Laptop won't start after Python 3.13 update #586

username227 opened this issue Dec 23, 2024 · 39 comments

Comments

@username227
Copy link

Describe the bug
Following the release of Python 3.13, my laptop no longer starts up properly if Optimus Manager is installed. After past updates, uninstalling and rebuilding optimus-manager against the new python has been successful in solving the problem, but i was not able to do that this time.

System info
I am running Arch with Cinnamon on Xorg. I am using LightDM as DM. I am using the latest git version of optimus-manager, installed through the AUR (not a repo which might not be built on the previous python version).

Logs
I can't get the laptop to start properly if installed so can't run command from console; however, attaching some saved logs.
switch-20241223T081352.log
daemon-20241223T081352.log

@username227
Copy link
Author

OK I have additional context.
The problem is the functioning of the nvidia drivers when optimus-manager is installed.
Without optimus manager, nvidia-smi command gives the expected output.
When optimus manager is installed and the default startup is set to integrated, then the computer will boot properly. However, switching to nvidia drivers will not work. However, if it is set to auto and plugged in, or if it is set to nvidia, it will not start up properly.
It seems like when optimus-manager is installed, the nvidia drivers will not start up properly causing a black screen instead of LightDM startup screen.

@vitreo12
Copy link

Same here, it seems to have issues with package metadata since the python upgrade. This is the output of optimus-manager --status:

20241224_092524.jpg

@es20490446e
Copy link
Collaborator

es20490446e commented Dec 24, 2024

If your system is unable to boot into a console, you can do so from an external live USB, then chroot into your system with:

lsblk
mount /dev/[ROOT-PARTITION] /mnt
arch-chroot /mnt

Check if the paths for optimus-manager-git match a valid python version with:

pacman --sync --print-format "%v" python
pacman --files --list optimus-manager-git

@username227
Copy link
Author

OK so, the first command shows 3.13.1-1 as the python version
the second command says that the package is not found. However, if I do "pacman -Ql optimus-manager-git" it confirms that the paths for the installation was python3.13, so I think everything is good there. If I do "optimus-manager status" then i do not get the errors listed above by the other person.

PLEASE help even though you closed the issue prematurely. thanks so much!

@es20490446e
Copy link
Collaborator

Don't worry about closing. It's just a mean of saying that I need further info to take action from my side, but I still attend any reply.

What package manager are you using for installing packages from the AUR?

@username227
Copy link
Author

Don't worry about closing. It's just a mean of saying that I need further info to take action from my side, but I still attend any reply.

What package manager are you using for installing packages from the AUR?

OK fair enough.

Good question, but I don't think it's the AUR helper. I've tried pamac, paru, and i've tried building manually in a clean chroot, all with the same results.

@es20490446e
Copy link
Collaborator

es20490446e commented Dec 24, 2024

Lets discard options.

Try downloading, extracting and installing the following package that works on my system. So we can know for sure it isn't a packaging issue:

optimus-manager-git-1:r771.6b3d3e5.python3.13-1-any.pkg.zip

Also let me know info about your system:

inxi -SMGr
pacman --query --info NVIDIA-MODULE
cat /etc/optimus-manager/optimus-manager.conf

@username227
Copy link
Author

username227 commented Dec 24, 2024

Your package gave the same result.
I am attaching a text file with the output from the first two.
I uninstalled optimus-manager to start up the laptop properly; however, when it was installed, the optimus-manager.conf file simply pointed to the one in /usr/share, if I remember correctly.

output.txt

@es20490446e
Copy link
Collaborator

Have you tried using 'nvidia-open-dkms' instead?

It is the recommended driver for your GPU (which for instance is the same as mine).

@username227
Copy link
Author

username227 commented Dec 24, 2024

Just tried without any change . :-(

@vitreo12
Copy link

Uninstalling optimus-manager and re-installing it worked for me. It now correctly installed the 3.13.1 version

@vitreo12
Copy link

But pacman --files --list optimus-manager-git still returns error: package 'optimus-manager-git' was not found

@es20490446e
Copy link
Collaborator

@username227 Does the solution proposed by vitreo12 work for you, rebuilding the package?

@vitreo12 Sorry, that command doesn't work for AUR packages. But pacman --query --list optimus-manager-git.

@username227
Copy link
Author

@es20490446e no, that is the first thing I tried, obviously. I have experience from past python updates that broke my laptop to know that optimus-manager needs to be rebuild. I am currently having it uninstalled completely unless i'm troubleshooting so that I can use my laptop. I can also confirm that when it is installed, the otpimus-manager files appear in the python 3.13 folder, so that's not the issue.

@es20490446e
Copy link
Collaborator

Since the Nvidia driver has also been updated recently, I would try the last stable version instead. Just to discard it.

Try these packages, downloadable till December 29th.

If that doesn't work, I would look into if there is some missing Python dependency.

For that let us know the output of the following command, and I will tell you some potential candidates to try:

pacman --query --search "python" | grep "/python-" | cut --delimiter='/' --fields=2

@username227
Copy link
Author

When I tried to manually install those two pacakges, it told me that it needed another package, lib32-nvidia-open-utils=101:550.142, which doesn't seem available anywhere so I couldn't try it.

Here is a text file with the output of the requested command.

@osmankyxyz
Copy link

I am experiencing the same problem as well. Nvidia GPU wont work with the laptop display however it will send output to the HDMI port.

@username227
Copy link
Author

username227 commented Dec 26, 2024

When I tried to manually install those two pacakges, it told me that it needed another package, lib32-nvidia-open-utils=101:550.142, which doesn't seem available anywhere so I couldn't try it.

Here is a text file with the output of the requested command.

Additionally, I checked the lightdm logs, since the problem happens when lightdm greeter is supposed to start. I compared two logs, one with it installed and one without (the one with is the one with old in the filename). I noticed that this appears in the log. I don't know if it's relevant, but it might be.

[+1.00s] DEBUG: Launching process 1118: /sbin/prime-offload [+1.15s] DEBUG: Process 1118 exited with return value 0 [+1.15s] DEBUG: Seat seat0: Exit status of /sbin/prime-offload: 0

packagelist.txt

lightdm.log
lightdm.log.old.txt

@username227
Copy link
Author

@osmankyxyz is absolutely correct. It never would have occurred to me to try a regular monitor as I always just use my laptop screen on this machine. But when I plugged in a monitor into my laptop, IT DID RENDER on the regular monitor only.

When optimus-manager was NOT installed, it rendered on both monitors. Now I feel like we're getting somewhere, although it's nowhere near what I thought.

@osmankyxyz
Copy link

Yeah this behaviour makes me worried a little bit. Usually just a recompile would have fixed any optimus-manager issues. However this time it seems that optimus-manager seems to function normally by choosing the desired mode (also there are no issues with the start and logout scripts). But the nvidia driver is unwilling to send its output to laptop display and it wont even detect it in my case.

My current solution is to not use optimus-manager and just use prime-run on games until we can solve this.

@es20490446e
Copy link
Collaborator

The only different python package with my system is python-pyserial, which doesn't look like the issue.

Very likely it is related with this bug.

Try the last stable driver, with the 32-bit libraries, from here. Downloadable till December 30th.

@username227
Copy link
Author

The only different python package with my system is python-pyserial, which doesn't look like the issue.

Very likely it is related with this bug.

Try the last stable driver, with the 32-bit libraries, from here. Downloadable till December 30th.

Using the 550 drivers did not solve the issue. I agree with @osmankyxyz that i just keep it uninstalled ATM unless I am testing. I have gotten prime-run to work in the past but it's been awhile and i'm having trouble doing it now.

@es20490446e
Copy link
Collaborator

es20490446e commented Dec 28, 2024

With the system working properly, get which GPU is running the desktop:
glxinfo | grep "OpenGL renderer" > ~/gpu.txt

Get which xorg conf optimus-manager generates:

sudo [aur-install-command] optimus-manager-git
sudo systemctl start optimus-manager.service
cat /etc/X11/xorg.conf.d/10-optimus-manager.conf > ~/xorg.txt
sudo pacman --remove --recursive optimus-manager-git

And which packages are explicitly installed:

pacman --query --explicit --native | cut --delimiter=' ' --fields=1 > ~/native-packages.txt
pacman --query --explicit --foreign | cut --delimiter=' ' --fields=1 > ~/foreign-packages.txt

Attach the generated files.

@username227
Copy link
Author

gpu.txt
native-packages.txt
foreign-packages.txt

There was no file at /etc/X11/xorg.conf.d with that filename. I'm going to put one in manually from an old backup and see if it makes any difference.

@username227
Copy link
Author

gpu.txt
native-packages.txt
foreign-packages.txt

There was no file at /etc/X11/xorg.conf.d with that filename. I tried putting the one that was in there before (from a backup from when it was working prior to the python 3.13 update) but it didn't make a difference.

@es20490446e
Copy link
Collaborator

es20490446e commented Dec 29, 2024

Your system works without optimus-manager-git simply because it isn't using the Nvidia GPU to start with. Most likely the driver isn't working at all, and optimus-manager is just making explicit that the issue exists, but it is not creating it.

You want to reinstall nvidia-open to use the package from the repos (sudo pacman --sync --refresh --sysupgrade nvidia-open-dkms && sudo pacman --remove --recursive nvidia-open-utils lib32-nvidia-open-utils)

You have a package that makes the GPU to automatically power off: nvidia-prime-rtd3pm. This functionality is also implemented in optimus-manager-git, enabled by default, and may be conflicting one with the other.

Probably the package xf86-video-amdgpu is also not needed, as today most drivers are built-in the kernel and they can even conflict if you use them from a separate package.

Do you really need to have python2? (pactree --reverse python2), and do you have orphan packages? (pacman --query --deps --unrequired --quiet)

Is optimus-manager.service working just after install, but not reboot, and creating /etc/X11/xorg.conf.d/10-optimus-manager.conf? (sudo systemctl start optimus-manager.service && sleep 5 && systemctl status optimus-manager.service)

You have two kernels installed. But for a desktop using linux-zen + linux-zen-headers would be preferable. Not needed: linux, linux-headers, linux-lts, linux-lts-headers.

@username227
Copy link
Author

this package: nvidia-prime-rtd3pm was only installed after the problem was found after I uninstalled optimus-manager and was trying to get the functionality with other methods. But i have since uninstalled it and the problem still exists. And when the problem first started it wasn't installed either.

python2 is a dependency of muffin. (I use cinnamon). I use linux and linux-lts as a backup; i don't use linux-zen. I actually have a third custom kernel installed which i'm not using anymore but haven't deleted yet. I will look more at your other things tomorrow and report back.

@es20490446e
Copy link
Collaborator

es20490446e commented Dec 30, 2024

  1. Using ventoy-bin create a bootable USB. With secure boot disabled, and with the partition scheme set as MBR (Master Boot Record).
  2. Copy this ISO file (available for one week) into the USB.
  3. Boot from the USB.

The ISO has both optimus-manager-git and nvidia-open-dkms preinstalled, with a minimal KDE desktop.

This will allow us to tell for if the incompatibility is with the specific software arrangement of your system, or it is due to a broader incompatibility with your hardware or desktop environment.

If you can see the desktop, it works. If it doesn't, you will see the same issue that happens in your regular system.

@username227
Copy link
Author

Ok i'm downloading the ISO now, will try to do tomorrow. I did try something else in the meantime, though, which may shed some light on this anyway.

With nvidia-prime package not installed, I followed the archwiki instructions under Nvidia Optimus to use the nvidia card exclusively. When I did this, I got the same blank screen that I got with optimus-manager installed (alhtough I didn't actually plug the external monitor in to check that, I assume it would be the same).
This would seem to imply that it's the nvidia driver issue and not optimus-manager issue.

It does beg the question, however - if this error has been around since September, then why, when optimus manager was installed under python 3.12 and the same nvidia drivers, did it work just fine? Also, whoever posted the upstream bug report on the open drivers you mentioned - until we started troubleshooting here, I was not using the open source drivers (as you pointed out earlier) and the bug still showed up. I can accept that it's a nvidia driver bug as opposed to your program's bug (goodness knows there's no shortage of nvidia bugs) but the whole situation and the timing of the bug coming out just doesn't make sense.

@es20490446e
Copy link
Collaborator

es20490446e commented Jan 1, 2025

Oh, it makes plenty of sense actually.

I changed the default configuration of optimus-manager to use startup_mode=nvidia instead of integrated.

And your package was upgraded only when it needed to be rebuilt due to the python upgrade.

I made this change purposely, so people noticed their driver was not working at all.

@username227
Copy link
Author

That's interesting. I was wondering why it was defaulted to nvidia. But in reality, my old optimus-manager.conf file had it set to auto, to default to nvidia if it was plugged in and to integrated if unplugged. (for example, I switch to integrated if I'm going to unplug it for awhile for obvious reasons).
My old config wasn't saved, but I have a full timeshift backup from before the python upgrade. I can confirm that it was working with true nvidia drivers just a few weeks ago (and i'm considering restoring the backup to verify again).

One other question - i installed some old nvidia drivers from the AUR - going all the way back to 535, well before the issue with 550 was detected (it was 550 and newer that was the issue, right?) But it still didn't work. Why would this issue be present in the earlier drivers prior to 550?

@es20490446e
Copy link
Collaborator

As mentioned here, it seems that other people are experiencing the same issue:

It seems this also affects closed source drivers?

Maybe the older drivers used to work with an older kernel version too, but it has issues with a newer one.

If you could try the ISO I sent you, we can tell for sure.

@username227
Copy link
Author

OK so I made a bootable ISO with your ISO. I got through the loading and the options to choose the region, language, and keyboard. and then I just got a black screen.

@username227
Copy link
Author

username227 commented Jan 1, 2025

I will say this also: when I downgraded to older nvidia drivers to test, it still didn't work in pure nvidia mode. However, nvidia-smi was reading properly, and on one of the older drivers, one of the gaming apps i use did not render at all on the older driver but did when I upgraded again. Therefore, there's no question that the nvidia card is functioning; only that it's probably functioning in hybrid mode. I could potentially install optimus-manager, and before a reboot switch to hybrid by default; if it renders, then it might work (at least in the short-term) for my use case, which would be to power down the nvidia card with acpi when switching to integrated. I will report back.

EDIT: Yes, hybrid mode works fine. This is not ideal but it will do in the short-term. That way when I need to unplug my laptop I can easily switch off the nvidia card. Really hope that someone figures out the real issue soon, though.

@es20490446e
Copy link
Collaborator

Okay, so we now know that the driver will cause issues independently of your setup and desktop environment.

This isn't a bug fixable on optimus-manager, but on the Nvidia driver itself.

I would subscribe to this bug report.

Have a nice Christmas 👍

@osmankyxyz
Copy link

Thank you both of you for the effort on this issue, very much appreciated. I switched to using hybrid/integrated modes on power/battery and optimus manager works as intended.

However, nvidia mode still does not output to the laptop screen. Could this be related to some "Reverse PRIME" stuff? I have been looking around archwiki and I guess the laptop screen belongs to the iGPU and the HDMI port belongs to the Nvidia GPU.

@es20490446e
Copy link
Collaborator

Yeap. Generally one GPU is attached to the built-in screen, and the other GPU to the HDMI port.

@username227
Copy link
Author

So are you saying that it is reversing the screens when it's not supposed to? Can activating reverse prime solve reverse this, then? I'm sure it can't be that simple because someone would have thought of this already.

@es20490446e
Copy link
Collaborator

I really don't know. I maybe would try if any solution on the Arch wiki works, or just wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants