Skip to content

Instantly share code, notes, and snippets.

@arcaduf
arcaduf / Basic commands for Arvados
Created October 9, 2017 16:03
Basic commands for Arvados
# To mount the keep
mkdir keep
arv-mount keep/
# To unmount the keep:
arv-mount --unmount keep/
rm -r keep
# To run a workflow
arvados-cwl-runner --project-uuid <PROJECT_UUID> --submit --no-wait file.cwl file.yml
@arcaduf
arcaduf / Non-interactive GPU session with Slurm
Last active September 6, 2017 12:18
Non-interactive GPU session with Slurm
virtualenv ~/mypio
source ~/mypio/bin/activate
pip install scipy scikit-image scikit-learn SimpleITK h5py
deactivate
sbatch shellwrapper.sh
Inside the shellwrapper:
#!/bin/bash
#SBATCH --partition gpu
@arcaduf
arcaduf / Interactive GPU session with Slurm
Last active September 6, 2017 10:18
Interactive GPU session with Slurm
srun --partition gpu -I --pty /bin/bash -l
ml python2
ml virtualenv
ml CUDA/8.0.44
ml cuDNN/5.1-CUDA-8.0.44
ml OpenCV/2.4.11-goolf-1.7.20
ml TensorFlow/1.1.0-goolf-1.7.20-CUDA-8.0.44-Python-2.7.11
# Check whether tensorflow-gpu works fine:
python
@arcaduf
arcaduf / Run Jupyter notebook once virtualenv is set up
Last active September 12, 2017 16:57
Run Jupyter notebook once virtualenv is set up
ml python2
ml virtualenv
source ~/mypio/bin/activate
(mypio) pip install jupyter
(mypio) python -m ipykernel install --user --name=mypio
(mypio) jupyter notebook --no-browser --NotebookApp.token='' --NotebookApp.ip='0.0.0.0'
@arcaduf
arcaduf / VirtualBox: Windows host and Ubuntu virtual, how to share folders
Last active June 28, 2019 12:04
VirtualBox: Windows host and Ubuntu virtual, how to share folders
Go to "Device" --> "Install Guest Additions"
As root, run the program VBoxLinuxAdditions.run
Go to "Device" --> "Shared folders" and select the folders of interest
sudo mkdir /media/windows-share
sudo mount -t vboxsf folder-name /media/windows-share
@arcaduf
arcaduf / Installing OpenCV
Last active September 6, 2017 10:23
Installing OpenCV
Download directly the Git repo of opencv and opencv_contrib;
Type: "cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=ON -D ENABLE_FAST_MATH=1 -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1 -D INSTALL_PYTHON_EXAMPLES=ON -D WITH_IPP=OFF -D BUILD_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..
"make -j 4"
"sudo make install"
"sudo ldconfig"
Even if it runs on 4 cores, building OpenCV requires 4/4.5 h, so equip yourself with patience.
@arcaduf
arcaduf / Run Theano on GPUs
Last active September 6, 2017 10:23
Run Theano on GPUs
Simply install Theano with: 'sudo pip install Theano'
Run the Python scripts as: 'THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32 python script_name.py'
@arcaduf
arcaduf / Ubuntu installing Tensorflow
Last active September 6, 2017 10:23
Ubuntu installing Tensorflow
Ensure that you have python 2.7
Run: "sudo apt-get install python-pip python-dev python-virtualenv"
Run: "pip install --upgrade tensorflow-gpu"
Afterwards, if you run python on terminal, you should be able to import tensorflow with an error.
Add this line to .bashrc: "export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64".
Download cudnn version 5 for linux from the official website and copy the files into /usr/local/cuda/include and /usr/local/cuda/lib64 according to how the files are placed in cudnn.
@arcaduf
arcaduf / Installing CUDA on Ubuntu 16.04
Last active September 6, 2017 10:24
Installing CUDA on Ubuntu 16.04
Chech whether your gcc and g++ are the right version, i.e. version 5.
Go to "Software and Updates", then "Additional Drivers"; select NVIDIA drivers 375; install and restart.
Download the CUDA toolkit 8.0 from the official website.
Run the .run file accepting everything except the installation of the NVIDIA drivers, which already exist.
Go to the sample folder; run "make" and try the "matrixMul" script.
@arcaduf
arcaduf / Inkscape Latex: install textext extension
Last active September 6, 2017 10:24
Inkscape Latex: install textext extension
Download textext package
Unpack it and copy the .inc and .py file into ~/.config/inkscape/extensions/
Type: "sudo chmod 777 ~/.config/inkscape/extensions/textext.inx"
Type: "sudo chmod 777 ~/.config/inkscape/extensions/textext.inc"