quadcopter_with_PID_controller
Quadcopter dynamics simulation with two proportional–integral–derivative (PID) controllers that adjust the motor speeds…
GeNN is a GPU-enhanced Neuronal Network simulation environment based on code generation for Nvidia CUDA and AMD HIP.
git clone https://github.com/genn-team/genn.gitgenn-team/gennGeNN is a GPU-enhanced Neuronal Network simulation environment based on code generation for NVIDIA CUDA and AMD HIP.
Install the C++ compiler on the machine, if not already present.
sudo apt-get install g++sudo apt-get install libffi-dev.CUDA_PATH environment variable to determine which version of CUDA to build against.
echo %CUDA_PATH% in a commmand prompt.CUDA_PATH manually using export CUDA_PATH=/usr/local/cuda, assuming CUDA is installed in /usr/local/cuda (the standard location on Ubuntu Linux). To make any of these changes persistent, add this command to your login script (e.g. .profile or .bashrc).HIP_PATH variable manually using export HIP_PATH=/opt/rocm, assuming HIP is installed using the official installer.export HIP_PLATFORM='amd' if you wish to use an AMD GPU or export HIP_PLATFORM='nvidia' if you wish to use HIP with an NVIDIA GPU.profile or .bashrc).In order to install GeNN on Windows you need to run the following commands from a command prompt with the Visual Studio environment variables correctly configured. Typically this is added to the start menu during Visual Studio installataion and is called something like "x64 Native Tools Command Prompt for VS 2022". Once installation is complete, GeNN can be used from a normal command prompt.
The easiest way to install GeNN is directly from github using pip.
First of all make sure pip is up to date using :
pip install -U pip
Then, to install the latest development version you can use:
pip install https://github.com/genn-team/genn/archive/refs/heads/master.zip or, to install the 5.4.0 release, you can use:
pip install https://github.com/genn-team/genn/archive/refs/tags/5.4.0.zip.
If you want to develop GeNN yourself or run userprojects from the GeNN repository, it is helpful to create an 'editable' install.
The easiest way to do this to first 'clone' GeNN from github using git clone https://github.com/genn-team/genn.git.
Then, navigate to the GeNN directory and install using pip install -e .. If you wish to install the additional dependencies needed
to run the userprojects, you can do so using pip install -e .[userproject].
Although it is not recommended, in order to build special development versions you sometimes need to install the old fashioned way!
pip install pybind11 psutil pkgconfig setuptools>=61.git clone https://github.com/genn-team/genn.gitpython setup.py develop.
You can build a debug version of GeNN with python setup.py build_ext --debug develop.You can also use GeNN through our CUDA-enabled docker container which comes with GeNN pre-installed. To work with such CUDA-enabled containers, you need to first install CUDA on your host system as described above and then install docker and the NVIDIA Container Toolkit as described in https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker. You can then build the GeNN container yourself or download it from Dockerhub.
The following command can be used from the GeNN source directory to build the GeNN container:
make docker-build
This builds a container tagged as genn:latest so, to use this container rather than downloading the prebuild one from dockerhub, just replace gennteam/genn:latest with genn:latest in the following instructions.
By default, the container image is based off the Ubuntu 20.04 image with CUDA 11.5 provided by NVIDIA but, if you want to use a different base image, for example to use the container on a machine with an older version of CUDA, you can invoke docker build directly and specify a different tag (listed on https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md) via the BASE build argument. For example to build using CUDA 11.3 you could run:
docker build --build-arg BASE=11.3.0-devel-ubuntu20.04 -t genn:latest_cuda_11_3 .
If you wish to use GeNN or PyGeNN interactively, you can launch a bash shell in the GeNN container using the following command:
docker run -it --gpus=all gennteam/genn:latest
You can also provide a final argument to launch a different executable e.g. /bin/sh to launch a dash shell.
NOTE PyGeNN is installed in the system Python 3 environment, the interpreter for which is launched with python3 (rather than just python) on Ubuntu 20.04.
When using the GeNN container you often want to access files on your host system.
This can be easily achieved by using the -v option to mount a local directory into the container. For example:
docker run -it --gpus=all -v $HOME:/local_home gennteam/genn:latest
mounts the local user's home directory into /local_home within the container.
However, all of the commands provided by the GeNN container operate using a non-elevated, internal user called 'genn' who, by default, won't have the correct permissions to create files in volumes mounted into the container.
This can be resolved by setting the LOCAL_USER_ID and LOCAL_GROUP_ID environment variables when running the container like:
docker run -it --gpus=all -e LOCAL_USER_ID=`id -u $USER` -e LOCAL_GROUP_ID=`id -g $USER` -v $HOME:/local_home gennteam/genn:latest
which will ensure that that 'genn' user has the same UID and GID as the local user, meaning that they will have the same permissions to access the files mounted into /local_home.
A Jupyter Notebook environment running in the container can be launched using the notebook command. Typically, you would combine this with the -p 8080:8080 option to 'publish' port 8080, allowing the notebook server to be accessed on the host. By default, notebooks are created in the home directory of the 'genn' user inside the container. However, to create notebooks which persist beyond the lifetime of the container, the notebook command needs to be combined with the options discussed previously. For example:
docker run --gpus=all -p 8080:8080 -e LOCAL_USER_ID=`id -u $USER` -e LOCAL_GROUP_ID=`id -g $USER` -v $HOME:/local_home gennteam/genn:latest notebook /local_home
will create notebooks in the current users home directory.
Assuming they have no additional dependencies, PyGeNN scripts can be run directly using the container with the script command. As scripts are likely to be located outside of the container, the script command is often combined with the options discussed previously. For example, to run a script called test.py in your home directory, the script command could be invoked with:
docker run --gpus=all -e LOCAL_USER_ID=`id -u $USER` -e LOCAL_GROUP_ID=`id -g $USER` -v $HOME:/local_home gennteam/genn:latest script /local_home/test.py
At the moment, the following Python example projects are provided with GeNN:
In order to get a quick start and run one of the the provided example models, navigate to the userproject directory, and run the python script with --help to see what options are available.
For more details on how to use GeNN, please see documentation.
more like this
Quadcopter dynamics simulation with two proportional–integral–derivative (PID) controllers that adjust the motor speeds…
📱 A React app to preview and edit Markdown✍. You can also export it as HTML.
A sandbox game created in C using raylib, featuring various types of falling pixels, such as sand or water. (more in th…
search projects, people, and tags