@Override
    public Set<GPUInfo> retrieveResourceInfo(long gpuAmount) throws Exception {
        Preconditions.checkArgument(
                gpuAmount > 0,
                "The gpuAmount should be positive when retrieving the GPU resource information.");

        final Set<GPUInfo> gpuResources = new HashSet<>();
        String output = executeDiscoveryScript(discoveryScriptFile, gpuAmount, args);
        if (!output.isEmpty()) {
            String[] indexes = output.split(",");
            for (String index : indexes) {
                if (!StringUtils.isNullOrWhitespaceOnly(index)) {
                    gpuResources.add(new GPUInfo(index.trim()));
                }
            }
        }
        LOG.info("Discover GPU resources: {}.", gpuResources);
        return Collections.unmodifiableSet(gpuResources);
    }
@Test
    void testGPUDriverWithTestScript() throws Exception {
        final int gpuAmount = 2;
        final Configuration config = new Configuration();
        config.set(GPUDriverOptions.DISCOVERY_SCRIPT_PATH, TESTING_DISCOVERY_SCRIPT_PATH);

        final GPUDriver gpuDriver = new GPUDriver(config);
        final Set<GPUInfo> gpuResource = gpuDriver.retrieveResourceInfo(gpuAmount);

        assertThat(gpuResource).hasSize(gpuAmount);
    }