Skip to content

pytorch fails to work inside sandbox with standard nvcr.io/nvidia/pytorch container out of box #6159

Backlog

Description

@dmonakhov

User Story

pytorch fails to work inside sandbox with standard nvcr.io/nvidia/pytorch container out of box.
So trivial torch check fail with scary message which is not clear for majority of non technical people:

openshell sandbox create --name torch-default --gpu \
     --from nvcr.io/nvidia/pytorch:26.10-py3 --no-keep -- python3 -c "import torch"
    Created sandbox: torch-default                                                                                                                                                                                                                                                                                              
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.12/dist-packages/torch/__init__.py", line 504, in <module>
    _load_global_deps()
  File "/usr/local/lib/python3.12/dist-packages/torch/__init__.py", line 462, in _load_global_deps
    _preload_cuda_deps(err)
  File "/usr/local/lib/python3.12/dist-packages/torch/__init__.py", line 388, in _preload_cuda_deps
    raise err
  File "/usr/local/lib/python3.12/dist-packages/torch/__init__.py", line 433, in _load_global_deps
    ctypes.CDLL(global_deps_lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/usr/lib/python3.12/ctypes/__init__.py", line 379, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: libmpi.so.40: cannot open shared object file: No such file or directory
✓ Sandbox torch-default deletion accepted; cleanup is pending

Problem Statement

By default openshell sandbox does not allow to access /opt but it is mandatory for torch to load library from /opt/hpcx,
also it restrict access to /sys/, which makes it impossible for container to read system topology like /sys/devices/system/cpu, as result nccl will not able to bind tasks to correct CPUs.

Impact / Why This Matters

Openshell is the only sandbox which allow to use GPU's inside, so we MUST support pytorch containers to attract users.

Acceptance Criteria

  • nvcr.io/nvidia/pytorch container works

Reproduction Steps

openshell sandbox create \
  --name torch-check \
  --gpu \
  --from nvcr.io/nvidia/pytorch:25.11-py3 \
  --policy policy.yaml \
  --no-keep --no-tty \
  -- python -c 'import torch; print(torch.__version__, torch.cuda.is_available(), torch.cuda.device_count()); x = torch.ones(1024, device="cuda"); print("sum", (x * 2).sum().item())'

Suggested UX (if applicable)

No response

Environment

Issue is environment agnostic

Logs

Activity

  1. added theissue type on Dec 2, 2026
  2. added
    state:triage-needed
    on Dec 2, 2026
  3. added
    state:needs-info
    and removed
    state:triage-needed
    on Dec 3, 2026
  4. purp commented on Dec 3, 2026

    @purp
    Contributor

    📋 triage-agent

    Thanks for the report and the example in #6158. The restrictive default policy does not grant /opt or /sys, which is consistent with the reported behavior, but we haven't verified the cause or the proposed policy on a GPU deployment yet.

    Could you share:

    • Whether you encountered this in your own OpenShell setup and the PyTorch workload you need to run.
    • Your OpenShell version, compute driver, host OS, GPU and NVIDIA driver version, and the effective policy selected for the failing run (an image or environment variable can supply a policy even without --policy).
    • The policy.yaml used in the reproduction and the output of running the same image tag both without that policy and with the policy proposed in docs(examples): add NGC PyTorch GPU sandbox example #6158. The report uses 26.10-py3 for the failure and 25.11-py3 for the reproduction; using the same tag would help isolate the difference.
    • If available, a separate reproduction and output for the /sys topology or NCCL impact, since the import failure alone does not establish that behavior.

    These details will help confirm the cause and whether the example policy addresses the reported workload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:needs-info

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions