Score:1

Computer with Nvidia crashes after installing libsdl2-dev

tc flag

I just bought an Acer Nitro 5 (an515-44-r5yz) laptop with a NVIDIA GTX 1650 card. I installed Ubuntu 22.04 on it, and the first thing I did was install Nvidia's recommended driver (520-open). After rebooting, I tried to install FFmpeg, but during the installation of libsdl2-dev package, the computer goes black and never comes back again.

When rebooting, there's no graphical interface, it's a black screen where I can enter commands:

Ubuntu 22.04 LTS pc tty1
pc login:

I have tried the following to escape the black screen, with no luck:

  • reinstall libsdl2-dev
  • purge libsdl2-dev
  • reinstall nvidia driver

After days trying to trace the problem (I reinstalled Ubuntu a couple of times to find out the exact cause and whether it's deterministic), I'd like to hear some recommendation on how to avoid this error. I'm even thinking about returning the computer because I'm afraid this sort of error might randomly occur in the future when I unadvisedly try to install some seemingly innocent thing.

Running sudo ubuntu-drivers autoinstall gives

Traceback (most recent call last):
  File "/usr/bin/ubuntu-drivers", line 513, in <module>
    greet()
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/bin/ubuntu-drivers", line 432, in autoinstall
    command_install(config)
  File "/usr/bin/ubuntu-drivers", line 187, in command_install
    UbuntuDrivers.detect.nvidia_desktop_pre_installation_hook(to_install)
  File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 839, in nvidia_desktop_pre_installation_hook
    with_nvidia_kms = version >= 470
UnboundLocalError: local variable 'version' referenced before assignment

Here's what I did in another reboot: I did not install nvidia drivers, but I did prime-select nvidia (which worked!) and installed Cuda. Then, Nvidia became the default graphic card (checked on Settings > About).

However, if I try to install libsdl2-dev (which is my initial question), the computer crashes anyway! I noticed that during installation it removes cuda without asking.

I just found a project's instructions to install Cuda and libsdl2-dev and it's very straightforward, exactly what I did. That makes me think that the problem is indeed my laptop.

Raphael avatar
tc flag
There was no recommended driver installed. I followed these instructions: https://www.linuxcapable.com/how-to-install-nvidia-drivers-on-ubuntu-22-04-lts/. I wasn't able to undo it, had to reinstall Ubuntu.
Raphael avatar
tc flag
Okay, I'll reinstall Ubuntu again and double check whether a driver was installed by default.
Raphael avatar
tc flag
After a new Ubuntu installation (having the boxes checked to install 3rd party), if I go to settings > about, it shows AMD as the graphic card, not Nvidia.
Raphael avatar
tc flag
`sudo ubuntu-drivers autoinstall` has an execution error: "local variable 'version' referenced before assignment". This post (https://askubuntu.com/questions/551783/apt-get-stopped-working-because-of-dependancy-issue-libegl1-mesa) suggests to use Software & Updates, which I have also tried in the past.
Raphael avatar
tc flag
Here's what I did in this reboot: I did not install nvidia drivers, but I did `prime-select nvidia` (which worked!) and installed Cuda. Then, Nvidia became the default graphic card. However, if I try to install `libsdl2-dev` (which is my initial question), the computer crashes anyway! I noticed that during installation it removes `cuda` without asking. Why??
Raphael avatar
tc flag
Yes, I followed the instructions to compile FFmpeg for Nvidia, but it didn't work, and somebody recommended to install those dependencies. But even if I forget FFmpeg, my main concern is: how do I make sure I don't break my computer in the future by just installing a package?
Raphael avatar
tc flag
Will that allow me to run FFmpeg using my GPU?
Raphael avatar
tc flag
My question was rather simple: Computer with Nvidia crashes after installing libsdl2-dev and I want to understand why. Forget FFmpeg, I just want to know how to make sure I don't break my system by just installing a simple package.
Raphael avatar
tc flag
I don't want to make something work, I want to understand why something didn't work.
cc flag
I'd avoid the cuda deb installation methodl, and use the .run script to avoid some really undesirable dependencies (and dumb things like having an Nvidia driver update delete all the cuda files). Get Nvidia running first, the in the cuda .run, skip the Nvidia driver, and override all system locations with things like /usr/local/cuda-11.x/lib for libraries. I take control of /usr/local so I can run the .run as a user, ensuring no system location are used. See various answers on this site.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.