Mountains

Mountains
Showing posts with label Ubuntu Power Linux. Show all posts
Showing posts with label Ubuntu Power Linux. Show all posts

Sunday, April 12, 2020

Folding at Home on Ubuntu 19.10 with AMD GPU

For future reference, there's a global pandemic on at the time I'm writing this.

I found out that Folding@Home was taking on various Covid-19 research projects, and though, since I had some computer laying around not doing much, so I installed the client and let it go. However, I'm mainly a Linux user, and the my RX 460 was not getting used. I read several pieces of advice on via google. Generally, linux, opencl, and AMD gpus have to exist in certain combinations in order for folding at home to work correctly.

I've been running FAH on a workstation with Ubuntu 19.10 and a AMD RX 460 graphics card.

To get things to work, I had to
(1) Remove opencl-mesa and rcom
(2) I have ocl-icd-opencl-dev installed.

(3) Install AMD's opencl from the amdgpupro package. (amdgpupro IS NOT REQUIRED)
I used this script to do it, though I had to modify the version numbers as is described in the comments:
https://gist.github.com/kytulendu/3351b5d0b4f947e19df36b1ea3c95cbe
(4) Add <slot id='1' type='GPU'/> to the config.xml file (like this)

Bonus
(5) Disable FAHClient as a service in /etc/init.d (https://foldingforum.org/viewtopic.php?f=61&t=25328)
(6) Run FAHClient as root

The machine runs great while folding, and seems as productive in linux as it does in windows. By running from the command line, this allows the computer to quickly freed for heavy lifting, or rebooted to other operating systems.

Monday, July 8, 2013

Sleep well, sweet dog cow


As previously mentioned, my old mac died. While I had toyed with the idea of continuing to push it down the road as the central computer where stuff gets done, the number of road blocks beyond the slowly shrinking stack of ATA hard drives has only grown. Some are philosophical: the array of computing resources has grown to encompass the mac, a laptop, with windows gaming machine, the linux home server, the girlies old laptop, the girlies new macbook, the TV computer (really just a dvd player that usually boots windows but sometimes BSODs). There's no reason to try to use all that stuff constantly... it becomes a time suck. Then, the availability of powerpc software and the degrading apparent speed of html5, HD video, and vast piles of photos was becoming painful. Combing resources onto a faster machine is the order of the day.

So, we appear to be ambling in the general direction of productivity. I ordered a few terabyte drives and 4 gigs of ram for the windows box, and installed ubuntu in a dual boot configuration. Windows for all those games, linux for actually doing work.

The two major hurdles to transition, which were ultimately preventing a sooner move, was the email archive and the photo library.

Moving the photo library ended up being simple, enough, just copy the directory, and the IPTC keywords embedded by Shoebox were browsable by most of the photo management tools I tried. I ended up sticking with Shotwell, as Darktable made adding keywords a chore and it lacks a coherent full screen browsing experience. (You can't go to a Darktable collection, open a photo in full screen, and sequentially move through the photos, using the delete key to remove unwanted images. ) So, you can hope to see more photos in future posts. And future posts, now that I've gotten this mess cleaned up.

Email was somewhat tricky. I really wanted to be able to import Mail.app email into Thunderbird. Sadly, there is no T-bird filter for that, and Mail.app stores messages in individual .emlx files. I found a few, rather old scripts (ruby and perl) for converting .emlx to .mbox format, but neither of them worked to my satisfaction. The perl script would have required a lot of hand holding to deal with the many mailboxes to import from the mac, and the ruby script was written based on a depricated library, and needed more re factoring than my slightly greater than 0 ruby skills could muster.

The mac was able to keep itself together long enough to just export the mailboxes to mbox and then ultimately copy them to the server where the data would be safe.

That all took a bit to figure out. I wanted darktable to work well... it's so blindingly fast that one feels dismay when using anything else. It's not as fun to wait for a split second between photos closing and loading.

 We appear to be rolling again.


Saturday, June 15, 2013

The Deep End of the Bathtub (Curve) with Dead Albatross

The dual g4 Quicksilver I use for general productivity at home was made in 2002. It has lived at 10 different addresses in 4 different states over that period of time. I used it to writing my B.S. thesis project and heavily used it in my Ph.D. work. While some of my friends have had lemon macs, I got my moneys worth and then some out of it.

To wit: the thing's been used. And I think it wants to retire, as much as a computer can tell you it wants to retire, but having trouble running a current operating system, having vanishingly small amounts of new code targeted to it, and most recently, killing all the hard drives I put in it.

I don't think there's anything physically wrong with the system; the problem is that every ATA-66/100/133 drive I have that is large enough to be useful is 5-7 years old and already has a lot of on-time. Statistically, they're already end-of-life.

One drive kicked the bucket in March. This past week, the drive I replaced it with, a barely used 160 gig drive I used to use for backups (back when 160 gigs was a lot) started spinning up and down, first at random, then all the time. It's motor is clearly gone. Now I get to pull out the screwdriver and put in another drive. I think I'll put in the newest drive.

Thank goodness for rsync. There is script that synchronizes the mac's data with the linux server over the LAN. Used weekly, it has saved every byte worth saving from depolarization.

Backups rock.

Keeping stuff working forever rocks.

But this is getting ridiculous. I have real stuff to do. Every computer in the house is newer and better in most ways. Time to kick this thing to the curb and find a way to do business with something else.

EDIT:
It turns out, the 160 gig drive is fine, and it's one of the other disks that have not raised a S.M.A.R.T. error, that's dying. Insanity.

Sunday, October 31, 2010

The Sickness is Revealed

The Sickness: Why my T42 randomly hangs.

This is what is wrong with the Thinkpad. The T42 is hanging because the linux kernel does not manage the video memory correctly on it's Radeon 9600.

I can now only sit here and wonder how long the patches will take to be merged into the main linux kernel, then into the ubuntu system. Of course, I suppose I could try compiling a patched kernel myself...

... But it has been pointed out that I have spent a great deal of free time, perhaps a couple of weekends and all the free evening I can muster over the past 2 weeks attempting to solve this little thinkpad crash faux-pax. I think my interests are better served by just being patient, at this point. This is one of those things I would like to -work- so that I can get other things done. I am somewhat dissenterested in crossing all the bridges it takes to effectively debug kernels when I would really like to be thinking about my photography or looking for exciting new ways to analyze geographic data. Or writing...

I keep thinking I will stop using the mac due to it's age and incredible milage, however, it keeps turning on when other machines go up in smoke. It's not hard to really like a computer that works this well.

Sunday, October 24, 2010

Too Much Thrift...

I have become a little obsessed with the random crashing on the Thinkpad (a T42). Having a computer that hangs every 20-120 minutes is really weird and annoying.

Hangs without logfile notes are evil. That leaves me to trouble shoot by trial, error, and google in the middle. This also makes the problem more intriguing than average.

Trouble Shooting Timeline.
0) Discovered random hangs. Did a complete reinstall of xubuntu 10.10 from cd. Googled a lot. Found thinkwiki article that mentioned conflicts between bios power management (pm) and linux pm.
1) Disabled bios PM: this helped a lot.
2) Installed laptop-mode-tools to try to push things a little longer. Crash reappears!
 -Maybe crash is related to some specific aspect of powersaving?
