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 @@ -31,6 +31,8 @@ public enum GpuMode {
3131 AUTO
3232 }
3333
34+ private final boolean isGpuSupported = GPUSupport .isSupported (true );
35+
3436 /**
3537 * Setting to control whether to use GPU for vectors indexing.
3638 * Currently only applicable for index_options.type: hnsw.
@@ -68,14 +70,14 @@ public VectorsFormatProvider getVectorsFormatProvider() {
6870 "[index.vectors.indexing.use_gpu] doesn't support [index_options.type] of [" + indexOptions .getType () + "]."
6971 );
7072 }
71- if (GPUSupport . isSupported ( true ) == false ) {
73+ if (isGpuSupported == false ) {
7274 throw new IllegalArgumentException (
7375 "[index.vectors.indexing.use_gpu] was set to [true], but GPU resources are not accessible on the node."
7476 );
7577 }
7678 return getVectorsFormat (indexOptions , similarity );
7779 }
78- if (gpuMode == GpuMode .AUTO && vectorIndexTypeSupported (indexOptions .getType ()) && GPUSupport . isSupported ( false ) ) {
80+ if (gpuMode == GpuMode .AUTO && vectorIndexTypeSupported (indexOptions .getType ()) && isGpuSupported ) {
7981 return getVectorsFormat (indexOptions , similarity );
8082 }
8183 }
You can’t perform that action at this time.
0 commit comments