File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
x-pack/plugin/gpu/src/main/java/org/elasticsearch/xpack/gpu Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ public enum GpuMode {
3232 AUTO
3333 }
3434
35+ private final boolean isGpuSupported = GPUSupport .isSupported (true );
36+
3537 /**
3638 * Setting to control whether to use GPU for vectors indexing.
3739 * Currently only applicable for index_options.type: hnsw.
@@ -69,14 +71,14 @@ public VectorsFormatProvider getVectorsFormatProvider() {
6971 "[index.vectors.indexing.use_gpu] doesn't support [index_options.type] of [" + indexOptions .getType () + "]."
7072 );
7173 }
72- if (GPUSupport . isSupported ( true ) == false ) {
74+ if (isGpuSupported == false ) {
7375 throw new IllegalArgumentException (
7476 "[index.vectors.indexing.use_gpu] was set to [true], but GPU resources are not accessible on the node."
7577 );
7678 }
7779 return getVectorsFormat (indexOptions );
7880 }
79- if (gpuMode == GpuMode .AUTO && vectorIndexTypeSupported (indexOptions .getType ()) && GPUSupport . isSupported ( false ) ) {
81+ if (gpuMode == GpuMode .AUTO && vectorIndexTypeSupported (indexOptions .getType ()) && isGpuSupported ) {
8082 return getVectorsFormat (indexOptions );
8183 }
8284 }
You can’t perform that action at this time.
0 commit comments