3) Fallback to basic powersaving (whatever that is... more later). I thought it was fixed until the computer hung at 10% battery. Maybe XFCE4-power-manager can do something to cause a crash too, but it's less agressive? Maybe some other aspect of pm gets wrapped around the axle in panic-powersave?
4) Google more...


How does linux power management work?
Have you ever wanted to know how linux manages power on your computer?

You want to know, trust me:
 If you're a programmer, you'd love to see the power, and want to spend every waking moment of the next week trying to harness it.
- If you're a more normal human being, you need to see the horrorshow mess that is going on under the hood.

In short, The community has taken a lot of jabs at the problem, so now we are left with a really pissed off bull running around town with lots of spears stuck in it, so it's bleeding and shitting all over the place and destroying everything in it's path. GO TEAM!


Linux power management has gone through a lot of iterations, and there is a mish-mash of solutions to the power management issue. From I learned today.... and links below (no authority guaranteed here or there, mind you!):

  • speedstep-centrino became acpi-cpufreq
  • acpi-cpufreq got rolled into the 2.6.31> ubuntu kernel... so no module
  • something about Ubuntu reverting to a acpi-cpufreq module under some vague rumored condition
  • cpufreqd and powernowd are now userspace daemons: that is something you can control w/o loading modules from the command line....
  • powernowd is the preferred method of control, though cpufreqd could still be in the wild.
  • hal, although depreciated, could still be messing with your pm settings.
  • udisks-daemon/udisks can exhibit some control over hard drive power usage. Provides disk interface to freedesktop.org dbus interface.
  • apmd (advanced power management daemon) was used to control power on older machines, but was supplanted by acpid. (also deprecated)
  • acpid (advanced control and power interface daemon): Modern machines have acpi, and this package executes commands based on changes in the computers hardware state (temperature, power, buttons, ect....)
    • Power status can be found in /proc/acpi 
    • acpid executes commands based on events from /etc/acpi/ and /etc/acpi/events. Notably, the ac and battery commands in ~/events.
  • sleepd can put the machine to sleep... seems very basic. not part of standard ubuntu install
  • xfce4-governor-plugin used HAL to change the CPU speed, but is now depricated along with hal
  • pm-utils appears to be the current architecture for basic power control. I am not sure if it is part of the standard ubuntu installation. maybe just on laptops? There are some scripts in /usr/sbin/ that determine this.
    • pm-utils 1.4.x that ships with xubuntu 10.10 is incompatbile with laptop-mode-tools. It says it right on the freedesktop.org webpage!
      • apt-get removes pm-utils when it installs laptop-mode-tools.
  •  laptop-mode-tools is a set of scripts that provides fairly aggressive power. It modulates daemons, kernel laptop mode, and other hardware settings (hdparm) to squeeze power savings out of a machine
    • curiously, apt-get recommends installing pm-utils, even though the packages hate each other now.
  • management, making attempts to control almost every aspect of a machine.
  • upowerd/upower monitors power devices  and posts changes on the freedesktop.org dbus interface. Running upower -m will show the messages when the computer is plugged/unplugged. Things that listen on dbus might respond...
  • xfce4-power-manager monitors and controls power behaviour through dbus signals
  • gnome-power-manager C based power manager that uses upower, dbus, and libnotify. Ironic quote:
