Use CUDA 10.1 for Linux build (#3057)

Use CUDA 10.1 for Linux build
(Windows change is already in)

Please note, cublas 10.2.1.243 is for CUDA SDK 10.1.243, not CUDA 10.2.x. CUDA 10.2.89 need cublas 10.2.2.89. They match on the last part of the digits.

libcublas10-10.1.0.105 won't work!!!

The cuda docker image by viswamy is already using 10.1, no need to change.
This commit is contained in:
Changming Sun 2020-02-21 11:55:32 -08:00 committed by GitHub
parent be12fb3143
commit 179603775f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 41 additions and 377 deletions

View file

@ -824,7 +824,7 @@ class Graph {
Version ir_version,
IOnnxRuntimeOpSchemaCollectionPtr schema_registry,
const logging::Logger& logger,
const std::unordered_map<std::string, const ONNX_NAMESPACE::FunctionProto*>& model_functions = {});
const std::unordered_map<std::string, const ONNX_NAMESPACE::FunctionProto*>& model_functions);
// internal use by the Graph class only
Graph(ONNX_NAMESPACE::GraphProto* graph_proto,
@ -834,7 +834,7 @@ class Graph {
Graph* parent_graph,
const Node* parent_node,
const logging::Logger& logger,
const std::unordered_map<std::string, const ONNX_NAMESPACE::FunctionProto*>& model_functions = {});
const std::unordered_map<std::string, const ONNX_NAMESPACE::FunctionProto*>& model_functions);
// Add node with specified <node_proto>.
Node& AddNode(const ONNX_NAMESPACE::NodeProto& node_proto,

View file

@ -809,7 +809,7 @@ Graph::Graph(Graph& parent_graph, const Node& parent_node, ONNX_NAMESPACE::Graph
: Graph(&subgraph_proto,
parent_graph.DomainToVersionMap(), parent_graph.IrVersion(), parent_graph.schema_registry_,
&parent_graph,
&parent_node, parent_graph.logger_) {
&parent_node, parent_graph.logger_, std::unordered_map<std::string, const ONNX_NAMESPACE::FunctionProto*>()) {
}
Status Graph::VerifyNoDuplicateName() {

View file

@ -114,7 +114,7 @@ jobs:
- task: CmdLine@2
inputs:
script: |
docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build -e NIGHTLY_BUILD -e BUILD_BUILDNUMBER onnxruntime-manylinux-gpu-$(python.version) $(python.dir)/bin/python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --cmake_path /usr/bin/cmake --ctest_path /usr/bin/ctest --build_wheel --enable_onnx_tests --cmake_extra_defines PYTHON_INCLUDE_DIR=$(python.include.dir) PYTHON_LIBRARY=/usr/lib64/librt.so --use_cuda --cuda_version=10.0 --cuda_home=/usr/local/cuda-10.0 --cudnn_home=/usr/local/cuda-10.0
docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build -e NIGHTLY_BUILD -e BUILD_BUILDNUMBER onnxruntime-manylinux-gpu-$(python.version) $(python.dir)/bin/python3 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --cmake_path /usr/bin/cmake --ctest_path /usr/bin/ctest --build_wheel --enable_onnx_tests --cmake_extra_defines PYTHON_INCLUDE_DIR=$(python.include.dir) PYTHON_LIBRARY=/usr/lib64/librt.so --use_cuda --cuda_version=10.1 --cuda_home=/usr/local/cuda-10.1 --cudnn_home=/usr/local/cuda-10.1
workingDirectory: $(Build.SourcesDirectory)
- task: CopyFiles@2

View file

@ -39,7 +39,7 @@ jobs:
- task: CmdLine@2
inputs:
script: |
docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build -e NIGHTLY_BUILD onnxruntime-centos6-gpu /usr/bin/python3.6 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --cmake_path /usr/bin/cmake --ctest_path /usr/bin/ctest --use_cuda --cuda_version=10.0 --cuda_home=/usr/local/cuda-10.0 --cudnn_home=/usr/local/cuda-10.0
docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build -e NIGHTLY_BUILD onnxruntime-centos6-gpu /usr/bin/python3.6 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --cmake_path /usr/bin/cmake --ctest_path /usr/bin/ctest --use_cuda --cuda_version=10.1 --cuda_home=/usr/local/cuda-10.1 --cudnn_home=/usr/local/cuda-10.1
workingDirectory: $(Build.SourcesDirectory)
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:

View file

@ -17,7 +17,7 @@ jobs:
DoNugetPack : 'true'
DoCompliance: 'false'
DoEsrp: ${{ parameters.DoEsrp }}
CudaVersion: '10.0'
CudaVersion: '10.1'
OrtPackageId: 'Microsoft.ML.OnnxRuntime.Gpu'
NuPackScript: |
msbuild $(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj /p:Configuration=RelWithDebInfo /t:CreatePackage /p:OrtPackageId=Microsoft.ML.OnnxRuntime.Gpu
@ -40,7 +40,7 @@ jobs:
- task: CmdLine@2
inputs:
script: |
docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build -e NIGHTLY_BUILD onnxruntime-centos6-gpu /bin/bash -c "/usr/bin/python3.6 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --cmake_path /usr/bin/cmake --ctest_path /usr/bin/ctest --use_cuda --cuda_version=10.0 --cuda_home=/usr/local/cuda-10.0 --cudnn_home=/usr/local/cuda-10.0 --enable_onnx_tests && cd /build/Release && make install DESTDIR=/build/linux-x64"
docker run --gpus all -e NVIDIA_VISIBLE_DEVICES=all --rm --volume $(Build.SourcesDirectory):/onnxruntime_src --volume $(Build.BinariesDirectory):/build -e NIGHTLY_BUILD onnxruntime-centos6-gpu /bin/bash -c "/usr/bin/python3.6 /onnxruntime_src/tools/ci_build/build.py --build_dir /build --config Release --skip_submodule_sync --parallel --build_shared_lib --cmake_path /usr/bin/cmake --ctest_path /usr/bin/ctest --use_cuda --cuda_version=10.1 --cuda_home=/usr/local/cuda-10.1 --cudnn_home=/usr/local/cuda-10.1 --enable_onnx_tests && cd /build/Release && make install DESTDIR=/build/linux-x64"
- script: |
set -e -x
mv $(Build.BinariesDirectory)/linux-x64/usr/local/lib64 $(Build.BinariesDirectory)/linux-x64/linux-x64

View file

@ -1,220 +0,0 @@
parameters:
DoDebugBuild: 'true'
DoCompliance: 'false'
BuildCommand: ''
JobName: 'Windows_CI_Dev'
DoNugetPack: 'false'
NuPackScript : ''
ArtifactName: 'drop-nuget'
DoEsrp: 'false'
DoTestCoverage: 'false'
BuildArch: 'x64'
SetVcvars: 'false'
msbuildArchitecture: 'amd64'
MsbuildArguments: '/m'
EnvSetupScript: 'setup_env.bat'
CudaVersion: ''
AgentPool: 'Win-CPU-2019'
AgentDemands: []
OrtPackageId: Microsoft.ML.OnnxRuntime
jobs:
- job: ${{ parameters.JobName }}
timeoutInMinutes: 120
workspace:
clean: all
pool:
name: ${{ parameters.AgentPool }}
demands: ${{ parameters.AgentDemands }}
variables:
buildDirectory: '$(Build.BinariesDirectory)'
BuildCommand: ${{ parameters.BuildCommand }}
OnnxRuntimeBuildDirectory: '$(Build.BinariesDirectory)'
DotNetExe: 'dotnet.exe'
CUDA_VERSION: ${{ parameters.CudaVersion }}
steps:
- powershell: |
if($env:TELEMETRYGUID)
{
$length = $env:TELEMETRYGUID.length
$fileContent = "#define ENABLE_TELEMETRY`n#define TraceLoggingOptionMicrosoftTelemetry() \
TraceLoggingOptionGroup("+$env:TELEMETRYGUID.substring(1, $length-2)+")"
New-Item -Path "$(Build.SourcesDirectory)\include\onnxruntime\core\platform\windows\TraceLoggingConfigPrivate.h" -ItemType "file" -Value "$fileContent" -Force
}
displayName: 'Create TraceLoggingConfigPrivate.h For WinML Telemetry'
- template: set-test-data-variables-step.yml
- template: windows-build-tools-setup-steps.yml
parameters:
EnvSetupScript: ${{ parameters.EnvSetupScript }}
buildArch: ${{ parameters.msbuildArchitecture }}
setVcvars: ${{ parameters.SetVcvars }}
# Copy CUDA props files if needed
- ${{ if eq(parameters['CudaVersion'], '10.0') }}:
- task: PowerShell@1
displayName: 'Set CUDA path'
inputs:
scriptName: 'tools/ci_build/github/windows/set_cuda_path.ps1'
arguments: '-CudaMsbuildPath C:\local\cudaMsbuildIntegration-10.0.130-win10 -CudaVersion ${{ parameters.CudaVersion }}'
- task: CmdLine@1
displayName: 'Download test data and generate cmake config'
inputs:
filename: '$(Build.BinariesDirectory)\packages\python\python.exe'
arguments: '$(BuildCommand) --update --config Debug RelWithDebInfo'
workingDirectory: "$(Build.BinariesDirectory)"
# Build Debug Mode
- ${{ if eq(parameters['DoDebugBuild'], 'true') }}:
- task: DotNetCoreCLI@2
displayName: 'Restore nuget packages for debug build'
inputs:
command: restore
projects: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
configuration: 'Debug'
arguments: '--configuration Debug -p:Platform="Any CPU" -p:OrtPackageId=${{ parameters.OrtPackageId}}'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: VSBuild@1
displayName: 'Build Debug'
inputs:
solution: '$(Build.BinariesDirectory)\Debug\onnxruntime.sln'
platform: 'x64'
configuration: 'Debug'
msbuildArgs: ${{ parameters.MsbuildArguments }}
msbuildArchitecture: 'x64'
maximumCpuCount: true
logProjectEvents: true
workingFolder: '$(Build.BinariesDirectory)\Debug'
createLogFile: true
- task: BatchScript@1
displayName: 'Test Debug'
inputs:
filename: '$(Build.BinariesDirectory)\packages\python\python.exe'
arguments: '$(BuildCommand) --test --config Debug'
workingFolder: '$(Build.BinariesDirectory)'
- task: DotNetCoreCLI@2
displayName: 'Build C# Debug'
inputs:
command: build
projects: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
configuration: 'Debug'
arguments: '--configuration Debug -p:Platform="Any CPU" -p:OrtPackageId=${{ parameters.OrtPackageId}}'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
# Run test coverage report
- ${{ if eq(parameters['DoTestCoverage'], 'true') }}:
- template: windows-code-coverage-steps.yml
parameters:
OpenCppCoverageExe: '$(Build.BinariesDirectory)\OpenCppCoverage\OpenCppCoverage.exe'
# Build RelWithDebInfo -- this variable required to build C#
- script: |
@echo ##vso[task.setvariable variable=Configuration]RelWithDebInfo
- task: DotNetCoreCLI@2
displayName: 'Restore nuget packages for RelWithDebInfo build'
inputs:
command: restore
projects: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
configuration: 'RelWithDebInfo'
arguments: '--configuration RelWithDebInfo -p:Platform="Any CPU" -p:OrtPackageId=${{ parameters.OrtPackageId}}'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: VSBuild@1
displayName: 'Build RelWithDebInfo'
inputs:
solution: '$(Build.BinariesDirectory)\RelWithDebInfo\onnxruntime.sln'
platform: 'x64'
configuration: 'RelWithDebInfo'
msbuildArgs: ${{ parameters.MsbuildArguments }}
msbuildArchitecture: 'x64'
maximumCpuCount: true
logProjectEvents: true
workingFolder: '$(Build.BinariesDirectory)\RelWithDebInfo'
createLogFile: true
- task: BatchScript@1
displayName: 'Test RelWithDebInfo'
inputs:
filename: '$(Build.BinariesDirectory)\packages\python\python.exe'
arguments: '$(BuildCommand) --test --config RelWithDebInfo'
workingFolder: "$(Build.BinariesDirectory)"
- task: DotNetCoreCLI@2
displayName: 'Build C# RelWithDebInfo'
inputs:
command: build
projects: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
configuration: 'RelWithDebInfo'
arguments: '--configuration RelWithDebInfo -p:Platform="Any CPU" -p:OrtPackageId=${{ parameters.OrtPackageId}}'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: DotNetCoreCLI@2
displayName: 'Test C# RelWithDebInfo'
inputs:
command: test
projects: '$(Build.SourcesDirectory)\csharp\test\Microsoft.ML.OnnxRuntime.Tests\Microsoft.ML.OnnxRuntime.Tests.csproj'
configuration: 'RelWithDebInfo'
arguments: '--no-build --configuration RelWithDebInfo -p:Platform="Any CPU" -p:OrtPackageId=${{ parameters.OrtPackageId}}'
workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: PublishTestResults@2
displayName: 'Publish unit test results'
inputs:
testResultsFiles: '**\*.results.xml'
searchFolder: '$(Build.BinariesDirectory)'
testRunTitle: 'Unit Test Run'
condition: succeededOrFailed()
# Nuget packaging if needed
- ${{ if eq(parameters['DoNugetPack'], 'true') }}:
- task: BatchScript@1
displayName: 'Setup VS2017 env vars'
inputs:
filename: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat'
arguments: ${{ parameters.msbuildArchitecture }}
modifyEnvironment: true
# Esrp signing
- template: esrp_dll.yml
parameters:
FolderPath: '$(Build.BinariesDirectory)\RelWithDebInfo'
DisplayName: 'ESRP - Sign Native dlls'
DoEsrp: ${{ parameters.DoEsrp }}
- template: esrp_dll.yml
parameters:
FolderPath: '$(Build.SourcesDirectory)\csharp\src\Microsoft.ML.OnnxRuntime\bin\RelWithDebInfo'
DisplayName: 'ESRP - Sign C# dlls'
DoEsrp: ${{ parameters.DoEsrp }}
- script: |
${{ parameters.NuPackScript }}
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Create NuGet Package'
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact: drop-nuget'
inputs:
artifactName: ${{ parameters.ArtifactName }}
targetPath: '$(Build.ArtifactStagingDirectory)'
# Remove CUDA props files after build
- ${{ if eq(parameters['CudaVersion'], '10.0') }}:
- task: PowerShell@1
displayName: 'Clean up CUDA props files'
inputs:
scriptName: 'tools/ci_build/github/windows/clean_up_cuda_prop_files.ps1'
arguments: '-CudaVersion ${{ parameters.CudaVersion }}'
# Compliance tasks require logs from Debug Build
- ${{ if eq(parameters['DoCompliance'], 'true') }}:
- template: compliance.yml
- template: component-governance-component-detection-steps.yml
parameters :
condition : 'succeeded'
- template: clean-agent-build-directory-step.yml

View file

@ -16,19 +16,21 @@ RUN NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efac
COPY cuda_manylinux2010.repo /etc/yum.repos.d/cuda.repo
ENV CUDA_VERSION 10.0.130
ENV CUDA_PKG_VERSION 10-0-$CUDA_VERSION-1
ENV CUDA_VERSION 10.1.243
ENV CUDA_PKG_VERSION 10-1-$CUDA_VERSION-1
RUN yum install -y \
cuda-cudart-$CUDA_PKG_VERSION \
cuda-compat-10-1 \
cuda-libraries-$CUDA_PKG_VERSION \
cuda-nvtx-$CUDA_PKG_VERSION \
libcublas10-10.2.1.243-1 \
cuda-nvml-dev-$CUDA_PKG_VERSION \
cuda-command-line-tools-$CUDA_PKG_VERSION \
cuda-libraries-dev-$CUDA_PKG_VERSION \
cuda-minimal-build-$CUDA_PKG_VERSION \
libcublas-devel-10.2.1.243-1 \
&& \
ln -s cuda-10.0 /usr/local/cuda && \
ln -s cuda-10.1 /usr/local/cuda && \
rpm -e --nodeps gcc gcc-c++ && \
rm -rf /var/cache/yum/*
@ -42,22 +44,21 @@ ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64:${LD_LIBRARY_P
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
ENV NVIDIA_REQUIRE_CUDA "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411"
ENV NVIDIA_REQUIRE_CUDA "cuda>=10.1 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=396,driver<397 brand=tesla,driver>=410,driver<411"
ENV LIBRARY_PATH /usr/local/cuda/lib64/stubs
ENV CUDNN_VERSION 7.6.4.38
ENV CUDNN_VERSION 7.6.5.32
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
RUN CUDNN_DOWNLOAD_SUM=417bb5daf51377037eb2f5c87649000ca1b9cec0acb16cfe07cb1d3e9a961dbf && \
curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v7.6.4/cudnn-10.0-linux-x64-v7.6.4.38.tgz -O && \
echo "$CUDNN_DOWNLOAD_SUM cudnn-10.0-linux-x64-v7.6.4.38.tgz" | sha256sum -c - && \
tar --no-same-owner -xzf cudnn-10.0-linux-x64-v7.6.4.38.tgz -C /usr/local && \
rm cudnn-10.0-linux-x64-v7.6.4.38.tgz && \
/sbin/ldconfig
RUN CUDNN_DOWNLOAD_SUM=7eaec8039a2c30ab0bc758d303588767693def6bf49b22485a2c00bf2e136cb3 && \
curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v7.6.5/cudnn-10.1-linux-x64-v7.6.5.32.tgz -O && \
echo "$CUDNN_DOWNLOAD_SUM cudnn-10.1-linux-x64-v7.6.5.32.tgz" | sha256sum -c - && \
tar --no-same-owner -xzf cudnn-10.1-linux-x64-v7.6.5.32.tgz -C /usr/local && \
rm cudnn-10.1-linux-x64-v7.6.5.32.tgz && \
ldconfig
ARG BUILD_UID=1000
ARG BUILD_USER=onnxruntimedev

View file

@ -18,19 +18,21 @@ RUN NVIDIA_GPGKEY_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efac
COPY cuda_manylinux2010.repo /etc/yum.repos.d/cuda.repo
ENV CUDA_VERSION 10.0.130
ENV CUDA_PKG_VERSION 10-0-$CUDA_VERSION-1
ENV CUDA_VERSION 10.1.243
ENV CUDA_PKG_VERSION 10-1-$CUDA_VERSION-1
RUN yum install -y \
cuda-cudart-$CUDA_PKG_VERSION \
cuda-compat-10-1 \
cuda-libraries-$CUDA_PKG_VERSION \
cuda-nvtx-$CUDA_PKG_VERSION \
libcublas10-10.2.1.243-1 \
cuda-nvml-dev-$CUDA_PKG_VERSION \
cuda-command-line-tools-$CUDA_PKG_VERSION \
cuda-libraries-dev-$CUDA_PKG_VERSION \
cuda-minimal-build-$CUDA_PKG_VERSION \
libcublas-devel-10.2.1.243-1 \
&& \
ln -s cuda-10.0 /usr/local/cuda && \
ln -s cuda-10.1 /usr/local/cuda && \
rpm -e --nodeps gcc gcc-c++ && \
rm -rf /var/cache/yum/*
@ -44,20 +46,20 @@ ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64:${LD_LIBRARY_P
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
ENV NVIDIA_REQUIRE_CUDA "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=410,driver<411"
ENV NVIDIA_REQUIRE_CUDA "cuda>=10.1 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=396,driver<397 brand=tesla,driver>=410,driver<411"
ENV LIBRARY_PATH /usr/local/cuda/lib64/stubs
ENV CUDNN_VERSION 7.6.4.38
ENV CUDNN_VERSION 7.6.5.32
LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"
# cuDNN license: https://developer.nvidia.com/cudnn/license_agreement
RUN CUDNN_DOWNLOAD_SUM=417bb5daf51377037eb2f5c87649000ca1b9cec0acb16cfe07cb1d3e9a961dbf && \
curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v7.6.4/cudnn-10.0-linux-x64-v7.6.4.38.tgz -O && \
echo "$CUDNN_DOWNLOAD_SUM cudnn-10.0-linux-x64-v7.6.4.38.tgz" | sha256sum -c - && \
tar --no-same-owner -xzf cudnn-10.0-linux-x64-v7.6.4.38.tgz -C /usr/local && \
rm cudnn-10.0-linux-x64-v7.6.4.38.tgz && \
RUN CUDNN_DOWNLOAD_SUM=7eaec8039a2c30ab0bc758d303588767693def6bf49b22485a2c00bf2e136cb3 && \
curl -fsSL http://developer.download.nvidia.com/compute/redist/cudnn/v7.6.5/cudnn-10.1-linux-x64-v7.6.5.32.tgz -O && \
echo "$CUDNN_DOWNLOAD_SUM cudnn-10.1-linux-x64-v7.6.5.32.tgz" | sha256sum -c - && \
tar --no-same-owner -xzf cudnn-10.1-linux-x64-v7.6.5.32.tgz -C /usr/local && \
rm cudnn-10.1-linux-x64-v7.6.5.32.tgz && \
ldconfig

View file

@ -1,8 +1,4 @@
# Tag: nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04
# Label: com.nvidia.cuda.version: 10.0.130
# Label: com.nvidia.cudnn.version: 7.3.1.20
# Ubuntu 16.04.5
FROM nvidia/cuda@sha256:362e4e25aa46a18dfa834360140e91b61cdb0a3a2796c8e09dadb268b9de3f6b
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04
ARG PYTHON_VERSION=3.5

View file

@ -1,10 +1,10 @@
#!/bin/bash
set -e
dnf install -y --best --allowerasing redhat-lsb-core expat-devel libcurl-devel protobuf-compiler protobuf-devel protobuf compat-openssl10 lttng-ust libcurl openssl-libs krb5-libs libicu tar unzip ccache curl gcc gcc-c++ zlib-devel make git python2-devel python3-devel python3-numpy libunwind icu aria2 rsync python3-setuptools python3-wheel bzip2
#install cuda 9.2 and cudnn 7
aria2c -q -d /tmp 'http://developer.download.nvidia.com/compute/cuda/repos/fedora27/x86_64/cuda-repo-fedora27-10.0.130-1.x86_64.rpm'
dnf install -y /tmp/cuda-repo-fedora27-10.0.130-1.x86_64.rpm
dnf install -y cuda-10.0.130-1.x86_64
tar -zxvf cudnn-10.0-linux-x64-v7.4.2.24.tgz --strip 1 -C /usr/local
#install cuda 10.1 and cudnn 7
aria2c -q -d /tmp 'http://developer.download.nvidia.com/compute/cuda/repos/fedora29/x86_64/cuda-repo-fedora29-10.1.243-1.x86_64.rpm'
dnf install -y /tmp/cuda-repo-fedora29-10.1.243-1.x86_64.rpm
dnf install -y cuda-10.1.243-1.x86_64
tar -zxvf cudnn-10.1-linux-x64-v7.6.4.38.tgz --strip 1 -C /usr/local
ldconfig -v /usr/local/cuda/lib64 /usr/local/lib64

View file

@ -3,7 +3,7 @@ set -e -o -x
SCRIPT_DIR="$( dirname "${BASH_SOURCE[0]}" )"
SOURCE_ROOT=$(realpath $SCRIPT_DIR/../../../../)
CUDA_VER=cuda10.0-cudnn7.3
CUDA_VER=cuda10.1-cudnn7.6
YOCTO_VERSION="4.19"
while getopts c:o:d:r:p:x:a:v:y: parameter_Option

View file

@ -1,16 +0,0 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#Clean up CUDA props files
Param(
[Parameter(Mandatory=$True)]
[string]$CudaVersion
)
$Dst = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations"
Write-Host "Clean up CUDA prop files"
Remove-Item $(Join-Path $Dst "CUDA ${CudaVersion}.props")
Remove-Item $(Join-Path $Dst "CUDA ${CudaVersion}.targets")
Remove-Item $(Join-Path $Dst "CUDA ${CudaVersion}.xml")
Remove-Item $(Join-Path $Dst "Nvda.Build.CudaTasks.v${CudaVersion}.dll")

View file

@ -1,81 +0,0 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Runs OpenCppCoverage for the Lotus unit tests and ONNX tests, and merges the coverage from all test runs.
Param(
[Parameter(Mandatory=$true, HelpMessage="OpenCppCoverage exe.")][string]$OpenCppCoverageExe,
[Parameter(Mandatory=$true, HelpMessage="Lotus enlistment root.")][string]$SourceRoot,
[Parameter(Mandatory=$true, HelpMessage="Build root.")][string]$BuildRoot,
[Parameter(Mandatory=$false, HelpMessage="IsLocalBuild")][switch]$LocalBuild = $true
)
if (-not $LocalBuild) {
# This is a hack to get the target path of the junctions in the build machine, lacking a neater way to do this.
# Assumes that the junction is 2 level upper from the SourceRoot/BuildRoot
# This is needed, because apparently the OpenCppCoverage cannot load the PDB symbol files from a junction
$buildLeaf = Split-Path $BuildRoot -Leaf
$buildParent = Split-Path $BuildRoot -Parent
$buildParentLeaf = Split-Path $buildParent -Leaf
$buildParentParent = Split-Path $buildParent -Parent
$buildParentParentTarget = Get-Item $buildParentParent | Select-Object -ExpandProperty Target
$BuildRoot = Join-Path $buildParentParentTarget $buildParentLeaf
$BuildRoot = Join-Path $BuildRoot $buildLeaf
}
$coreSources = Join-Path $SourceRoot "onnxruntime\core"
$headerSources = Join-Path $SourceRoot "include"
$buildDir = Join-Path $BuildRoot "Debug\Debug"
function RunTest([string]$test_cmd, [string[]]$test_cmd_args, [string[]]$export_types, [string[]]$inputs)
{
$cmd = "$OpenCppCoverageExe"
$cmdParams = @("--sources=$headerSources","--sources=$coreSources","--modules=$buildDir","--working_dir=$buildDir")
foreach($input in $inputs)
{
$inputPath = Join-Path $buildDir $input
$cmdParams += "--input_coverage=$inputPath"
}
foreach($export_type in $export_types)
{
$cmdParams += "--export_type=$export_type"
}
$cmdParams += @("--","$test_cmd")
$cmdParams += $test_cmd_args
& $cmd $cmdParams
}
# generate cobertura xml output and html report
$outputXml = Join-Path $buildDir "cobertura.xml"
$outputDir = Join-Path $buildDir "OpenCppCoverageResults"
$modelDir = Join-Path $BuildRoot "models"
Write-Host "ONNX test runner tests"
$onnx_test_runner = Join-Path $buildDir "onnx_test_runner.exe"
RunTest $onnx_test_runner ($modelDir) ("binary:" + (Join-Path $buildDir "onnx_test_runner.cov"))
Write-Host "C-API/Shared-lib test"
$shared_lib_test = Join-Path $buildDir "onnxruntime_shared_lib_test.exe"
RunTest $shared_lib_test @() ("binary:" + (Join-Path $buildDir "onnxruntime_shared_lib_test.cov"))
Write-Host "MLAS test"
$mlas_test = Join-Path $buildDir "onnxruntime_mlas_test.exe"
RunTest $mlas_test @() ("binary:" + (Join-Path $buildDir "onnxruntime_mlas_test.cov"))
Write-Host "Lotus unit tests"
# need to copy the tvm.dll, since it is not in the buildDir path
if (Test-Path -Path $BuildRoot\Debug\external\tvm\Debug\tvm.dll -PathType Leaf) {
Copy-Item -Path $BuildRoot\Debug\external\tvm\Debug\tvm.dll -Destination $buildDir
}
$onnxruntime_test_all = Join-Path $buildDir "onnxruntime_test_all.exe"
RunTest $onnxruntime_test_all @() ("cobertura:$outputXml","html:$outputDir") ("onnxruntime_shared_lib_test.cov","onnx_test_runner.cov","onnxruntime_mlas_test.cov")

View file

@ -1,18 +0,0 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#Copy CUDA props files
Param(
[Parameter(Mandatory=$True)]
[string]$CudaMsbuildPath,
[string]$CudaVersion
)
$CudaMsbuildPath=$(Join-Path $CudaMsbuildPath "V141\BuildCustomizations")
$Dst = $(Join-Path "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community" "Common7\IDE\VC\VCTargets\BuildCustomizations")
Write-Host "Copy CUDA prop files"
Copy-Item $(Join-Path $CudaMsbuildPath "CUDA ${CudaVersion}.props") -Destination $Dst
Copy-Item $(Join-Path $CudaMsbuildPath "CUDA ${CudaVersion}.targets") -Destination $Dst
Copy-Item $(Join-Path $CudaMsbuildPath "CUDA ${CudaVersion}.xml") -Destination $Dst
Copy-Item $(Join-Path $CudaMsbuildPath "Nvda.Build.CudaTasks.v${CudaVersion}.dll") -Destination $Dst