NodeODM:GPU exited with strange error code

Can anyone suggest what may be causing a “strange error” to make nodeodm:gpu processing fail?

I’m trying nodeodm:gpu with a small dataset of 50 images and it’s failing with the following message in the console output:

File “/code/stages/openmvs.py”, line 83, in run_densify
system.run(’"%s" “%s” %s’ % (context.omvs_densify_path,
File “/code/opendm/system.py”, line 106, in run
raise SubprocessException(“Child returned {}”.format(retcode), retcode)
opendm.system.SubprocessException: Child returned 127

===== Done, human-readable information to follow… =====

[ERROR] The program exited with a strange error code. Please report it at https://community.opendronemap.org

The computer’s specs:
Win10
Intel i7 with 4 cores / 8 processors
16GB RAM
1TB SSD
32GB WLS2 swap file size
Docker Desktop 4.4.4 (73704)

WebODM 1.9.11

nodeODM:gpu Latest version

1 Like

I should add, the GPU is a Radeon RX570 (4GB)

1 Like

and I downloaded the nodeodm:gpu image and created the container with this command line entry:

docker run -dp 3001:3000 --gpus all --name nodeodmgpu opendronemap/nodeodm:gpu

1 Like

Welcome!

Can you try re-running it without GPU acceleration in the normal Docker image to see if this is a problem with GPU passthrough via WSL2 with your AMD GPU?

Hi Saijin, it completes the task successfully if I use the normal Docker nodeODM image (i.e. which uses the CPU). Cheers, John

1 Like

I can run nodeodm:gpu containers on another W10 machine, a laptop with on onboard Intel GPU and a Nvidia GeForce GTX 1050 4GB, and it will complete the processing successfully but when I monitor the CPU & GPU activity via the Task Manager it looks to do the vast majority of processing with the CPU, and a little bit with the onboard Intel GPU, and nothing with the Nvidia GPU.

1 Like

Well this just got weird. Now when I try to run nodeODM:gpu on this W10 machine I get an error:

$ docker run -dp 3001:3000 --gpus all --name nodeodmgpu opendronemap/nodeodm:gpu
bb6ee57538d8c5b6d4abb8fdae7633f5145d88b0a28c651c09bf6c9dd7b19f39
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #0:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: driver error: failed to process request: unknown.

1 Like

Yeah, it might be using our node-odm intel-gpu container.

Are you using the NVIDIA-recommended drivers and setup to enable WSL2 GPU passthrough for compute?

As far as I know the implementation of gpu acceleration is using cuda and not open_cl.
If that so, it may not work as expected in AMD cards

1 Like

Nope, that’s news to me. I’ll try that.

1 Like

I ran into a brick wall trying to follow the Nvidia CUDA on WSL 2 installation instructions. I’m using Docker Desktop for Windows and the instructions for installing the NVidia Container Toolkit don’t seem to work with Docker Desktop.
Any suggestions?

1 Like

Try to follow the documentation here:

Since Docker should be running with WSL2 as the backend, GPU passthrough is supported if WSL2 GPU passthrough conditions are met.

Thanks Saijin, on the laptop with the Nvidia GPU this is the result:

PS C:\Users\johnny5> docker run --rm -it --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
Run “nbody -benchmark [-numbodies=]” to measure performance.
-fullscreen (run n-body simulation in fullscreen mode)
-fp64 (use double precision floating point values for simulation)
-hostmem (stores simulation data in host memory)
-benchmark (run benchmark to measure performance)
-numbodies= (number of bodies (>= 1) to run in simulation)
-device= (where d=0,1,2… for the CUDA device to use)
-numdevices= (where i=(number of CUDA devices > 0) to use for simulation)
-compare (compares simulation results running once on the default GPU and once on the CPU)
-cpu (run n-body simulation on the CPU)
-tipsy=<file.bin> (load a tipsy model file for simulation)

NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.

Windowed mode
Simulation data stored in video memory
Single precision floating point simulation
1 Devices used for simulation
GPU Device 0: “Pascal” with compute capability 6.1

Compute 6.1 CUDA device: [NVIDIA GeForce GTX 1050]
5120 bodies, total time for 10 iterations: 4.656 ms
= 56.301 billion interactions per second
= 1126.017 single-precision GFLOP/s at 20 flops per interaction


1 Like

And on the machine with the Radeon GPU:

PS C:\Users\johnny5> docker run -it --gpus=all --rm nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -benchmark
Unable to find image ‘nvcr.io/nvidia/k8s/cuda-sample:nbody’ locally
nbody: Pulling from nvidia/k8s/cuda-sample
d519e2592276: Pull complete
d22d2dfcfa9c: Pull complete
b3afe92c540b: Pull complete
b25f8d7adb24: Pull complete
ddb025f124b9: Pull complete
fe72fda9c19e: Pull complete
c6a265e4ffa3: Pull complete
c931a9542ebf: Pull complete
f7eb321dd245: Pull complete
d67fd954fbd5: Pull complete
Digest: sha256:a2117f5b8eb3012076448968fd1790c6b63975c6b094a8bd51411dee0c08440d
Status: Downloaded newer image for nvcr.io/nvidia/k8s/cuda-sample:nbody
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #0:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: initialization error: driver error: failed to process request: unknown.

That suggests to me that the Nvidia CUDA drivers are there & working, but there are no suitable drivers installed that support the Radeon GPU.

1 Like

Please read this thread for additional reference

Here is what Mr. Balamacab said :

Before starting the process make sure your system has virtualization extensions enable in bios (VT-x o AMD-v), Windows Subsystem for Linux depends on those extensions to run.

Also double check that your Windows 10 instance in updated to 21H2, if not do a manual update using the update asistand in the media creation tool page “Download Windows 10

Procedure:

  1. Install the WLS Cuda driver for windows, use this URL to download the latest driver from nvidia:
    2.*GPU in Windows Subsystem for Linux (WSL) | NVIDIA Developer**
  2. Install the WLS component for Windows 10, double check that your windows 10 is updated to 21H2. Open powershell or console in Windows and run:

wsl.exe --install

This procedure install the Virtual Machine Platform, Windows Subsystem for Linux, WLS Kernel, and Ubuntu for WLS. After the process finish, a new window opens with the linux console requesting to create a new user and password.

  1. Install docker in the WLS linux, given that is a special way of runing linux, follow the instructions in the following page to install docker inside WLS without problems:
    4.Install Docker on Windows (WSL) without Docker Desktop - DEV Community**
    Also install docker-compose using the docker procedure as root:
    5.
    Install Docker Compose | Docker Documentation**
  2. Enable Nvidia repository to install the needed libraries inside WLS. DO NOT INSTALL DRIVERS INSIDE WLS, follow the instructions in:
    7.*Repository configuration | nvidia-docker**
    If the procedure does not work try the following in WLS console:
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
  1. Install the Nvidia libraries for WLS running docker:
    sudo apt-get install -y nvidia-docker2
  2. Confirm the cuda version installed in windows, in powershell run:
    nvidia-smi
    image
    Write down the cuda version reported.
  3. Download the cuda WLS installer from nvidia, adjust the commands for your cuda version:
$ wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
$ sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
$ wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda-repo-wsl-ubuntu-11-6-local_11.6.0-1_amd64.deb
$ sudo dpkg -i cuda-repo-wsl-ubuntu-11-6-local_11.6.0-1_amd64.deb
$ sudo apt-key add /var/cuda-repo-wsl-ubuntu-11-6-local/7fa2af80.pub
$ sudo apt-get update
$ sudo apt-get -y install cuda

Restart the WLS instance

  1. If everything work till this point, the GPU can be seen from inside WLS running the command:
    nvidia-smi
  2. Confirm that your docker instance can access the GPU running a cuda benchmark
    docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
  3. Follow the WebODM install for linux; before launching webodm.sh modify the shell and mark the GPU_NVIDIA as true and save the file:
  4. modify the docker-compose.nodeodm.gpu.nvidia.yml file and adjust it to export all GPUs available inside WLS to the container, this is a limitation of running docker inside WLS
# Chaining this file to the main docker-compose file adds
# a default processing node instance. This is best for users
# who are just getting started with WebODM.

version: '2.1'
services:
  webapp:
    depends_on:
      - node-odm
    environment:
      - WO_DEFAULT_NODES
  node-odm:
    image: opendronemap/nodeodm:gpu
    ports:
      - "3000"
    restart: unless-stopped
    oom_score_adj: 500
    deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu]

  1. Profit!!
    Start Webodm, open a browser, point it to http://localhost:8000/
    log in and run your projects.
1 Like

It was expected because Radeon GPU doesn’t have support with Nvidia-CUDA.

1 Like

This, absolutely.

There was a long-unmaintained project that transpiled CUDA to OpenCL so it would run across all the GPU architectures, but we’re not using that, so your Radeon will not be able to process CUDA code, nor will anything but an appropriate CUDA-compatible NVIDIA GPU.

So the take-aways for running WebODM on a W10 machine with GPU are:

  1. Only Nvidia GPUs are supported; Radeon GPUs are not supported (because they have no CUDA support)
  2. Don’t use Docker Desktop because the GPU pass-through functionality does not work. Instead you must…
    a) install the Nvidia WLS CUDA driver for Windows,
    b) install Docker & Docker Compose in your WSL Linux environment,
    c) install the Nvidia libraries for Docker in the WSL Linux environment,
    d) download and run the Nvidia CUDA WLS Installer in the WSL Linux environment,
    e) install WebODM in the WSL Linux Docker environment, but before launching WebODM:
    i) modify webodm.sh and docker-compose.nodeodm.gpu.nvidia.yml
    iii) then run “./webodm.sh start --gpu all”
3 Likes
  1. Yes, if you want/need GPU compute
  2. I’m not sure we can’t get Docker GPU passthrough to work, since it should be, in effect, more or less the same process as getting WSL2 GPU passthrough to work.

You dont need all the above. In my case it works just fine with docker:

  • in bash/cmd run

nvidia-smi

  • run benchmark in bash/cmd (to confirm docker sees cuda drivers)

docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark

  • changed odm files (start.sh and docker-compose.nodeodm.gpu.nvidia.yml- they are located in webodm directory) check topic above what lines to change

  • run in bash

webodm.sh --gpu

Works just fine… at least in my case

2 Likes