Skip to content
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

deeplearning4j prints to standard output #8270

Closed
lpaatero opened this issue Oct 6, 2019 · 2 comments · Fixed by KonduitAI/deeplearning4j#12
Closed

deeplearning4j prints to standard output #8270

lpaatero opened this issue Oct 6, 2019 · 2 comments · Fixed by KonduitAI/deeplearning4j#12
Assignees

Comments

@lpaatero
Copy link

@lpaatero lpaatero commented Oct 6, 2019

Issue Description

When using deeplearning4j in linux command line program, no additional output should be present on program standard output. Any additional output will interfere with expected output of the program.

In beta5 version deeplearning4j prints 2 lines to standard output

ND4J CUDA build version: 10.0.130
CUDA device 0: [GeForce GTX 1070]; cc: [6.1]; Total memory: [8510832640];

There does not seem to be any easy way to prevent this output.

Version Information

beta5 in linux using CUDA.

Correction

Preferably make this kind of printout to follow java logging settings. If not possible, make printout optional.

@AlexDBlack

This comment has been minimized.

Copy link
Contributor

@AlexDBlack AlexDBlack commented Oct 7, 2019

That's a fair request.
It's coming from c++ here:

printf("ND4J CUDA build version: %i.%i.%i\n", _blasMajorVersion, _blasMinorVersion, _blasPatchVersion);
fflush(stdout);
int devCnt = 0;
cudaGetDeviceCount(&devCnt);
auto devProperties = new cudaDeviceProp[devCnt];
for (int i = 0; i < devCnt; i++) {
cudaSetDevice(i);
cudaGetDeviceProperties(&devProperties[i], i);
//cudaDeviceSetLimit(cudaLimitStackSize, 4096);
Pair p(devProperties[i].major, devProperties[i].minor);
_capabilities.emplace_back(p);
printf("CUDA device %i: [%s]; cc: [%i.%i]; Total memory: [%lld];\n", i, devProperties[i].name, devProperties[i].major, devProperties[i].minor, (Nd4jLong) devProperties[i].totalGlobalMem);

@AlexDBlack AlexDBlack added the C++ label Oct 7, 2019
@AlexDBlack AlexDBlack self-assigned this Oct 25, 2019
AlexDBlack added a commit to KonduitAI/deeplearning4j that referenced this issue Oct 25, 2019
…d via existing org.nd4j.log.initialization system property

Signed-off-by: AlexDBlack <blacka101@gmail.com>
AlexDBlack added a commit to KonduitAI/deeplearning4j that referenced this issue Oct 26, 2019
* eclipse#8160 Remove resolvePrepertiesFromSameDiffBeforeExecution

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* SameDiff API cleanup

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* More SameDiff cleanup

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Small fixes

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8248 Switch SameDiff variable init from lazy to creation time for more predictable behaviour

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8252 TanhDerivative javadoc

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8225 Deconvolution2D input validation

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8265 Switch SameDiff.outputs() to user settable, instead of unreliable 'best guess'

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8224 SameDiff.zero and .one create constants, not variables

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* More cleanup and fixes

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Small test fix

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Small fix

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* DL4J SameDiff fixes

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Re-add hack for Deconvolution2DLayer until eclipse#8315 is resolved

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8270 Move CUDA device/version logging to Java; can be disabled via existing org.nd4j.log.initialization system property

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* All ND4J init logging checks system property

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Small tweak

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Remove redundant device logging

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* One more fix

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* UX improvements

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Deconv fix

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Add deconv tests

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Cleanup

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Remove debug code

Signed-off-by: AlexDBlack <blacka101@gmail.com>
@AlexDBlack

This comment has been minimized.

Copy link
Contributor

@AlexDBlack AlexDBlack commented Oct 26, 2019

Thanks for reporting this. Fixed here: KonduitAI#12
This will be merged back to the Eclipse repo shortly, and the fix will be available on snapshots some time next week.

Now all initialization logging (including the CUDA logging flagged in the issue) can be disabled by either setting the system property (see link below) or by configuring your logging backend for ND4J (to error level or higher for org.nd4j loggers).
https://github.com/eclipse/deeplearning4j/blob/master/nd4j/nd4j-common/src/main/java/org/nd4j/config/ND4JSystemProperties.java#L27-L33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.