"Power management is an essential job on portable computers, and becoming more important on todays high-powered desktops. It uses many complex (and sometimes experimental) parts of the system - each of which are slightly different, and may contain quirks to work around. The power management policy could be influenced and tweaked by an huge number of options, and each new laptop model brings more possibilities and options. This should all work in the background without even being noticed by the user." (emphasis theirs!)
  •  hdparm is used to set the power management of hard drives
  • sdparm is the bastard cousin of hdparm, used for things that pretend to be, or really are, scsi. (for those poor bastards who still have it).
  • Network I/O can be optimized through
    • iwpriv (for older wireless)
    • /sys/bus/pci/drivers/iwl*/...(for newer wireless)
    • ethtool (for ethernet)
  • xrandr: controls active video outputs
  • x.org dpms module controls the lcd on/off state
  • lcd backlight control: mysterious! xbacklight is listed...
  • The virtual memory subsystem tries to optimize things when there is a limited power situation, with variables set in /proc/sys/vm/
  • cpufrequtils: provides some scripts that allow users to easily control the cpu speed. (possible to do this by writing values to /proc and /sys...)
  • uswsusp allows suspend and resume by writing system state to disk
  • noflushd: buffers hard drive writes to allow hard drives to spin down as long as possible
  • rovclock, radeontool: control radeon card based clock speed and lcd brightness
    • "Dynamic Clocks" option in the xorg.conf file also changes gpu speed.
    • kms seems to have replaced xorg.conf
      • unless you've disabled kms, then you need xorg.conf
      • how kms interacts with power management and cpu speed is mysterious and a popular source of hangs that are posted in discussion boards
      • This is the best info I have on using /sys/* to manage radeon: http://wiki.archlinux.org

It appears that there are three general pathways for power management. ACPI finds out that the power state has changed, then dbus, hal, and sysfs get updated. From there, the various daemons and power managers take over firing off scripts that control the sundry power settings on a modern machine.

It is probably important to dissable the xfce/gnome/kde power managers too...

So, finding the source of the crash in my computer entails fiddling with each subsystem until one generates a crash. Fun times.

Fun things to read about Power Management: