Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/ramalama-bench.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ write, and m for mknod(2).

Example: --device=/dev/dri/renderD128:/dev/xvdc:rwm

The device specification is passed directly to the underlying container engine. See documentation of the supported container engine for more information.

Pass '--device=none' explicitly add no device to the container, eg for
running a CPU-only performance comparison.

#### **--env**=

Set environment variables inside of the container.
Expand Down
3 changes: 3 additions & 0 deletions docs/ramalama-run.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Example: --device=/dev/dri/renderD128:/dev/xvdc:rwm

The device specification is passed directly to the underlying container engine. See documentation of the supported container engine for more information.

Pass '--device=none' explicitly add no device to the container, eg for
running a CPU-only performance comparison.

#### **--env**=

Set environment variables inside of the container.
Expand Down
3 changes: 3 additions & 0 deletions docs/ramalama-serve.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ Example: --device=/dev/dri/renderD128:/dev/xvdc:rwm

The device specification is passed directly to the underlying container engine. See documentation of the supported container engine for more information.

Pass '--device=none' explicitly add no device to the container, eg for
running a CPU-only performance comparison.

#### **--dri**=*on* | *off*
Enable or disable mounting `/dev/dri` into the container when running with `--api=llama-stack` (enabled by default). Use to prevent access to the host device when not required, or avoid errors in environments where `/dev/dri` is not available.

Expand Down
6 changes: 5 additions & 1 deletion ramalama/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,11 @@ def runtime_options(parser, command):
"-d", "--detach", action="store_true", dest="detach", help="run the container in detached mode"
)
parser.add_argument(
"--device", dest="device", action='append', type=str, help="device to leak in to the running container"
"--device",
dest="device",
action='append',
type=str,
help="device to leak in to the running container (or 'none' to pass no device)",
)
parser.add_argument(
"--env",
Expand Down
4 changes: 4 additions & 0 deletions ramalama/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def add_port_option(self):
self.exec_args += ["-p", f"{host}{self.args.port}:{self.args.port}"]

def add_device_options(self):
request_no_device = getattr(self.args, "device", None) == ['none']
if request_no_device:
return

if getattr(self.args, "device", None):
for device_arg in self.args.device:
self.exec_args += ["--device", device_arg]
Expand Down
Loading