Docker engine fails when system started without a monitor

I have a basic issue I cannot run docker containers with nvidia runtime unless I plug a monitor into the display port. It throws failed to stat CDI host device "/dev/fb0": no such file or directory: unknown as error.

When I start a docker container when the monitor is plugged in, all looks good

$ docker run --privileged --network host --ipc=host  -e DISPLAY -e NVIDIA_VISIBLE_DEVICES=all  -e NVIDIA_VISIBLE_DEVICES=nvidia.com/gpu=all   -ti --rm --runtime nvidia  nvidia/cuda:12.6.0-base-ubuntu22.04 nvidia-smi
Mon Feb 17 15:56:02 2025
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 540.4.0                Driver Version: 540.4.0      CUDA Version: 12.6     |
|-----------------------------------------+----------------------+----------------------+
| 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  Orin (nvgpu)                  N/A  | N/A              N/A |                  N/A |
| N/A   N/A  N/A               N/A /  N/A | Not Supported        |     N/A          N/A |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

However, when no monitor connected to my jetson device, all containers fail (so I cannot run Isaac Ros, etc.)

$ docker run --privileged --network host --ipc=host  -e DISPLAY -e NVIDIA_VISIBLE_DEVICES=all  -e NVIDIA_VISIBLE_DEVICES=nvidia.com/gpu=all   -ti --rm --runtime nvidia  nvidia/cuda:12.6.0-base-ubuntu22.04
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: could not apply required modification to OCI specification: error modifying OCI spec: failed to inject CDI devices: failed to inject devices: failed to stat CDI host device "/dev/fb0": no such file or directory: unknown.

I am sure I am the dumb here, but how can I configure the device that it will run nvidia containers regardless if a monitor is plugged in or not?

Hi,

Removing the -e NVIDIA_VISIBLE_DEVICES=nvidia.com/gpu=all can work correctly.

$ docker run --privileged --network host --ipc=host -e DISPLAY -e NVIDIA_VISIBLE_DEVICES=all -ti --rm --runtime nvidia  nvidia/cuda:12.6.0-base-ubuntu22.04 nvidia-smi
Tue Feb 18 07:11:07 2025       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 540.4.0                Driver Version: 540.4.0      CUDA Version: 12.6     |
|-----------------------------------------+----------------------+----------------------+
| 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  Orin (nvgpu)                  N/A  | N/A              N/A |                  N/A |
| N/A   N/A  N/A               N/A /  N/A | Not Supported        |     N/A          N/A |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

On Jetson, you don’t need to set that variable as the Orin series only has one GPU.
So it should not impact the functionality.

Thanks

1 Like

Thank you, yes, it works in that case.

My main issue is that by default this flag is set by run_dev.sh from isaac common:

I guess I can remove that line. Or shall I check what the system is and remove this line based on the host type?

Hi @tamas.foldi,

Could you please help to run the below command outside the container and try again?

sudo nvidia-ctk cdi generate --mode=csv --output=/etc/cdi/nvidia.yaml

Thanks.

this helped, thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.