Skip to content

Commit 90ef1ab

Browse files
committed
Fix cudnn location
1 parent 8310314 commit 90ef1ab

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

tools/gen_ort_dockerfile.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -159,16 +159,6 @@ def dockerfile_for_linux(output_file):
159159
160160
RUN python3 -m pip install psutil
161161
162-
"""
163-
if FLAGS.enable_gpu:
164-
df += """
165-
# Allow configure to pick up cuDNN where it expects it.
166-
# (Note: $CUDNN_VERSION is defined by base image)
167-
RUN _CUDNN_VERSION=$(echo $CUDNN_VERSION | cut -d. -f1-2) && \
168-
mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/include && \
169-
ln -s /usr/include/cudnn.h /usr/local/cudnn-$_CUDNN_VERSION/cuda/include/cudnn.h && \
170-
mkdir -p /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64 && \
171-
ln -s /etc/alternatives/libcudnn_so /usr/local/cudnn-$_CUDNN_VERSION/cuda/lib64/libcudnn.so
172162
"""
173163

174164
if FLAGS.ort_openvino is not None:
@@ -397,7 +387,7 @@ def dockerfile_for_linux(output_file):
397387
"""
398388
df += """
399389
RUN cd /opt/onnxruntime/lib && \
400-
for i in `find . -mindepth 1 -maxdepth 1 -type f -name '*\.so*'`; do \
390+
for i in `find . -mindepth 1 -maxdepth 1 -type f -name '*\\.so*'`; do \
401391
patchelf --set-rpath '$ORIGIN' $i; \
402392
done
403393
@@ -478,7 +468,7 @@ def dockerfile_for_windows(output_file):
478468

479469
df += """
480470
WORKDIR /workspace/onnxruntime
481-
ARG VS_DEVCMD_BAT="\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
471+
ARG VS_DEVCMD_BAT="\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat"
482472
RUN powershell Set-Content 'build.bat' -value 'call %VS_DEVCMD_BAT%',(Get-Content 'build.bat')
483473
RUN build.bat --cmake_generator "Visual Studio 17 2022" --config Release --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=75;80;86;90" --skip_submodule_sync --parallel --build_shared_lib --compile_no_warning_as_error --skip_tests --update --build --build_dir /workspace/build {}
484474
""".format(
@@ -561,12 +551,8 @@ def preprocess_gpu_flags():
561551
FLAGS.tensorrt_home = "/tensorrt"
562552
else:
563553
if "CUDNN_VERSION" in os.environ:
564-
version = None
565-
m = re.match(r"([0-9]\.[0-9])\.[0-9]\.[0-9]", os.environ["CUDNN_VERSION"])
566-
if m:
567-
version = m.group(1)
568554
if FLAGS.cudnn_home is None:
569-
FLAGS.cudnn_home = "/usr/local/cudnn-{}/cuda".format(version)
555+
FLAGS.cudnn_home = "/usr"
570556

571557
if FLAGS.cuda_home is None:
572558
FLAGS.cuda_home = "/usr/local/cuda"

0 commit comments

Comments
 (0)