Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding test with docker #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
41 changes: 41 additions & 0 deletions insmod_root.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.

THIS_DIR=$(dirname $0)

# remove driver
grep gdrdrv /proc/devices >/dev/null && /sbin/rmmod gdrdrv

# insert driver
/sbin/insmod gdrdrv/gdrdrv.ko dbg_enabled=0 info_enabled=0

# create device inodes
major=`fgrep gdrdrv /proc/devices | cut -b 1-4`
echo "INFO: driver major is $major"

# remove old inodes just in case
if [ -e /dev/gdrdrv ]; then
rm /dev/gdrdrv
fi

echo "INFO: creating /dev/gdrdrv inode"
mknod /dev/gdrdrv c $major 0
chmod a+w+r /dev/gdrdrv
20 changes: 20 additions & 0 deletions install_gdrcopy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

#git clone -b master https://github.com/NVIDIA/gdrcopy.git /tmp/gdrcopy
cd /tmp/gdrcopy/
mkdir prefix
make PREFIX=./prefix/ CUDA=/usr/local/cuda/ all install

echo "### Run insmod.sh ###"
apt-get update && apt-get install -y kmod
./insmod_root.sh

echo "### lsmod ###"
lsmod |grep "gdr"

echo "### validate ###"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.2/lib64/:$PWD/prefix/lib64
./validate

echo "### copybw ###"
./copybw
4 changes: 4 additions & 0 deletions test_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

#nvidia-docker run -ti --privileged --cap-add=ALL -v /lib/modules:/lib/modules -v /usr/src:/usr/src -v $PWD/:/tmp/gdrcopy nvidia/cuda:11.0-devel-ubuntu16.04 bash
nvidia-docker run -ti --privileged --cap-add=ALL -v /lib/modules:/lib/modules -v /usr/src:/usr/src -v $PWD/:/tmp/gdrcopy nvidia/cuda:9.2-devel-ubuntu16.04 /tmp/gdrcopy/install_gdrcopy.sh