错误记录-2023-4

nvidia driver unboundlocalerror local variable 'version' referenced before assignment

@MS-7B98:~$ sudo ubuntu-drivers autoinstall Traceback (most recent call last): File “/usr/bin/ubuntu-drivers”, line 513, in 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

办法: 这个报错看起来似乎与 Ubuntu 驱动管理器的 Nvidia 驱动程序检测有关。根据报错信息,似乎在检测 Nvidia 驱动版本时发生了错误。建议您尝试以下步骤来解决这个问题:

首先,您可以尝试更新系统并升级所有软件包到最新版本。您可以使用以下命令执行此操作: sql Copy code sudo apt update && sudo apt upgrade 如果更新软件包不起作用,请尝试更新 Nvidia 驱动程序到最新版本。您可以使用以下命令执行此操作: Copy code sudo apt install nvidia-driver 如果更新 Nvidia 驱动程序不起作用,请尝试使用 ubuntu-drivers 命令手动安装适合您的 Nvidia 驱动程序版本。您可以使用以下命令列出可用的驱动程序: Copy code ubuntu-drivers list 然后,您可以使用以下命令安装适合您的 Nvidia 驱动程序版本:

Copy code sudo ubuntu-drivers autoinstall 如果仍然遇到问题,请尝试在 Ubuntu 官方论坛或社区中寻求帮助。

@MS-7B98:~$ sudo usb_modeswitch -KW -v 0bda -p 1a2b Take all parameters from the command line

  • usb_modeswitch: handle USB devices with multiple modes
  • Version 2.6.1 © Josua Dietze 2017
  • Based on libusb1/libusbx

! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor= 0x0bda DefaultProduct= 0x1a2b

StandardEject=1

Look for default devices … found USB ID 1d6b:0003 found USB ID 1d6b:0002 found USB ID 0781:5567 found USB ID 174c:235c found USB ID 1d6b:0003 found USB ID 093a:2510 found USB ID 0bda:1a2b vendor ID matched product ID matched found USB ID 17ef:6018 found USB ID 1d6b:0002 found USB ID 1d6b:0003 found USB ID 1d6b:0002 Found devices in default mode (1) Access device 005 on bus 001 Get the current device configuration … Current configuration number is 1 Use interface number 0 with class 8 Use endpoints 0x0b (out) and 0x8a (in)

USB description data (for identification)

Manufacturer: realtek product: disk serial no.: not provided.

Sending standard EJECT sequence Looking for active drivers … Set up interface 0 Use endpoint 0x0b for message sending … Trying to send message 1 to endpoint 0x0b … Sending the message returned error -7. Try to continue Read the response to message 1 (CSW) … Response reading failed (error -7) Device is gone, skip any further commands -> Run lsusb to note any changes. Bye!

nvidia driver unboundlocalerror local variable 'version' referenced before assignment

请填写红包祝福语或标题

nvidia driver unboundlocalerror local variable 'version' referenced before assignment

谢谢鼓励~我将继续创作优质博文

nvidia driver unboundlocalerror local variable 'version' referenced before assignment

您的余额不足,请更换扫码支付或 充值

nvidia driver unboundlocalerror local variable 'version' referenced before assignment

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。 2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

nvidia driver unboundlocalerror local variable 'version' referenced before assignment

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Errors when trying ubuntu-drivers autoinstall ubuntu 22.04

I installed Ubuntu 22.04 LTS on an Acer Nitro 5 AN515-55 with Nvidia Geoforce GTX which worked fine for about 3 months. Yesterday I shut it off; when I powered up again, the second monitor is not recognized. Tried several ideas with no luck, so finally reinstalled the whole thing... After a few tries, I finally got the second display to be recognized by using the X.org driver.

Now when I try to move the display side in settings-Displays, after clicking on Apply, my laptop goes to the start login screen and nothing is changed. I tried to run sudo ubuntu-drivers autoinstall and see:

I installed from the same live USB stick I did originally AND updated the system a couple times (With Software updater and with console). Acer's support have not been helpful.

  • multiple-monitors

K7AAY's user avatar

  • The problem is the package name with "-open" (either the 515-open or 520-open). The packages without the "-open" should still work without editing a system script to make the "-open" versions work. –  ubfan1 Commented Nov 14, 2022 at 19:31

