Skip to content

Commit

Permalink
run with nvidia gpus (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
stingshen authored Apr 17, 2022
1 parent cdeedbc commit ba83bb4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.14.4
0.15.0
3 changes: 3 additions & 0 deletions dochat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ function main () {
for DEVICE in /dev/video* /dev/snd; do
DEVICE_ARG+=('--device' "$DEVICE")
done
if [[ $(lshw -C display | grep vendor) =~ NVIDIA ]]; then
DEVICE_ARG+=('--gpus' 'all' '--env' 'NVIDIA_DRIVER_CAPABILITIES=all')
fi

echo '🚀 Starting DoChat /dɑɑˈtʃæt/ ...'
echo
Expand Down
7 changes: 5 additions & 2 deletions scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ set -x
OPTIONS=()

if [ -f /dev/snd ]; then
OPTIONS+=('--device /dev/snd')
OPTIONS+=('--device' '/dev/snd')
fi
if [ -f /dev/video0 ]; then
OPTIONS+=('--device /dev/video0')
OPTIONS+=('--device' '/dev/video0')
fi
if [[ $(lshw -C display | grep vendor) =~ NVIDIA ]]; then
OPTIONS+=('--gpus' 'all' '--env' 'NVIDIA_DRIVER_CAPABILITIES=all')
fi

docker run \
Expand Down

0 comments on commit ba83bb4

Please sign in to comment.