-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6b2291
commit 519f303
Showing
6 changed files
with
85 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM ubuntu:24.04 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
wget \ | ||
curl \ | ||
python3 \ | ||
python3-pip \ | ||
gnupg \ | ||
software-properties-common && \ | ||
add-apt-repository 'deb http://archive.ubuntu.com/ubuntu jammy main universe' && \ | ||
apt-get update && \ | ||
apt-get install -y libtinfo5 && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb && \ | ||
dpkg -i cuda-keyring_1.0-1_all.deb && \ | ||
rm cuda-keyring_1.0-1_all.deb && \ | ||
apt-get update | ||
|
||
RUN apt-get install -y cuda-toolkit-12-2 | ||
|
||
ENV PATH=/usr/local/cuda-12.2/bin:${PATH} | ||
ENV LD_LIBRARY_PATH=/usr/local/cuda-12.2/lib64 | ||
|
||
ENV SCUDA_SERVER=71.183.65.76 | ||
ENV libscuda_path=/usr/local/lib/libscuda.so | ||
|
||
COPY ./libscuda.so /usr/local/lib/libscuda.so | ||
|
||
COPY --from=samples . /app/cuda-sample | ||
|
||
RUN cd /app/cuda-sample/0_Simple/matrixMulCUBLAS && make build | ||
|
||
RUN cp /app/cuda-sample/0_Simple/matrixMulCUBLAS/matrixMulCUBLAS /matrixMulCUBLAS | ||
|
||
COPY start.sh /start.sh | ||
RUN chmod +x /start.sh | ||
RUN chmod +x /matrixMulCUBLAS | ||
|
||
CMD ["/bin/bash", "/start.sh", "cublas"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
echo "Connecting to SCUDA server at: $SCUDA_SERVER" | ||
echo "Using scuda binary at path: $libscuda_path" | ||
|
||
if [[ "$1" == "torch" ]]; then | ||
echo "Running torch example..." | ||
LD_PRELOAD="$libscuda_path" python3 -c "import torch; print('CUDA Available:', torch.cuda.is_available())" | ||
elif [[ "$1" == "cublas" ]]; then | ||
echo "Running cublas example..." | ||
|
||
LD_PRELOAD="$libscuda_path" /matrixMulCUBLAS | ||
else | ||
echo "Unknown option: $1. Please specify 'torch' or 'cublas'." | ||
fi |