Skip to content

Commit 01f40e6

Browse files
eserscorCopilot
andauthored
Fix GPU JAR testing on Linux (#27011)
### Description Fix GPU JAR testing ### Motivation and Context Testing JAR for GPU was missing libcustom_library.so on Linux. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ef7d2f6 commit 01f40e6

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

tools/ci_build/github/azure-pipelines/templates/final-jar-testing-linux.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ stages:
6363
mavenVersionOption: 'Default'
6464

6565
- task: Bash@3
66-
displayName: 'Run Java Tests on Linux/macOS'
67-
condition: and(succeeded(), in(variables['Agent.OS'], 'Linux', 'Darwin'))
66+
displayName: 'Run Java Tests on Linux'
67+
# condition: and(succeeded(), in(variables['Agent.OS'], 'Linux', 'Darwin'))
68+
# MacOS packages have been removed from the JAR here:
69+
# https://github.com/microsoft/onnxruntime/commit/5ed340f7a51f3cbdb62577a874daf2b3f23d6a93#diff-a14cc5ea231eb4fa49f13510a242043c47ae48516c860f8a87b0e55762632f49
70+
condition: and(succeeded(), in(variables['Agent.OS'], 'Linux'))
6871
inputs:
6972
targetType: 'inline'
7073
script: |
@@ -85,7 +88,7 @@ stages:
8588
ls $(Pipeline.Workspace)/build/tests
8689
echo "Java Version"
8790
java -version
88-
91+
8992
# Set the correct library path based on the OS
9093
os_name=$(uname)
9194
if [[ "$os_name" == "Linux" ]]; then

tools/ci_build/github/linux/java_linux_final_test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ mkdir tests
3333
cd tests
3434
jar xf ../onnxruntime-java/testing.jar
3535
rm -f ../onnxruntime-java/testing.jar
36+
echo "Contents of tests directory ($BINARY_DIR/tests):"
37+
ls "$BINARY_DIR/tests"
3638
echo "Java Version"
3739
java -version
3840

3941
echo "Directories created"
4042
echo "Library path:" "$LD_LIBRARY_PATH"
4143

42-
java -DUSE_CUDA=1 -cp "$BINARY_DIR/tests:$BINARY_DIR/onnxruntime-java/*" org.junit.platform.console.ConsoleLauncher --scan-classpath=$BINARY_DIR/tests \
44+
java -DUSE_CUDA=1 -cp "$BINARY_DIR/tests:$BINARY_DIR/onnxruntime-java/*" org.junit.platform.console.ConsoleLauncher --scan-classpath="$BINARY_DIR/tests" \
4345
--fail-if-no-tests --disable-banner

tools/ci_build/github/windows/jar_packaging.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,7 @@ def run_packaging(package_type: str, build_dir: str):
235235
]
236236
},
237237
"gpu": {
238-
"platforms": [
239-
{"path": "onnxruntime-java-linux-x64", "lib": "libcustom_op_library.so", "archive_lib": False}
240-
]
238+
"platforms": [{"path": "onnxruntime-java-linux-x64", "lib": "libcustom_op_library.so", "archive_lib": True}]
241239
},
242240
}
243241

0 commit comments

Comments
 (0)