OSError: /lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block - raspberry-pi

I got this error in raspberry pi 64 bit OS when im importing torch
"from torch.nn.utils.rnn import pad_sequence"
So far I have used the following solution:
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1:/$LD_PRELOAD
and
source ~/.bashrc
But still getting this error

Okay , I got it solved by putting this line at the beginning of the code:
from torch.nn.utils.rnn import pad_sequence
I don't know how it worked and solved the error.

For some reason, the pre-built aarch64 wheel from PyTorch seems to encounter this error on 64-bit Raspberry Pi OS.
However, a wheel built on-device seems to work fine. If you don't want to build it yourself, the wheel built by Q-engineering on an RPi seems to work without issues. Check it out here (RPi 3B & 4, 64-bit Raspberry Pi OS).

Related

Micropython, upip installing in .frozen

I am really new to microcontrollers and IOT in general.
I am trying to use a Raspberry Pi Pico W for the first time and I am using Micropython, I am currently having problem installing libraries with upip, when I ran a command it runs well I believe, but it installs in the wrong folder (I believe...) and says something like:
>>> import upip
>>> upip.debug = True
>>> upip.install('micropython-pystone')
Installing to: .frozen/
As far as I understood when I install I want to appear Installing to: /lib/ instead of .frozen/
How do I tell Micropython where to install a package? because after if I try to run the code it tells me that it can import the modules I just installed, so I imagine it is because they get installed in the wrong folder...
I hope I was clear.
I tried removing the /lib/ folder from the Raspberry Pi Pico W and install the upip and the lib folder with it, but it didn't really work and seems like I am the only one that has this issue.
I faced the same problem, solved it by running:
upip.install('micropython-pystone', '/lib')

Raspberry Pi Pico Keeps Ejecting

I've just gotten my Raspberry Pi Pico and am trying to get it ready to accept code. I've tried dragging and dropping MicroPython from the webpage and using Thonny to handle it automatically, but when I do either, it ejects itself and nothing has loaded. I'm trying to do this from a Pi 4. Any help would be greatly appreciated.
This is how I do it (but not on a RaspPI)... hold the BootSel button on the Pico and then plug it in. A new "disk" should appear to the OS (or on the desktop). Drag the Micropython UF2 file onto the new disk - this installs Micropython on the Pico. The file gets copied, the Pico saves it to flash, and the "disk" ejects itself.
Now, in Thonny, you have to select the correct board (Pico) and the correct serial interface device (/dev/it-depends-on-your-system). The Thonny page has notes for this. At this point, with Micropython, we talk to it over the serial line, not as a disk.
HTH.
I really does sound as if you are trying to install MicroPython without downloading it and/or to run a MicroPython program without installing the MicroPython system. You first have to install the MicroPython system, download a uf2 file, and only then can you install and run a MicroPython program using Thonny.
Answering here because I had trouble getting mine to work too. In my case, I somehow got my pico into such a state that Mass Storage Device mode would randomly disconnect / eject, often before I could even drag a new UF2 file to the device.
Since I didn't have the time to be successful with drag/drop before the device disconnected, I built and used picotool to push the "nuke memory" UF2 file (see link here). (BOOTSEL held down, plugin, hit enter on the terminal to run ASAP before the pico disconnects)
I actually had to do this two or three times, but after that it stopped being weird and Mass Storage mode works correctly again; I was able to install the MicroPython UF2 file with the normal drag and drop method and Thonny no longer disconnects.

v4l2loopback doesn't create the /dev/video/ files

im trying to make v4l2loopback work on my desktop PC (no hardware camera) with mint 19.3, kernel 5.4.0-42-generic x86_64.
I followed the official instructions and compiled from git the v4l2loopback module and everything seem to run correctly, as no error prompted while running the instructions, but when i do ll /dev/v* there's no /dev/videoN entry.
I also tried with the flags exclusive_caps=1 and devices=2 but to no avail.
Any idea what i might be missing or doing wrong?
you need to load the module (e.g. using modprobe) before you can use it.
see also https://github.com/umlaeute/v4l2loopback#run

Running Kafka-python causes whole computer to freeze (ESXi 6.5 VM Virtual Machine Freeze Kernel Panic)

I am running Python2.7 with Zookeeper and kafka (0.8.2.1).
I am using the latest Kafka-python client (pip install kafka).
The following is a minimally reproducible example:
from kafka import KafkaConsumer
BOOTSTRAP_SERVER = 'myserver.com:my_port'
consumer = KafkaConsumer('my-topic', bootstrap_servers=BOOTSTRAP_SERVER)
print 'about to print messages'
for msg in consumer:
print msg
This prints 'about to print messages', and then the whole VM (Ubuntu Xenial, 16.04 LTS) freezes. I can't even see the cursor inside the VM.
Funny thing is, I am running the exact same Ubuntu Image on one of my other computers (not a VM) and it works.
The VM is running on ESXi 6.5.
This answer PyCharm freezing whole computer on Ubuntu said it could be openjdk's fault (I don't use pycharm; I execute the code from the terminal), so I switched to Oraclejdk. Didn't solve the problem. I have tried literally everything I can think of and am at my wit's end (ubuntu trusty is downloading, and I am going to try running it on that image and see if that works on the VM).
Any pointers/help appreciated.
Thank you!
UPDATE: If you are getting this issue as well on Ubuntu Xenial (16.04) or newer, try a Trusty (14.04) image. SEEMS to have solved the problem for me, but probably too soon to tell.
UPDATE 2 I was wrong. Still doesn't work. Seems like a bug in the kernel.
This is a known ESX bug. Apparently the reason for this is some invalid op code in certain intel CPUs that gets triggered by the newer versions of Ubuntu (Xenial and above).
I solved it by using Ubuntu 14.04 (trusty) instead of 16.04. Hope this helps someone.
Other solutions that didn't work for me (as well as reference links) are below:
launchpad bug-report (edit vmx file a little, didn't work for me)
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1630774
vmware-recommended workaround (edit grub file a little didn't work for me)
https://communities.vmware.com/message/2626830#2626830

Why Arch Linux is not booting using raspberry pi board?

I recently got my pi board and started working on it. I decided my first aim to install a OS image on SD card and boot from it. So i downloaded Arch Linux image file in zip format from here http://www.raspberrypi.org/downloads.
After that i installed .img file in my SD card Verbatim 8GB (I do not know why 4hr is also written here ?) using Ubuntu 12.04LTs . I used following commands :
sudo umount /dev/sdb1
sudo dd bs=1M if=/path/to/img/file of=/dev/sdb
After successful installation , when i tried to boot from it using PI board , then my monitor shows NO SIGNAL , i checked all the cables and i also borrowed another SD card from my friend preloaded with Raspbian , it was working fine, that is problem is with installation.So i again put SD card in my Laptop and i got surprised that it is not detecting it. I used Gparted , it shows unknown file system error.I again tried but the problem remain same .
Now my questions are :
How to install Arc Linux image in SD card ?
Why it is showing unknown file system after installing Arch Linux ?
After loads of Googling, I am convinced that we are not the only ones with this problem and probably the problem is with the 2014.01 and 2014.02 image itself. I myself spent around 4 hours thinking I am going wrong somewhere. Downloading another image from http://archlinuxarm.org should help.