diff --git a/docs/InstructionsForDevelopers.md b/docs/InstructionsForDevelopers.md index 0d32a5091..3735608e5 100644 --- a/docs/InstructionsForDevelopers.md +++ b/docs/InstructionsForDevelopers.md @@ -421,7 +421,7 @@ For example: ```script src="{% static 'exercises/assets/js/utils.js``` would hav 2. On Terminal open the directory where your project or code is located at (Example:- ```cd ~/my_project```) -3. Append ```-v $(pwd):/location_in_radi``` to your ```docker run``` cli command used to run your container. (Example:- ```docker run --rm -it -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 -v $(pwd):/home jderobot/robotics-academy```) +3. Append ```-v $(pwd):/location_in_radi``` to your ```docker run``` cli command used to run your container. (Example:- ```docker run --rm -it $(nvidia-smi >/dev/null 2>&1 && echo "--gpus all" || echo "") --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-backend -v $(pwd):/home jderobot/robotics-academy```) 4. This will import your local directory inside the docker container, if you have used the example command like above where the location the command is being run is mounted to the home folder inside the docker container you will simply be able to see all the local mounted directories inside the /home of the RoboticsBackend. diff --git a/docs/develop_binding_volumes.md b/docs/develop_binding_volumes.md index c2ac12ad1..df5e90a62 100644 --- a/docs/develop_binding_volumes.md +++ b/docs/develop_binding_volumes.md @@ -8,7 +8,6 @@ A fast way of development and testing can be achieved using volume binding. This This method consists in replicating the folder /RoboticsAcademy that exists inside the RoboticsBackend on your local drive. Then, a docker run option is used to replace the RoboticsBackend folder with your local folder. By doing so, all the changes made on your local files are included in the container. Note that this is a shared volume, so all changes made to your shared volume even from inside the container are persistent. 1. Replicate the folder RoboticsBackend:/RoboticsAcademy inside your local file system. This can be achieved by cloning the repository [RoboticsAcademy][https://github.com/JdeRobot/RoboticsAcademy] and the repository [RoboticsApplicationManager][https://github.com/JdeRobot/RoboticsApplicationManager] inside the folder RoboticsAcademy/src (include the contents directly, not into a subfolder src/RoboticsApplicationManager). 2. Run ``` yarn run dev ``` if there were any front-end changes -3. Run the docker image mounting the volume with the instruction ``` docker run --rm -it --name radi -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 -p 7163:7163 --mount type=bind,source="$(pwd)"/RoboticsAcademy,target=/RoboticsAcademy jderobot/robotics-academy ``` replacing the mount source path to your RoboticsAcademy path. - +3. Run the docker image mounting the volume with the instruction ``` docker run --rm -it $(nvidia-smi >/dev/null 2>&1 && echo "--gpus all" || echo "") --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 --mount type=bind,source="$(pwd)"/RoboticsAcademy,target=/RoboticsAcademy jderobot/robotics-academy ``` replacing the mount source path to your RoboticsAcademy path. [How to set up the developer environment section.]: /docs/InstructionsForDevelopers.md \ No newline at end of file diff --git a/docs/gpu_acceleration.md b/docs/gpu_acceleration.md index db9a32dfd..653f470ba 100644 --- a/docs/gpu_acceleration.md +++ b/docs/gpu_acceleration.md @@ -7,34 +7,23 @@ ROS and Gazebo can be accelerated within RoboticsAcademy thanks to VirtualGL if ## Linux -### Intel -For Linux machines and Intel GPUs, acceleration can be achieved by simply setting the ```--device``` argument when running the Docker container: +### Auto +If the PC has several GPUs, it will select them in order: NVIDIA, Intel, Only CPU. ``` -docker run --rm -it --device /dev/dri -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 jderobot/robotics-academy +docker run --rm -it $(nvidia-smi >/dev/null 2>&1 && echo "--gpus all" || echo "") --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-backend ``` -### NVIDIA -For NVIDIA GPUs, acceleration can be achieved by [installing the nvidia-container-runtime package](https://docs.docker.com/config/containers/resource_constraints/#gpu), and then running the command above, but adding the ```--gpus all``` flag: -``` -docker run --rm -it --gpus all --device /dev/dri -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 jderobot/robotics-academy -``` -### Dual -If the PC has several GPUs, we can choose which one will be used by setting the ```DRI_NAME``` environment variable (e.g. ```card0``` or ```card1```). +### Intel +For Linux machines and Intel GPUs, acceleration can be achieved by simply setting the ```--device``` argument when running the Docker container: ``` -docker run --rm -it --gpus all --device /dev/dri -e DRI_NAME=card1 -p 7164:7164 -p 2303:2303 -p 1905:1905 -p 8765:8765 -p 6080:6080 -p 1108:1108 jderobot/robotics-academy +docker run --rm -it --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-backend ``` -You can check the names associated with your graphic cards by running: -``` - drm-info -j | jq 'with_entries(.value |= .driver.desc)' -``` -You should get something like: +### NVIDIA +For NVIDIA GPUs, acceleration can be achieved by [installing the nvidia-container-runtime package](https://docs.docker.com/config/containers/resource_constraints/#gpu), and then running the command above, but adding the ```--gpus all``` flag: ``` -{ - "/dev/dri/card1": "NVIDIA DRM driver", - "/dev/dri/card0": "Intel Graphics" -} +docker run --rm -it --gpus all --device /dev/dri -p 7164:7164 -p 6080:6080 -p 1108:1108 -p 7163:7163 jderobot/robotics-backend ``` ## Windows