1

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.

Nmath
  • 12,333
Raphael
  • 169
  • 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 Nov 06 '22 at 22:38
  • Okay, I'll reinstall Ubuntu again and double check whether a driver was installed by default. – Raphael Nov 06 '22 at 22:39
  • 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 Nov 06 '22 at 23:19
  • 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 Nov 06 '22 at 23:30
  • 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 Nov 07 '22 at 23:54
  • 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 Nov 08 '22 at 01:21
  • Will that allow me to run FFmpeg using my GPU? – Raphael Nov 08 '22 at 10:55
  • 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 Nov 08 '22 at 21:57
  • I don't want to make something work, I want to understand why something didn't work. – Raphael Nov 08 '22 at 22:38
  • 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. – ubfan1 Nov 11 '22 at 19:59

0 Answers0