Skip to content

Commit

Permalink
Merge pull request #2824 from JdeRobot/update-dev-guide
Browse files Browse the repository at this point in the history
Updating dev guide
  • Loading branch information
javizqh authored Oct 25, 2024
2 parents 9e7c600 + 442a9af commit dfc2b63
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/InstructionsForDevelopers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
3 changes: 1 addition & 2 deletions docs/develop_binding_volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 9 additions & 20 deletions docs/gpu_acceleration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dfc2b63

Please sign in to comment.