mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2026-08-29 04:07:02 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
489e3eda6f | ||
|
|
b00f1d5d78 | ||
|
|
8fea46853e | ||
|
|
a41692add1 | ||
|
|
b012806b86 | ||
|
|
b9b464d2cc | ||
|
|
20fa7018bc | ||
|
|
401d990381 |
@@ -27,7 +27,7 @@ jobs:
|
||||
-e SC2153
|
||||
-
|
||||
name: Lint Dockerfile
|
||||
uses: hadolint/hadolint-action@v3.4.0
|
||||
uses: hadolint/hadolint-action@v3.5.0
|
||||
with:
|
||||
dockerfile: Dockerfile
|
||||
ignore: DL3008,DL3067
|
||||
|
||||
+2
-3
@@ -1,9 +1,8 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM qemux/qemu-host:2.06 AS host
|
||||
FROM scratch
|
||||
|
||||
COPY --from=qemux/qemu:7.48 / /
|
||||
COPY --from=qemux/qemu:7.49 / /
|
||||
|
||||
ARG VERSION_ARG="0.0"
|
||||
ARG VERSION_CSTRUCT="4.7"
|
||||
@@ -34,8 +33,8 @@ EOF
|
||||
|
||||
COPY --chmod=755 ./src /run/
|
||||
COPY --chmod=755 ./web /var/www/
|
||||
COPY --chmod=755 --from=host /qemu-host.bin /run/host.bin
|
||||
COPY --chmod=744 ./web/conf/nginx.conf /etc/nginx/default.conf
|
||||
COPY --chmod=755 --from=qemux/qemu-host:2.06 /qemu-host.bin /run/host.bin
|
||||
ADD --chmod=775 https://raw.githubusercontent.com/sud0woodo/patology/refs/heads/main/patology.py /run/extract.py
|
||||
|
||||
VOLUME /storage
|
||||
|
||||
+5
-3
@@ -25,6 +25,7 @@ An empty default means the variable is unset and its value is determined automat
|
||||
| `HOST_CPU` | | CPU name reported to DSM. Selected automatically when unset. |
|
||||
| `KVM` | `Y` | Enables KVM hardware acceleration. |
|
||||
| `RAM_SIZE` | `2G` | Amount of RAM assigned to DSM, such as `2G`, `4G`, `half`, or `max`. |
|
||||
| `RAM_BACKEND` | | Guest RAM backing mechanism, set `memfd` for memfd-backed memory. |
|
||||
| `RAM_CHECK` | `Y` | Checks whether enough host memory is available before starting DSM. |
|
||||
|
||||
## 💾 Storage
|
||||
@@ -72,7 +73,8 @@ An empty default means the variable is unset and its value is determined automat
|
||||
|---|---|---|
|
||||
| `DISPLAY` | `none` | Display backend, such as `vnc`, `disabled`, or `none`. |
|
||||
| `VGA` | `none` | QEMU video adapter model. |
|
||||
| `GPU` | `N` | Enables experimental GPU acceleration. |
|
||||
| `GPU` | `N` | Enables GPU acceleration. |
|
||||
| `VRAM_SIZE` | `4G` | Virtual GPU memory budget. |
|
||||
| `RENDERNODE` | `/dev/dri/renderD128` | Render node used for GPU acceleration. |
|
||||
|
||||
## 🎈 Memory Ballooning
|
||||
@@ -108,6 +110,6 @@ Also see [Dynamic memory allocation](https://github.com/qemus/qemu/blob/master/d
|
||||
| `DEBUG` | `N` | Enables verbose debug output. |
|
||||
| `TRACE` | `N` | Enables shell command tracing. |
|
||||
| `HOST_DEBUG` | `N` | Enables debug output for the DSM host helper. |
|
||||
| `MONITOR` | | QEMU monitor configuration. |
|
||||
| `QMP` | | QEMU Machine Protocol configuration. |
|
||||
| `MONITOR` | | QEMU monitor, such as `/storage/monitor.sock` or `4444`. |
|
||||
| `QMP` | | QEMU Machine Protocol, such as `/storage/qmp.sock` or `4444`. |
|
||||
| `ARGUMENTS` | | Additional raw arguments appended to the QEMU command line. |
|
||||
|
||||
@@ -203,7 +203,7 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
|
||||
|
||||
### How do I enable GPU acceleration?
|
||||
|
||||
To enable hardware-accelerated graphics, add the following lines to your compose file:
|
||||
To enable GPU acceleration using an Intel or AMD GPU, add the following lines to your compose file:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
@@ -212,7 +212,24 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
|
||||
- /dev/dri
|
||||
```
|
||||
|
||||
This can be used to enable the facial recognition function in Synology Photos, but does not provide hardware transcoding for video.
|
||||
For NVIDIA GPUs, the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html) must be installed on the host and the GPU must be exposed to the container:
|
||||
|
||||
```yaml
|
||||
environment:
|
||||
GPU: "Y"
|
||||
NVIDIA_DRIVER_CAPABILITIES: "all"
|
||||
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: all
|
||||
capabilities:
|
||||
- gpu
|
||||
```
|
||||
|
||||
GPU acceleration can be used to enable the facial recognition function in Synology Photos, but currently does not provide hardware transcoding for video yet.
|
||||
|
||||
### How do I enable dynamic memory allocation?
|
||||
|
||||
|
||||
+42
-5
@@ -31,17 +31,54 @@ configureMemory() {
|
||||
return 0
|
||||
}
|
||||
|
||||
normalizeSocket() {
|
||||
|
||||
local value="$1"
|
||||
local backend="${value%%,*}"
|
||||
|
||||
if [[ "$backend" == *.sock && "$backend" != *:* ]]; then
|
||||
value="unix:$value"
|
||||
[[ ",$value," == *,server=* ]] || value+=",server=on"
|
||||
if [[ ",$value," != *,wait=* ]] && [[ ",$value," != *,server=off,* ]]; then
|
||||
value+=",wait=off"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$value"
|
||||
}
|
||||
|
||||
normalizePort() {
|
||||
|
||||
local value="$1"
|
||||
local protocol="$2"
|
||||
|
||||
if [[ "$value" =~ ^[0-9]+$ ]]; then
|
||||
value="$protocol:0.0.0.0:$value,server=on,wait=off"
|
||||
fi
|
||||
|
||||
echo "$value"
|
||||
}
|
||||
|
||||
configureMonitor() {
|
||||
|
||||
MON_OPTS=""
|
||||
[ -n "$QMP" ] && MON_OPTS+=" -qmp $QMP"
|
||||
[ -n "$MONITOR" ] && MON_OPTS+=" -monitor $MONITOR"
|
||||
MON_OPTS="${MON_OPTS# }"
|
||||
|
||||
local name="${APP// /-}"
|
||||
ID_OPTS="-name $name,process=$PROCESS,debug-threads=on"
|
||||
if [ -n "$MONITOR" ]; then
|
||||
MONITOR=$(normalizePort "$MONITOR" "telnet")
|
||||
MONITOR=$(normalizeSocket "$MONITOR")
|
||||
MON_OPTS+=" -monitor $MONITOR"
|
||||
fi
|
||||
|
||||
if [ -n "$QMP" ]; then
|
||||
QMP=$(normalizePort "$QMP" "tcp")
|
||||
QMP=$(normalizeSocket "$QMP")
|
||||
MON_OPTS+=" -qmp $QMP"
|
||||
fi
|
||||
|
||||
ID_OPTS="-name ${APP// /-},process=$PROCESS"
|
||||
PID_OPTS="-pidfile $QEMU_PID"
|
||||
|
||||
MON_OPTS="${MON_OPTS# }"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ addSystemDisks() {
|
||||
setOwner "$boot" || warn "failed to set the owner for \"$boot\" !"
|
||||
setOwner "$system" || warn "failed to set the owner for \"$system\" !"
|
||||
|
||||
DISK_OPTS+=$(createDevice "$boot" "$DISK_TYPE" "1" "0xa" "raw" "$DISK_IO" "$DISK_CACHE" "" "" "synoboot")
|
||||
DISK_OPTS+=$(createDevice "$system" "$DISK_TYPE" "2" "0xb" "raw" "$DISK_IO" "$DISK_CACHE" "" "" "synosys")
|
||||
DISK_OPTS+=$(createDevice "$boot" "$DISK_TYPE" "1" "0xa" "raw" "" "" "synoboot")
|
||||
DISK_OPTS+=$(createDevice "$system" "$DISK_TYPE" "2" "0xb" "raw" "" "" "synosys")
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user