{"id":15934804,"url":"https://github.com/pinto0309/realsense-cuda-opengl-docker","last_synced_at":"2025-03-24T21:32:22.097Z","repository":{"id":97173169,"uuid":"455805612","full_name":"PINTO0309/realsense-cuda-opengl-docker","owner":"PINTO0309","description":"RealSense execution environment built on a Docker container on Ubuntu 20.04. NIVIDA GPU and OpenGL capable. CUADA 11.4.","archived":false,"fork":false,"pushed_at":"2022-02-05T14:44:38.000Z","size":39,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-14T03:49:51.231Z","etag":null,"topics":["cuda","docker","opengl","realsense","realsense2","ubuntu","wsl2"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PINTO0309.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-05T07:31:27.000Z","updated_at":"2024-01-04T17:05:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"c5c329a4-7e84-4db8-adec-a79567d31ec1","html_url":"https://github.com/PINTO0309/realsense-cuda-opengl-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Frealsense-cuda-opengl-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Frealsense-cuda-opengl-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Frealsense-cuda-opengl-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Frealsense-cuda-opengl-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PINTO0309","download_url":"https://codeload.github.com/PINTO0309/realsense-cuda-opengl-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222012893,"owners_count":16916206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda","docker","opengl","realsense","realsense2","ubuntu","wsl2"],"created_at":"2024-10-07T03:21:13.401Z","updated_at":"2024-10-29T08:05:26.087Z","avatar_url":"https://github.com/PINTO0309.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# realsense-cuda-opengl-docker\nRealSense execution environment built on a Docker container on Ubuntu 20.04. NIVIDA GPU and OpenGL capable. CUADA 11.4.\n\n## 1. docker build\n```bash\n$ git clone https://github.com/PINTO0309/realsense-cuda-opengl-docker.git \\\n\u0026\u0026 cd realsense-cuda-opengl-docker \\\n\u0026\u0026 docker build -t pinto0309/realsense-cuda-opengl-docker:latest .\n```\n\n## 2. docker pull\n```bash\n$ docker pull pinto0309/realsense-cuda-opengl-docker:latest\n```\n\n## 3. docker run\n```bash\n$ xhost +local: \u0026\u0026 \\\ndocker run --gpus all -it --rm \\\n-v `pwd`:/home/user/workdir \\\n-v /tmp/.X11-unix/:/tmp/.X11-unix:rw \\\n--device /dev/video0:/dev/video0:mwr \\\n--device /dev/video1:/dev/video1:mwr \\\n--device /dev/video2:/dev/video2:mwr \\\n--device /dev/video3:/dev/video3:mwr \\\n--device /dev/video4:/dev/video4:mwr \\\n--device /dev/video5:/dev/video5:mwr \\\n--net=host \\\n-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \\\n-e DISPLAY=$DISPLAY \\\n--privileged \\\npinto0309/realsense-cuda-opengl-docker:latest\n```\n\n## 4. Run **`realsense-viewer`**\n```bash\n$ realsense-viewer\n```\n![image](https://user-images.githubusercontent.com/33194443/152633195-2fc6e4bd-058e-4ae0-9a9e-8d223f3d96ba.png)\n\n## 5. Run **`nvidia-smi`**\n```\n$ nvidia-smi\n\nSat Feb  5 07:49:13 2022       \n+-----------------------------------------------------------------------------+\n| NVIDIA-SMI 470.103.01   Driver Version: 470.103.01   CUDA Version: 11.4     |\n|-------------------------------+----------------------+----------------------+\n| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |\n| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |\n|                               |                      |               MIG M. |\n|===============================+======================+======================|\n|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |\n|  0%   44C    P8    15W / 220W |    310MiB /  7959MiB |      0%      Default |\n|                               |                      |                  N/A |\n+-------------------------------+----------------------+----------------------+\n                                                                               \n+-----------------------------------------------------------------------------+\n| Processes:                                                                  |\n|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |\n|        ID   ID                                                   Usage      |\n|=============================================================================|\n+-----------------------------------------------------------------------------+\n```\n\n## 6. Run **`glxgears`**\n```bash\n$ glxgears\n```\n![ezgif com-gif-maker (3)](https://user-images.githubusercontent.com/33194443/152633773-a25722fa-fd7d-4eb5-b23d-bf764cae46e9.gif)\n\n## 7. Running from within WSL2\n[Note] OpenGL will not work properly.\n\n1. Perform the following initial settings.  \n  [WSL2 USB Camera Jan 17, 2022 Edition](https://zenn.dev/pinto0309/articles/7c7ce81bea8b6c)\n2. Start WSL2 (Windows Terminal).\n```powershell\n\u003e wsl --list\nUbuntu-20.04 (default)\n\n\u003e wsl -d Ubuntu-20.04\n```\n3. USB attach. (Windows Terminal)\n```powershell\n\u003e usbipd wsl list\n\nBUSID DEVICE                                                       STATTE\n1-1   Intel(R) RealSense(TM) Depth Camera 435 with RGB Module D... Not attached\n\n\u003e usbipd wsl attach --busid 1-1\n```\n4. docker run. (WSL2 Terminal)\n```bash\n$ docker pull pinto0309/realsense-cuda-opengl-docker:latest\n\n$ xhost +local: \u0026\u0026 \\\ndocker run --gpus all -it --rm \\\n-v `pwd`:/home/user/workdir \\\n-v /tmp/.X11-unix/:/tmp/.X11-unix:rw \\\n--device /dev/video0:/dev/video0:mwr \\\n--device /dev/video1:/dev/video1:mwr \\\n--device /dev/video2:/dev/video2:mwr \\\n--device /dev/video3:/dev/video3:mwr \\\n--device /dev/video4:/dev/video4:mwr \\\n--device /dev/video5:/dev/video5:mwr \\\n--net=host \\\n-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \\\n-e DISPLAY=$DISPLAY \\\n--privileged \\\npinto0309/realsense-cuda-opengl-docker:latest\n\n$ ls -l /dev/video*\nxxxxxx 1 xxxx xxxx xx,xx,xx xx:xx /dev/video0\nxxxxxx 1 xxxx xxxx xx,xx,xx xx:xx /dev/video1\nxxxxxx 1 xxxx xxxx xx,xx,xx xx:xx /dev/video2\nxxxxxx 1 xxxx xxxx xx,xx,xx xx:xx /dev/video3\nxxxxxx 1 xxxx xxxx xx,xx,xx xx:xx /dev/video4\nxxxxxx 1 xxxx xxxx xx,xx,xx xx:xx /dev/video5\n\n$ sudo chmod 777 /dev/video*\n\n$ nvidia-smi\n\nSat Feb  5 07:49:13 2022       \n+-----------------------------------------------------------------------------+\n| NVIDIA-SMI 470.103.01   Driver Version: 470.103.01   CUDA Version: 11.4     |\n|-------------------------------+----------------------+----------------------+\n| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |\n| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |\n|                               |                      |               MIG M. |\n|===============================+======================+======================|\n|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |\n|  0%   44C    P8    15W / 220W |    310MiB /  7959MiB |      0%      Default |\n|                               |                      |                  N/A |\n+-------------------------------+----------------------+----------------------+\n                                                                               \n+-----------------------------------------------------------------------------+\n| Processes:                                                                  |\n|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |\n|        ID   ID                                                   Usage      |\n|=============================================================================|\n+-----------------------------------------------------------------------------+\n```\n\n## 8. CUDA assisted librealsense container\n```bash\n$ docker pull pinto0309/realsense-cuda-opengl-docker:latest.cuda\n```\nor\n```bash\n$ git clone https://github.com/PINTO0309/realsense-cuda-opengl-docker.git \\\n\u0026\u0026 cd realsense-cuda-opengl-docker \\\n\u0026\u0026 docker build \\\n-t pinto0309/realsense-cuda-opengl-docker:latest.cuda \\\n-f Dockerfile.cudarealsense .\n```\n```bash\n$ xhost +local: \u0026\u0026 \\\ndocker run --gpus all -it --rm \\\n-v `pwd`:/home/user/workdir \\\n-v /tmp/.X11-unix/:/tmp/.X11-unix:rw \\\n--device /dev/video0:/dev/video0:mwr \\\n--device /dev/video1:/dev/video1:mwr \\\n--device /dev/video2:/dev/video2:mwr \\\n--device /dev/video3:/dev/video3:mwr \\\n--device /dev/video4:/dev/video4:mwr \\\n--device /dev/video5:/dev/video5:mwr \\\n--net=host \\\n-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \\\n-e DISPLAY=$DISPLAY \\\n--privileged \\\npinto0309/realsense-cuda-opengl-docker:latest.cuda\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Frealsense-cuda-opengl-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinto0309%2Frealsense-cuda-opengl-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Frealsense-cuda-opengl-docker/lists"}