lördag 11 april 2020

Overclock works in Windows but hangs in Linux.

So I have this old Intel Lynnfield system from 2010. It's overclocked and has been so for many years. Works perfectly in Windows even during high load for several days. Ubuntu and other distributions I tried would randomly freeze. Even more strangely, it never happened during heavy load.

Maybe Linux uses some CPU instruction Windows doesn't and that particular instruction doesn't work with the overclock? I clocked the CPU down, but Linux would still hang randomly.
I upgraded the motherboard bios, I upgraded the GPU bios. I replaced the soundcard. I checked SMART data for the drives. I ran memtest. I tested with a different GPU vendor.
But I couldn't find what was going on. Why was it freezing, so randomly, when there was almost no load in the system?

But then, for some reason I checked the cpu frequency using /proc/cpuinfo. The CPU wasn't running at the speed I had specified in bios, it was clocking down. That could certainly explain why the system froze during low load scenarios. CPU scaling and overclocking seldom works well, but I had disabled the C-states in bios. I had disabled turbo in bios. I knew for a fact that this was the case, since I've checked it numerous times in Windows.

So I started searching about C-states and the Linux kernel. For some reason the kernel ignores whether the bios has turned off the c-states or not. Thus, my disabled C-states was enabled. Confusing and frustrating.

I tried to fix this by disabling cpu scaling within Ubuntu, but for some reason it never worked as it was supposed to. Then I found that there is a kernel parameter for specifying what level of C-state that is allowed.

So I opened up /etc/default/grub and modified the GRUB_CMDLINE_LINUX_DEFAULT:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_idle.max_cstate=1"

Then I ran
sudo update-grub2
sudo reboot

Finally I confirmed that the cpu was no longer scaling using
cat /proc/cpuinfo

If I understand it correctly (haven't verified), you can set the max_cstate to 0 to disable the intel_idle driver, which should make the kernel use the bios/uefi settings instead.

Info from Dell
Info from IBM

onsdag 11 mars 2020

Where does files mount in Ubuntu?

So I was mounting network directories using the graphical interface in the files application, when I needed to use the mount points with the terminal. Where are those mount points located?

That location is here:

Source: askubuntu.com

torsdag 12 december 2019

openssl: Can't load /home/[username]/.rnd into RNG

On Ubuntu 18.04 LTS I got the following error message:
Can't load /home/sniglom/.rnd into RNG

The solution was to comment out the following line in /etc/ssl/openssl.cnf:

I found this solution via the openssl project at github.

måndag 4 november 2019

Slack open links in its own browser on Ubuntu

Running 18.04 LTS I discovered an odd behavior from Slack. Instead of opening links in my regular FIrefox installation, it opened its own Firefox-instance. That instance had no plugins and was grouped as a slack process in the menu bar. Weird.

Reinstalling Slack from Ubuntu Software didn't help and I couldn't find a setting within Slack that controlled this.

The solution to my issue was to install the .deb file from Slack's homepage, instead of using Ubuntu Software. After doing so, links opened through my regular Firefox installation, instead of starting new processes belonging to Slack.

Source: askubuntu.com

tisdag 1 oktober 2019

option OSS requires SDL_AUDIO

Trying to compile SDL20 I got the following message. It took a while before I realized that this wasn't a library that I needed to install, I needed to reconfigure SDL20 to add the SDL_AUDIO option.
To do that I simply ran "make config" in the SDL20 port directory and added SDL_AUDIO.

FreeBSD: X needs Python 3.5 at least, but 2.7 was specified.

When trying to compile using the ports system, the error message that something needs Python 3.x, but 2.7 was specified is quite common.
This is due to the ports system "remembering" the python version that was specified by a top level package, while a dependency may require something else.

The solution is to manually compile the dependency first.

In my case I was trying to build sdl_sound, but it failed due to meson-0.51.2 needs Python 3.5 at least, but 2.7 was specified.
To fix this I compile meson first, then I go back and compile sdl_sound.

söndag 22 september 2019

Avoid configuration prompts when installing freebsd ports

When installing ports with many dependencies, repeatedly stopping the compilation to show a configuration prompt is annoying, especially if you want the default values. This can be avoided in a couple of ways.

When installing a port, adding either of these batch flag uses default.
make install BATCH=YES
make install -DBATCH

The batch flag can also be set as an environment variable.
export BATCH=yes

What if you want to configure everything first and then compile?
make config-recursive
Remember that this command needs to be run many times until all configuration has been performed.

1 unix.stackexchange.com
2 unix.stackexchange.com