For example,
for (size_t i=0; i<nSize/2; i++) {
data_[i]<<=4;
}
Hard Earned Knowledge
For example,
for (size_t i=0; i<nSize/2; i++) {
data_[i]<<=4;
}
I ran into a few gotchas getting the GPU compute to work with folding@home on Ubuntu. Here is a quick rundown on how to get it working.
This depends on your GPU and there’s a good chance you have this done already. If not, I recommend using the pop!_os PPA to get the latest version automatically through apt. With your new found interest in high performance computing you may consider installing CUDA using the same PPA (optional).
# set up sources
sudo echo "deb http://apt.pop-os.org/proprietary bionic main" | sudo tee -a /etc/apt/sources.list.d/pop-proprietary.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 204DD8AEC33A7AFF
sudo apt update
## install the driver
sudo apt-get install system76-driver-nvidia
## optional! install CUDA
sudo apt install system76-cuda-latest
https://support.system76.com/articles/cuda/
https://support.system76.com/articles/system76-driver/
sudo apt install clinfo sudo apt install ocl-icd-opencl-dev
Go to the folding at home and install all 3 deb packages you find there. https://foldingathome.org/start-folding/
For some reason the default config file disables GPU compute and I haven’t found a way to enable through the GUI so we need to fix it manually.
sudo gedit /etc/fahclient/config.xml
find the line that says
<!-- Folding Slot Configuration -->
<gpu v='false'/>
and set gpu to true!
Now you need to restart the client:
sudo /etc/init.d/FAHClient stop
sudo /etc/init.d/FAHClient start
Open FAHControl. Click configure. Click slots tab. Click add. Select gpu. Click ok then save.
Now you you should see your folding slot on the FAHControl main page. If it looks good click the “fold” button.
Setting terminal titles was a super useful feature in Ubuntu before 16.04. Here’s how to do it in modern versions:
Add the following to .bashrc
set-title(){ ORIG=$PS1 TITLE="\e]2;$@\a" PS1=${ORIG}${TITLE} }
Use the command:
set-title title_of_window
This also works on Pi 3.
sudo raspi-config, disable serial console login, enable hardware serial port
sudo apt install pps-tools gpsd gpsd-clients python-gps chrony
edit /etc/modules, add:
pps-gpio
edit /boot/firmware/config.txt (or /boot/config.txt), add:
dtoverlay=pps-gpio,gpiopin=18
edit /etc/default/gpsd, set device to “/dev/ttyS0”, options to “-n -b”
sudo systemctl enable gpsd
edit /etc/chrony/chrony.conf, comment out all servers and pools, add:
refclock SHM 0 poll 0 refid GPS precision 1e-1 offset 0.055 refclock PPS /dev/pps0 lock GPS poll 0 refid PPS precision 1e-9
sudo systemctl restart chrony
Monitor using chronyc sources, or chronyc sourcestats
Begin by downloading an image courtesy of James Chambers
Use etcher to write the image to an SD card
Next follow the instructions on the ROS wiki. Make sure to install the “bare bones” version if you are running a headless Pi.
That’s it! Thanks to the James Chambers image this ended up being pretty easy!