Skip to content

Commit 9b9a39b

Browse files
committed
Use ResourceInformation::hasGpuNvidia() in TensorFlow
1 parent b7b5f27 commit 9b9a39b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PhysicsTools/TensorFlow/src/TensorFlow.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace tensorflow {
4141
}
4242
// NVidia GPU
4343
else if (backend == Backend::cuda) {
44-
if (not ri->nvidiaDriverVersion().empty()) {
44+
if (ri->hasGpuNvidia()) {
4545
// Check if one GPU device is visible to TF
4646
// If not, an exception is raised --> this can happen in case of driver version mismatch
4747
// or missing CUDA support in TF compilation
@@ -73,7 +73,7 @@ namespace tensorflow {
7373
// Get NVidia GPU if possible or fallback to CPU
7474
else if (backend == Backend::best) {
7575
// Check if a Nvidia GPU is availabl
76-
if (not ri->nvidiaDriverVersion().empty()) {
76+
if (ri->hasGpuNvidia()) {
7777
// Take only the first GPU in the CUDA_VISIBLE_DEVICE list
7878
(*_options.config.mutable_device_count())["GPU"] = 1;
7979
_options.config.mutable_gpu_options()->set_visible_device_list("0");

0 commit comments

Comments
 (0)