Here's a temporary fix until it's officially decided: (taken from here https://forums.developer.nvidia.com/t/ubuntu-22-04-1-nvidia-driver-open-kernel-nvidia-driver-515-open-issue/231356 )

at line 835 change

App20's user avatar

You must log in to answer this question.

  • The Overflow Blog
  • Legal advice from an AI is illegal
  • Featured on Meta
  • The December 2024 Community Asks Sprint has been moved to March 2025 (and...
  • Stack Overflow Jobs is expanding to more countries

Hot Network Questions

  • What would it take for an AI to have beliefs?
  • Does a denser feedback function in LFSRs improve security for known feedback LFSR stream ciphers?
  • A sad-looking tree with a secret
  • Sci-fi / futurism supplement from a UK newspaper in 1999/2000
  • Finding corners where multiple polygons meet in QGIS
  • How to buy residential realty, without conveying purchase money to any lawyer’s trust account?
  • Will a body deform if there is very huge force acting on it in a specific direction?
  • If I sacrifice a Forsaken Miner to the card Eaten Alive do I get the miner back?
  • is Romans 14:5 a command or more along the lines of a "concession"?
  • Do I need a MOV in front of AC/DC supply
  • Why does Cambridge dictionary use present unreal conditional to describe past real conditional?
  • Why are straight-in approaches dangerous at uncontrolled airfields?
  • Why don't protons and neutrons get ejected by the photoelectric effect?
  • World split into pocket dimensions; protagonist escapes from windowless room, later lives in abandoned city and raids a supermarket
  • Is "the book" mentioned in Daniel 12:1 the same as the Book of Life in Revelation?
  • How much is this coin in "Mad Men" worth?
  • Is it true that only prosecutors can 'cut a deal' with criminals?
  • Notepad++ find and replace string
  • Checking cross-database synonym validity
  • Sci-fi novel called the Ice Palace from the 80s
  • Applying for NSF grant from Europe
  • Why no "full-stack" SQL-like language?
  • Magnetic door catch for interior door is loose inside of the door jamb and the screw is spinning freely when tightened. How do I troubleshoot this?
  • Does the jazz term 'head' refer to both instrumental and vocal themes?

nvidia driver unboundlocalerror local variable 'version' referenced before assignment

AlastairG avatar

sudo ubuntu-drivers autoinstall: UnboundLocalError: local variable 'version' referenced before assignment

I recently re-installed my wife's XUbuntu 22 machine. Previously we used the NVidia driver package from the NVidia website, especially after a bit of a f&%k up last year where the official repo version broke due to broken dependencies.

This time I thought I would give the repo version another go, especially since my wife is scared of re-installing the graphics drivers after a kernel update - and it is a real nuisance.

As per the guide I found online I ran the command sudo ubuntu-drivers autoinstall . The result was:

I manually installed the 515 drivers repo package, but it does not seem to include the 32 bit drivers, and now Steam, among other things, doesn't work.

Mohamed Elgazar avatar

The reason for the error is the bug in the installer. The more detailed explanation could be found on nvidia forum . If you want to use command line for driver installation, you could run such a command to get possible driver versions:

Then you can manually choose the version you want from the list, but use it without -open at the end (this is the reason for the error). So, instead of nvidia-driver-515-open use nvidia-driver-515 and run:

Olli avatar

Had the same issue, fixed it by installing the driver from "Software & Updates" -> "Additional Drivers" & then the newest Nvidia Driver. After that running sudo ubuntu-driver autoinstall gave me "All the available drivers are already installed."

nvidia driver unboundlocalerror local variable 'version' referenced before assignment

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.

UnboundLocalError: local variable 'bpmp_dtb' referenced before assignment

Dear Forum,

I followed the instruction in Jetson Orin NX and Nano Series — Jetson Linux Developer Guide documentation to update the pinmux for my custom carrier board with Jetson Orin NX 8GB on top:

<SDK_install>/JetPack_5.1.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-l4es-orin-nx-mb1-bct–padvoltage-default-camera-nx.dtsi <SDK_install>/JetPack_5.1.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-l4es-orin-nx-mb1-bct-pinmux-camera-nx.dtsi <SDK_install>/JetPack_5.1.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/bootloader/tegra234-l4es-orin-nx-mb1-bct-gpio-default-camera-nx.dtsi

<SDK_install>/JetPack_5.1.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/bootloader//tegra234-l4es-orin-nx-mb2-bct-misc-p3767-0001-camera-nx.dts :

And : <SDK_install>/JetPack_5.1.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/l4es-camera-nx+p3767.conf

However, while running the flash command : sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 l4es-camera-nx+p3767 internal

I got following error :

If I replace

then the flashing goes smoothly but of course my changes will not be applied.

Could you help to identify what is the missing configuration, please ?

Thanks and best regards, Khang

Dump the full log, please. Mostly that’s because some files contain spaces in their file names, so argument parsing fails.

Hi @DaveYYY ,

It turns out that I put the MB2_BCT file (tegra234-l4es-orin-nx-mb2-bct-misc-p3767-0001-camera-nx.dts) in a wrong location : <SDK_install>/JetPack_5.1.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/ bootloader /tegra234-l4es-orin-nx-mb2-bct-misc-p3767-0001-camera-nx.dts , it should be found in <SDK_install>/JetPack_5.1.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/ bootloader / t186ref / BCT /tegra234-l4es-orin-nx-mb2-bct-misc-p3767-0001-camera-nx.dts

Best Regards, Khang

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications You must be signed in to change notification settings

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

My pc hang if choose nvidia (open kernel) metapackage from nvidia-515-open (propietery,tested) #394

@fhazal

fhazal commented Oct 20, 2022 • edited Loading

@fhazal

vars1ty commented Oct 20, 2022

Sorry, something went wrong.

@aaronp24

aaronp24 commented Oct 20, 2022

@awilkins

awilkins commented Oct 21, 2022

  • 👍 1 reaction

fhazal commented Oct 21, 2022 • edited Loading

@blackknight36

blackknight36 commented Oct 24, 2022

No branches or pull requests

@aaronp24

IMAGES

  1. UnboundLocalError: Local Variable Referenced Before Assignment

    nvidia driver unboundlocalerror local variable 'version' referenced before assignment

  2. UnboundLocalError: local variable 'rxs_gpu' referenced before

    nvidia driver unboundlocalerror local variable 'version' referenced before assignment

  3. [Bug]: UnboundLocalError: local variable 'decoded_samples' referenced

    nvidia driver unboundlocalerror local variable 'version' referenced before assignment

  4. Error unboundlocalerror local variable referenced before assignment

    nvidia driver unboundlocalerror local variable 'version' referenced before assignment

  5. UnboundLocalError: local variable 'weights_normed' referenced before

    nvidia driver unboundlocalerror local variable 'version' referenced before assignment

  6. UnboundLocalError: cannot access local variable 'X' where it is not

    nvidia driver unboundlocalerror local variable 'version' referenced before assignment

COMMENTS

  1. ubuntu-drivers "UnboundLocalError: local variable 'version' referenced

    I am running into trouble reinstalling my nvidia drivers after the latest kernel upgrade. Normally, ubuntu-drivers handles it, but not this time. ... ubuntu-drivers "UnboundLocalError: local variable 'version' referenced before assignment" when installing nvidia drivers. ... local variable 'version' referenced before assignment ...

  2. sudo ubuntu-drivers autoinstall: UnboundLocalError: local variable

    Previously we used the NVidia driver package from the NVidia website, especially after a bit of a f&%k up last year where the official repo ... in nvidia_desktop_pre_installation_hook with_nvidia_kms = version >= 470 UnboundLocalError: local variable 'version' referenced before assignment ...

  3. Ubuntu 22.04.1 Nvidia Driver (Open Kernel) Nvidia-Driver-515-Open Issue

    Restore the permissions on /usr/local, and you should have a working CUDA that is independent of the Nvidia driver in use, and works through kernel updates (which rebuild the driver). Search the askubuntu.com site for more installation answers.

  4. Dual GPU on Linux and nvidia-smi no devices were found

    At this time, I tried to install nvidia driver using ubuntu-drivers install but the system show. UnboundLocalError: local variable 'version' referenced before assignment As mentioned in here: ubuntu-drivers "UnboundLocalError: local variable 'version' referenced before assignment" when installing nvidia drivers - Ask Ubuntu I fixed the problem ...

  5. 错误记录-2023-4_nvidia driver local variable 'version' referenced -CSDN博客

    UnboundLocalError: local variable 'xxx' referenced before assignment 在函数外部已经定义了变量n,在函数内部对该变量进行运算,运行时会遇到了这样的错误:主要是因为没有让解释器清楚变量是全局变量还是局部变量。有时候在其他模块声明该变量,在本模块使用时也会 ...

  6. Nvidia-515 won't Install : r/AskUbuntu

    nvidia-driver-515 : Depends: libnvidia-gl-515 (= 515.65.01-0ubuntu1) but 515.76-0ubuntu0.22.04.1 is to be installed ... with_nvidia_kms = version >= 470 UnboundLocalError: local variable 'version' referenced before assignment comments sorted by Best Top New Controversial Q&A Add a Comment. OutrageousFlatworm38 • ...

  7. Errors when trying ubuntu-drivers autoinstall ubuntu 22.04

    After a few tries, I finally got the second display to be recognized by using the X.org driver. Now when I try to move the display side in settings-Displays, after clicking on Apply, my laptop goes to the start login screen and nothing is changed. I tried to run sudo ubuntu-drivers autoinstall and see:

  8. sudo ubuntu-drivers autoinstall: UnboundLocalError: local variable

    Previously we used the NVidia driver package from the NVidia website, especially after a bit of a f&%k up last year where the official repo version broke due to broken dependencies. This time I thought I would give the repo version another go, especially since my wife is scared of re-installing the graphics drivers after a kernel update - and ...

  9. UnboundLocalError: local variable 'bpmp_dtb' referenced before assignment

    Dear Forum, I followed the instruction in Jetson Orin NX and Nano Series — Jetson Linux Developer Guide documentation to update the pinmux for my custom carrier board with Jetson Orin NX 8GB on top: <SDK_install>/JetP…

  10. My pc hang if choose nvidia (open kernel) metapackage from nvidia-515

    NVIDIA Open GPU Kernel Modules Version nvidia (open kernel) metapackage from nvidia-515-open (propietery,tested) Does this happen with the proprietary driver (of the same version) as well? No Operating System and Version Ubuntu 22.04.1 L...