Skip to content

setup_grafzahl

chainsawriot edited this page Aug 7, 2023 · 6 revisions

For any reason the provided setup_grafzahl did't work, you can always setup the miniconda environment manually. It is particular useful for the cases when you want to have CUDA support but detect_cuda() returns FALSE. If you don't need cuda but want to diagnose what went wrong, jump to here.

Checking for CUDA

If you want to have cuda support, you must have CUDA-capable GPU(s). Make sure the proprietary Nvidia driver is functioning (if not, see here; or basically: ‪sudo ubuntu-drivers install --gpgpu on a Ubuntu machine).

nvidia-smi

Make sure that you have miniconda installed (if not, see here).

conda --version

Installation

Remove existing grafzahl_condaenv_cuda environment (if exists)

conda env remove -n grafzahl_condaenv_cuda

Download the yaml file from us

wget https://github.com/chainsawriot/grafzahl/blob/v0.1/inst/grafzahl_gpu.yml

Setup the barebone environment and activate it

conda env create -f grafzahl_gpu.yml -n grafzahl_condaenv_cuda
conda activate grafzahl_condaenv_cuda

Install cuda and cuda-enabled pytorch

## use the matching cuda version
conda install -n grafzahl_condaenv_cuda pytorch pytorch-cuda cudatoolkit=11.4 -c pytorch -c nvidia -y

At this point, you can check whether the cuda support is available or not (If it returns True you are good to go further; If it returns False, I don't know what to do).

python -c "import torch; print(torch.cuda.is_available())"

Further step and deactivate the conda environment

python -m pip install simpletransformers
python pip install simpletransformers==0.63.11 "transformers==4.30.2" "scipy==1.10.1"
conda deactivate

At this point, you can also check whether grafzahl's cuda support is working

Rscript -e "grafzahl::detect_cuda()"

Noncuda

conda env remove -n grafzahl_condaenv
wget https://raw.githubusercontent.com/chainsawriot/grafzahl/v0.0/inst/grafzahl.yml
conda env create -f grafzahl.yml -n grafzahl_condaenv
conda activate grafzahl_condaenv
## This should be FALSE; but with no errors
Rscript -e "grafzahl::detect_cuda()"
Clone this wiki locally