-
Notifications
You must be signed in to change notification settings - Fork 94
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
JavaCPP dependency fixup #605
base: remove-javacv
Are you sure you want to change the base?
Conversation
@@ -36,7 +42,7 @@ public AssimpOpenedFile(long assimpFileIOAddress, long fileNameAddress, long ope | |||
throw new RuntimeException(message.get()); | |||
} | |||
|
|||
byte[] byteArray = ExceptionTools.handle(() -> IOUtils.toByteArray(url), DefaultExceptionHandler.MESSAGE_AND_STACKTRACE); | |||
byte[] byteArray = ExceptionTools.handle(() -> Files.readAllBytes(filePath), DefaultExceptionHandler.MESSAGE_AND_STACKTRACE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, IOUtils changed after the dependencies changed. I don't think we should have been using that anyway, since we can just use the java nio Files API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it changed because we have multiple apache commons on the classpath and the load order changed or something, idk
@@ -17,7 +17,9 @@ mainDependencies { | |||
exclude(group = "org.jmonkeyengine") | |||
exclude(group = "org.lwjgl.lwjgl") // exclude lwjgl 2 | |||
} | |||
api("us.ihmc:promp-java:1.0.0") | |||
api("us.ihmc:promp-java:1.0.0") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
promp-java uses org.bytedeco:javacpp, which we want to exclude in favor of us.ihmc:javacpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably want to re-release it, the exclude stuff doesn't make it into the pom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thats a good point
@@ -73,7 +73,7 @@ public class NVCompDemo | |||
|
|||
// Bitcomp | |||
protected final BitcompManager bitcompManager; | |||
protected final nvcompBatchedBitcompFormatOpts bitcompOptions; | |||
protected final nvcompBatchedBitcompOpts_t bitcompOptions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvcomp 4.x change
@@ -52,11 +54,11 @@ private Mat readDepthImage() | |||
{ | |||
try | |||
{ | |||
URL imageURL = RawImageTest.class.getResource("zedDepth16U.raw"); | |||
byte[] imageBytes = IOUtils.toByteArray(Objects.requireNonNull(imageURL)); | |||
Path path = Paths.get(Objects.requireNonNull(RawImageTest.class.getResource("zedDepth16U.raw")).toURI()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, IOUtils changed. We should be using java nio Files anyway
@@ -372,11 +374,11 @@ private Mat readBGRImage() | |||
{ | |||
try | |||
{ | |||
URL imageURL = RawImageTest.class.getResource("zedColorBGR.raw"); | |||
byte[] imageBytes = IOUtils.toByteArray(Objects.requireNonNull(imageURL)); | |||
Path path = Paths.get(Objects.requireNonNull(RawImageTest.class.getResource("zedColorBGR.raw")).toURI()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, IOUtils changed. We should be using java nio Files anyway
val openblasVersion = "0.3.23-1.5.9" | ||
api("org.bytedeco:openblas:$openblasVersion") | ||
api("org.bytedeco:openblas:$openblasVersion:linux-x86_64") | ||
api("org.bytedeco:openblas:$openblasVersion:windows-x86_64") | ||
val opencvVersion = "4.7.0-1.5.9" | ||
api("org.bytedeco:opencv:$opencvVersion") | ||
api("org.bytedeco:opencv:$opencvVersion:linux-x86_64") | ||
api("org.bytedeco:opencv:$opencvVersion:windows-x86_64") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These come from the logger
api("org.bytedeco:openblas:$openblasVersion") | ||
api("org.bytedeco:openblas:$openblasVersion:linux-x86_64") | ||
api("org.bytedeco:openblas:$openblasVersion:linux-arm64") | ||
api("org.bytedeco:openblas:$openblasVersion:windows-x86_64") | ||
val opencvVersion = "4.7.0-1.5.9" | ||
api("org.bytedeco:opencv:$opencvVersion") | ||
api("org.bytedeco:opencv:$opencvVersion:linux-x86_64") | ||
api("org.bytedeco:opencv:$opencvVersion:linux-arm64") | ||
api("org.bytedeco:opencv:$opencvVersion:windows-x86_64") | ||
api("org.bytedeco:opencv:$opencvVersion:linux-x86_64-gpu") | ||
api("org.bytedeco:opencv:$opencvVersion:windows-x86_64-gpu") | ||
val ffmpegVersion = "6.0-1.5.9" | ||
api("org.bytedeco:ffmpeg:$ffmpegVersion") | ||
api("org.bytedeco:ffmpeg:$ffmpegVersion:linux-x86_64") | ||
api("org.bytedeco:ffmpeg:$ffmpegVersion:linux-arm64") | ||
api("org.bytedeco:ffmpeg:$ffmpegVersion:windows-x86_64") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openblas, opencv, ffmpeg come from the logger https://github.com/ihmcrobotics/ihmc-robot-data-logger/pull/39/files
@@ -64,9 +64,9 @@ public CUDACompressionTools() | |||
|
|||
public void destroy() | |||
{ | |||
compressionManager.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to close compressionManager before releasing the stream (fix by @TomaszTB )
@@ -91,13 +91,13 @@ public void testGPUDepthCompressionDecompression() throws IOException | |||
@Test | |||
public void testBasicCompression() throws IOException | |||
{ | |||
CUDACompressionTools compressor = new CUDACompressionTools(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this to load cudart, which loads the jni for Pointer, BytePointer. We were trying to use BytePointer first, which didn't work when this test was run alone.
@@ -56,17 +56,16 @@ public CUDACompressionTools() | |||
stream = CUDAStreamManager.getStream(); | |||
|
|||
nvcompBatchedZstdOpts_t zstdOptions = nvcomp.nvcompBatchedZstdDefaultOpts(); | |||
compressionManager = new ZstdManager(CHUNK_SIZE, zstdOptions, stream, 0, nvcomp.NoComputeNoVerify); | |||
compressionManager = new ZstdManager(CHUNK_SIZE, zstdOptions, stream, nvcomp.NoComputeNoVerify, 0 /*NVCOMP_NATIVE*/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constructor parameters changed from nvcomp 3.x to 4.x
@@ -387,7 +387,7 @@ public static BytePointer decompress(BytePointer compressedData, long compressed | |||
checkCUDAError(cudaMemcpyAsync(compressedDeviceBuffer, compressedData, compressedDataSize, cudart.cudaMemcpyDefault, cudaStream)); | |||
|
|||
// Create a decompression manager | |||
nvcompManagerBase decompressionManager = nvcomp.create_manager(compressedDeviceBuffer, cudaStream, 0, nvcomp.NoComputeNoVerify); | |||
nvcompManagerBase decompressionManager = nvcomp.create_manager(compressedDeviceBuffer, cudaStream, nvcomp.NoComputeNoVerify); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameters changed from nvcomp 3.x to 4.x
@@ -16,7 +16,9 @@ mainDependencies { | |||
api("com.hierynomus:sshj:0.32.0") | |||
|
|||
api("us.ihmc:mecano-graphviz:17-0.18.1") | |||
api("us.ihmc:scs2-bullet-simulation:17-0.28.3") | |||
api("us.ihmc:scs2-bullet-simulation:17-0.28.3") { | |||
exclude("org.bytedeco", "javacv") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this exclude?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scs2 currently includes javacv. It won't in a later version, but we still have to release that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this works transitively, so there may still be issues
} | ||
// ffmpeg, openblas, opencv come from the logger | ||
|
||
val cudaVersion = "12.6-9.5-1.5.11-ihmc-2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could extract "1.5.11-ihmc-2" to a variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont see the point, it would just make it more confusing to look at imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine with me
…ption for opencv, ffmpeg
tar -xvf nvcomp-linux-x86_64-4.1.0.6_cuda12-archive.tar.xz | ||
sudo rsync -av nvcomp-linux-x86_64-4.1.0.6_cuda12-archive/lib/* /usr/local/cuda/lib64 | ||
sudo rsync -av nvcomp-linux-x86_64-4.1.0.6_cuda12-archive/include/* /usr/local/cuda/include | ||
rm -rf nvcomp-linux-x86_64-4.1.0.6_cuda12-archive* | ||
``` | ||
|
||
### ZED SDK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we update this 4.2.1 -> 4.2.3 while we're updating this file?
Depends on #602