diff --git a/lib/galaxy/tool_util/deps/requirements.py b/lib/galaxy/tool_util/deps/requirements.py index 7f59be7fa47..e787dc4e403 100644 --- a/lib/galaxy/tool_util/deps/requirements.py +++ b/lib/galaxy/tool_util/deps/requirements.py @@ -233,6 +233,11 @@ ResourceType = Literal[ "ram_max", "tmpdir_min", "tmpdir_max", + "cuda_version_min", + "cuda_compute_capability", + "gpu_memory_min", + "cuda_device_count_min", + "cuda_device_count_max", ] VALID_RESOURCE_TYPES = get_args(ResourceType) @@ -272,6 +277,11 @@ def resource_requirements_from_list(requirements) -> List[ResourceRequirement]: "ramMax": "ram_max", "tmpdirMin": "tmpdir_min", "tmpdirMax": "tmpdir_max", + "cudaVersionMin": "cuda_version_min", + "cudaComputeCapability": "cuda_compute_capability", + "gpuMemoryMin": "gpu_memory_min", + "cudaDeviceCountMin": "cuda_device_count_min", + "cudaDeviceCountMax": "cuda_device_count_max", } rr = [] for r in requirements: diff --git a/lib/galaxy/tool_util/xsd/galaxy.xsd b/lib/galaxy/tool_util/xsd/galaxy.xsd index 0a64ccde38c..55c186e983b 100644 --- a/lib/galaxy/tool_util/xsd/galaxy.xsd +++ b/lib/galaxy/tool_util/xsd/galaxy.xsd @@ -6793,6 +6793,31 @@ and ``bibtex`` are the only supported options. Maximum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20 bytes), if runtime allows it (not yet implemented in Galaxy). + + + Minimum CUDA (runtime link library) runtime version, if runtime allows it (not yet implemented in Galaxy). + + + + + Minimum NVIDIA (hardware+driver) Compute capabilities (major, minor (can be a range or a list), if runtime allows it (not yet implemented in Galaxy). + + + + + Minimum Memory of the GPU in mebibytes, if runtime allows it (not yet implemented in Galaxy). + + + + + Minimum CUDA device count, if runtime allows it (not yet implemented in Galaxy). + + + + + Maximum CUDA device count, if runtime allows it (not yet implemented in Galaxy). + + diff --git a/test/functional/tools/resource_requirements.xml b/test/functional/tools/resource_requirements.xml index 5ad4ccc06fd..96a5641f720 100644 --- a/test/functional/tools/resource_requirements.xml +++ b/test/functional/tools/resource_requirements.xml @@ -6,6 +6,11 @@ 2> + 10.2 + 6.1 + 4042 + 1 + 2 $output diff --git a/test/unit/tool_util/test_parsing.py b/test/unit/tool_util/test_parsing.py index a5d709119a4..9ef3a3a2389 100644 --- a/test/unit/tool_util/test_parsing.py +++ b/test/unit/tool_util/test_parsing.py @@ -31,6 +31,11 @@ TOOL_XML_1 = """ mycool/bwa bwa 1 + 10.2 + 6.1 + 4042 + 1 + 2 @@ -125,6 +130,16 @@ requirements: version: 1.0.1 - type: resource cores_min: 1 + - type: resource + cuda_version_min: 10.2 + - type: resource + cuda_compute_capability: 6.1 + - type: resource + gpu_memory_min: 4042 + - type: resource + cuda_device_count_min: 1 + - type: resource + cuda_device_count_max: 2 containers: - type: docker identifier: "awesome/bowtie" @@ -311,6 +326,11 @@ class TestXmlLoader(BaseLoaderTestCase): assert requirements[0].type == "package" assert list(containers)[0].identifier == "mycool/bwa" assert resource_requirements[0].resource_type == "cores_min" + assert resource_requirements[1].resource_type == "cuda_version_min" + assert resource_requirements[2].resource_type == "cuda_compute_capability" + assert resource_requirements[3].resource_type == "gpu_memory_min" + assert resource_requirements[4].resource_type == "cuda_device_count_min" + assert resource_requirements[5].resource_type == "cuda_device_count_max" assert not resource_requirements[0].runtime_required def test_outputs(self): @@ -486,8 +506,22 @@ class TestYamlLoader(BaseLoaderTestCase): "resolve_dependencies": False, "shell": "/bin/sh", } - assert len(resource_requirements) == 1 + assert len(resource_requirements) == 6 assert resource_requirements[0].to_dict() == {"resource_type": "cores_min", "value_or_expression": 1} + assert resource_requirements[1].to_dict() == {"resource_type": "cuda_version_min", "value_or_expression": 10.2} + assert resource_requirements[2].to_dict() == { + "resource_type": "cuda_compute_capability", + "value_or_expression": 6.1, + } + assert resource_requirements[3].to_dict() == {"resource_type": "gpu_memory_min", "value_or_expression": 4042} + assert resource_requirements[4].to_dict() == { + "resource_type": "cuda_device_count_min", + "value_or_expression": 1, + } + assert resource_requirements[5].to_dict() == { + "resource_type": "cuda_device_count_max", + "value_or_expression": 2, + } def test_outputs(self): outputs, output_collections = self._tool_source.parse_outputs(object())