вторник, 27 декември 2022 г.

Conda wouldn't install sundials and scikits.odes

I wanted to install a new integrator for my dear python, since scipi odeint was running crappy on my equations.  I tried to install scikits, but I kept on running into errors:

"ImportError: No module named 'scikits'"

Then after trying to install it, I got:

"Conda package install [Errno 13] Permission denied"

and then after upgrading pip:

"fatal error: sundials/sundials_types.h: No such file or directory"

First, I tried to manually install sundials from https://github.com/certik/sundials which I did with configure, make and make install, but the error in conda persisted. Then I did "export SUNDIALS_INST=/usr/local/include/sundials/" but conda didn't like it. After some digging, I've found it's better to install sundials with pip. So I first had to remove my manual installation:

sudo rm -R /usr/local/include/sundials  

unset SUNDIALS_INST=/usr/local/include/sundials/
 

Then I decided to clean up conda a bit:

conda clean -a -y 

Then I upgraded pip:

pip3 install --user --upgrade pip #that didn't work so:

sudo pacman -S pip
conda install pip 

Then I installed sundials:

pip3 install --user Sundials

sudo pacman -S sundials #that worked
 

Then installed just in case scikit-learn:

sudo pacman -S python-scikit-learn
 

To install it from pacman:

sudo pacman -S sundials

conda -c install conda-forge sundials

conda install -c conda-forge cython  

conda install -c conda-forge scikits.odes #see here for the explanation

sudo conda install -c conda-forge scikits.odes #this took super long because it verified dependencies

pip3 install --user scikits.odes #this one did it
And now, it's installed and loadable.
(see also https://github.com/bmcage/odes/issues/43)

вторник, 20 декември 2022 г.

Nvidia on Manjaro

Short note on Nvidia drivers, following this guide:

Apparently in Manjaro, you have to install it with

$ sudo mhwd -a pci nonfree 0300

But this won't give you nvidia-smi. To get it, you need to also install the driver from Pacman: 

sudo pacman -S lib32-nvidia-utils
sudo pacman -S nvidia-utils
sudo pacman -S linux60-nvidia

Then if you're lucky, it may work and you can switch to it with:

$optimus-manager --switch nvidia

If you're feeling naughty and you want to use another kernel, like xanmod, you do the same, but with nvidia-dkms and you have to install also linux-headers before.

Useful commands (source):

lshw -C display

glxinfo -B

xrandr --listproviders  

петък, 16 декември 2022 г.

How to remove old kernel entry in GRUB (non-funcitonal one)

   This is what I did to remove an old, non-functional kernel from my GRUB. I don't know how it even got there on the first place, because I had another, working xanmod entry. 

In any case, please proceed with caution when doing it. 

    ls /boot/vml*
  sudo mv /boot/vmlinuz-manjaro-xanmod ~
  ls /boot/vml*
  sudo grub-mkconfig -o /boot/grub/grub.cfg



четвъртък, 15 декември 2022 г.

The cursed "Intel Wi-Fi 6 AX200 "

So this are my notes on the cursed wifi adapter "Intel Wi-Fi 6 AX200 ".  It has the interesting tendency  to disappear and then you have to reboot for it to reappear. But sometimes it will again disappear just minutes after restart. So a really really naughty adapter. I spent a lot of time searching for a solution, here is what I found.

 The errors:

Error sending STATISTICS_CMD: time out after 2000ms.
[23658.567163] iwlwifi 0000:03:00.0: Current CMD queue read_ptr 56 write_ptr 57

or 

Direct firmware load for iwlwifi ucode failed with error -2

or 

iwlwifi 0000:03:00.0: Error, can not clear persistence bit

There are two parts of the problem that I detected so far.

1) Power management for optimus-manager. That's a tricky one because it appears if it's not configured correctly, at some point the wifi adapter shuts down. 

So this is my config file:

$cat /etc/optimus-manager/optimus-manager.conf
[amd]
dynamic_power_management=fine
DRI=3
driver=modesetting
tearfree=

[intel]
dynamic_power_management=fine
DRI=3
accel=
driver=modesetting
modeset=yes
tearfree=

[nvidia]
dynamic_power_management=fine
DPI=96
PAT=yes
allow_external_gpus=no
ignore_abi=no
modeset=yes
options=overclocking

[optimus]
dynamic_power_management=fine
auto_logout=yes
pci_power_control=no
pci_remove=no
pci_reset=no
startup_auto_battery_mode=integrated
startup_auto_extpower_mode=hybrid #nvidia
startup_mode=hybrid #nvidia
switching=none

2) The more important problem appears to be the wifi firmware. For unknown to humanity reasons, the kernel doesn't install the correct firmware but 20 others. This page expains how to reinstall it.

So  first see the exact adapter you have, unless you haven't.  In Manjaro:

$inxi -N

or 

$lshw -c net 

Then you can check the firmware version with:

$modinfo iwlwifi|grep 7260

Download the wifi driver from the official Intel website.  Extract it somewhere (new_driver). Then:
$ls /usr/lib/firmware | grep -i pnvm
$mv *.pnvm ~/wifi/old
$mv *.ucode ~/wifi/old
$cd new_driver
sudo cp iwlwifi-*.ucode /lib/firmware/

Then reboot.

 3) Aside from this, there is a number of other things to do to try to improve the life of your adapter. I'm listing them below, I don't know which help and which don't I just did everything.

$sudo iw reg set BG #where BG is the code of YOUR country
$sudo nano /etc/modprobe.d/iwlwifi.conf
>
options iwlwifi 11n_disable=1
options iwlwifi 11n_disable=8
optwion iwlwifi wd_disable=1
ctrl+o
$sudo iw wlan0 set power_save off #this didn't work for me
$sudo iw wlp3s0 set power_save off
$sudo nano /etc/modprobe.d/wifi.conf 

options iwlmvm power_scheme=1
options iwlwifi swcrypto=0 bt_coex_active=0 power_save=0 11n_disable=1 

ctrl+o

$sudo nano /etc/modprobe.d/iwlmvm.conf: 

>

options iwlmvm power_scheme=1

Key websites if you want to dig in:

https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi

https://itslinuxfoss.com/install-intel-wifi-6-ax200-driver/
https://www.intel.com/content/www/us/en/support/articles/000005511/wireless.html.

Also see this: https://bbs.archlinux.org/viewtopic.php?id=243671

But here after modeprobing the device was not visible in ifconfig and I could not try to "up" it. (also, ifconfig now is " ip a" )

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1848921

https://bbs.archlinux.org/viewtopic.php?id=243671

https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi

https://askubuntu.com/questions/1205996/iwlwifi-causing-system-hangs-on-ubuntu-19-10

https://launchpad.net/ubuntu/+source/linux-firmware/1.143.1

https://askubuntu.com/questions/616119/unstable-wireless-with-intel-7260-iwlwifi-after-upgrade-to-15-04


вторник, 13 декември 2022 г.

How to remove service from systemctl

 I had a weird service that was dumping errors like crazy in my logs visible with:

journalctl -b-1 -p4 --no-pager

So to remove it, first I found it's still running with (see this page for details):

 systemctl --type=service

then I followed these instructions and did:

systemctl stop [servicename]
systemctl disable [servicename]
rm /etc/systemd/system/[servicename]
rm /etc/systemd/system/[servicename] # and symlinks that might be related
rm /usr/lib/systemd/system/[servicename] 
rm /usr/lib/systemd/system/[servicename] # and symlinks that might be related
systemctl daemon-reload
systemctl reset-failed
 

where I basically did just the first "rm" part and the last 2 commands since the service wasn't active.