Build Unity development environment on docker

Overview

Verification environment

The environment verified this time is as follows.

Hardware cpu - AMD Ryzen 9 3900X gpu - Geforce RTX 2060 super ram - 32G

Software os - ubuntu 20.04.1 kernel - Linux define 5.4.0-48-generic docker - 19.03.13 nvidia-driver - 450.66 cuda version - 11.0

I have attached the output of nvidia-smi.

$ nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.66       Driver Version: 450.66       CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce RTX 206...  Off  | 00000000:0E:00.0  On |                  N/A |
| 38%   40C    P8    11W / 175W |    916MiB /  7979MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

Environmental arrangement

First install nvidia-container-runtime.

#apt related settings
$ curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | sudo apt-key add -
$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
$ curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list

# nvidia-container-runtime installation
$ sudo apt update
$ sudo apt install nvidia-container-runtime

#Restart docker service
$ sudo systemctl restart docker.service

Then register your UID in docker group. I think people using docker are doing it, but just in case.

$ sudo usermod -a -G docker `id -un`
$ sudo systemctl restart docker.service

Execution method

Next, build the docker image.

$ git clone https://github.com/chikuta/chikuta-dockerfiles.git
$ cd chikuta-dockerfiles
$ ./docker/ros-bionic-melodic-unity/build-docker-image.bash

Next, you can start the container of the built image by executing the following command. The content of the script is a wrapping of the processing around xhost and the arguments of docker. You can create your own environment by editing it as needed, so let's actively customize it.

$ cd chikuta-dockerfiles
$ ./docker/ros-bionic-melodic-unity/run-docker-container.bash

When you run the script, the blue terminator will be launched. Since this is a terminal application running on the docker container, all commands executed here will be processed on the docker container. Next, let's launch Unity Hub.

cd /opt/unity
./UnityHub.AppImage

unityhub.png

Let's launch Unity Editor after installing the required environment. The image will be a display of the appropriate Free Island Collection obtained from the Asset Store.

unityeditor.png

Next, I will write about ROS cooperation.

reference

Recommended Posts

Build Unity development environment on docker
Build an Ultra96v2 development environment on Docker 1
Build a PureScript development environment with Docker
Build a Java development environment on Mac
Build Java 8 development environment on AWS Cloud9
Build a Wordpress development environment with Docker
Build Redmine code reading environment on Docker
Build an environment with Docker on AWS
Build a simple Docker + Django development environment
Build a development environment for Docker + Rails6 + Postgresql
Build a WordPress development environment quickly with Docker
[Java] Build Java development environment on Ubuntu & check execution
Build Apache / Tomcat development environment on Cent OS 7
Build a simple Docker Compose + Django development environment
Build a development environment for Docker, java, vscode
Build debug environment on container --Build local development environment for Rails tutorial with Docker-
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
How to build a Ruby on Rails development environment with Docker (Rails 5.x)
WSL2 + VSCode + Docker development environment
Build docker environment with WSL
Build Java development environment with VS Code on Mac
Build a Ruby on Rails development environment on AWS Cloud9
Build Docker + Laravel PHP + Vue.js development environment in 5 minutes
Build Java development environment with WSL2 Docker VS Code
Try to build a Java development environment using Docker
Build a Doker-based development environment on Windows 10 Home 2020 ver. Part 1 Until WSL2-based Docker build
Build a development environment to create Ruby on Jets + React apps with Docker
Install Ubuntu 20.04 in virtual box on windows10 and build a development environment using docker
Build a Node.js environment with Docker
[Unity] Android development environment construction procedure
Build PlantUML environment with VSCode + Docker
Build environment with vue.js + rails + docker
Build Rails environment with Docker Compose
Build Clang x VSCode on Docker (1)
Build a XAMPP environment on Ubuntu
Build jooby development environment with Eclipse
How to build Rails, Postgres, ElasticSearch development environment with Docker
Build docker + laravel environment with laradock
Install Java development environment on Mac
Build Go development environment with WSL2 + Docker Desktop + VSCode (Remote --Containers)
[App development 0.5] [Node.js express Docker] Build an environment for Node.js Express MongoDB using Docker
Build a development environment where Ruby on Rails breakpoints work on Windows
Build a browser test environment using Capybara in the Docker development environment
Build an ASP.NET Core Web API environment on Docker (VSCode) Part 2
Create Spring Boot development environment on Vagrant
Laravel development environment construction with Docker (Mac)
Sapper × Go (echo) × Docker development environment construction
Java development environment construction memo on Mac
Use docker in proxy environment on ubuntu 20.04.1
Create Spring Boot-gradle-mysql development environment with Docker
[Docker] Development environment construction Rails6 / Ruby2.7 / MySQL8
[Ruby] Building a Ruby development environment on Ubuntu
Spring Boot + Docker Java development environment construction
Run jooby's Eclipse development environment on Gradle
Build Cakephp environment from docker installation Ubuntu
[Docker] Build Jupyter Lab execution environment with Docker
Build a JMeter environment on your Mac
Try the Docker environment on AWS ECS
Lightweight PHP 7.4 development environment created with Docker
Build TensorFlow operation check environment with Docker
How to build Rails 6 environment with Docker