본문으로 건너뛰기
Skillpedia
작업 및 프로젝트51k · #3471

get-available-resources

하는 일

이 도구는 특정 프로그램이 사용할 수 있는 컴퓨터 자원(CPU, 메모리, 디스크 등)을 확인합니다. 계획에 도움이 되도록 안전하고 간단한 요약을 만듭니다.

사용하는 경우

  • ✓자원을 많이 쓰는 프로그램을 계획할 때.
  • ✓메모리나 처리 성능을 많이 쓸 수 있는 작업을 실행하려고 할 때.
  • ✓컴퓨팅 환경의 자원 한도를 알고 싶을 때.

스킬 링크

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/get-available-resources/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/get-available-resources/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 작업을 계획하기 위해 사용 가능한 자원을 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 프로그램의 현재 환경을 분석해 CPU, 메모리, 디스크 및 기타 자원의 한도를 확인합니다. 한도를 시험하지 않고, 사용 가능한 항목을 보여 주는 데이터 보고서(JSON)를 만듭니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Get Available Resources

Build a conservative picture of resources available to the current process. Keep host inventory, process affinity, cgroup/container limits, scheduler allocation, and accelerator runtime usability separate.

Safety contract

Follow these rules:

  • Run detection when the user requests it or a specific workload needs resource planning. Do not persist a fingerprint for every scientific task.
  • Use stdout by default. Persist only when the user chooses an explicit generic local filename.
  • Do not run stress tests, benchmarks, large allocations, write probes, device resets, driver installation, or clock/power changes.
  • Do not dump the environment. Read only the named Slurm and accelerator variables implemented by the detector.
  • Do not report hostnames, absolute paths, cgroup paths, job IDs, device UUIDs, PCI addresses, or raw visibility-variable values.
  • Treat a missing observation as unknown. Never convert unknown to unlimited.
  • Never infer that a visible host CPU, memory pool, or GPU is usable inside a scheduler allocation or container.

The bundled detector uses only fixed executable/argument tuples, no shell, short timeouts, bounded stdout/stderr, and partial-failure warnings.

Quick start

Run from this skill directory.

Ephemeral stdout snapshot

python scripts/detect_resources.py

The command emits only JSON to stdout. Redirect it only when ordinary shell permissions are acceptable.

Explicit private file

python scripts/detect_resources.py --output resource-snapshot.json

Explicit output is restricted to one .json filename in the current directory, uses mode 0600 on POSIX, rejects symlinks and path traversal, and refuses overwrite unless --force is supplied. Forced output also rejects hard links and non-regular files. Windows privacy additionally depends on the directory ACL.

Optional psutil enhancement

The standard-library detector works without installation. For broader cross-platform physical-core, affinity, available-memory, swap, and disk coverage:

uv run --no-project --with "psutil==7.2.2" python scripts/detect_resources.py

The import is lazy. Failure to import psutil becomes a warning, not a fatal error.

Skip management-tool probes

python scripts/detect_resources.py --skip-accelerators

Use this when accelerator discovery latency is undesirable. The detector still summarizes the presence and state of allowlisted visibility variables without returning their values.

Required interpretation

CPU

Read these as different facts:

  • cpu.host.logical: system-visible scheduling units.
  • cpu.host.physical: physical topology, or null; never inferred from logical count.
  • cpu.process.affinity_logical: current affinity-set size when supported.
  • cpu.cgroup_v2.cpuset_logical: effective cgroup cpuset size.
  • cpu.cgroup_v2.quota_cores: finite cpu.max capacity, possibly fractional.
  • scheduler.allocation.cpu_per_process: bounded Slurm per-task interpretation when scope is clear.
  • cpu.effective.capacity_cores: minimum positive observed constraint.
  • cpu.effective.worker_ceiling: conservative floor for CPU process workers.

A quota of 1.5 is CPU-time capacity, not 1.5 physical cores. Affinity and cpusets constrain placement; quota constrains bandwidth.

Memory

Keep these separate:

  • host total/available memory;
  • current cgroup usage, hard memory.max, and remaining hierarchical capacity;
  • memory.high, which is a pressure/throttle boundary rather than a hard cap;
  • scheduler memory allocation and its scope; and
  • conservative effective hard limit and available estimate.

On Apple silicon, memory.model is unified_cpu_gpu. Do not add integrated GPU memory to RAM or describe it as separate VRAM.

Accelerators

Each device is a backend candidate:

  • NVIDIA GPU → CUDA candidate;
  • AMD GPU → ROCm candidate;
  • Apple integrated GPU → Metal candidate.

Management-query visibility does not establish:

  1. scheduler/container permission;
  2. device-node access;
  3. driver/runtime compatibility;
  4. framework package compatibility; or
  5. operator/data-type support.

Therefore runtime_usable_devices remains null and each device says runtime_compatibility: not_tested. Visibility/allocation counts constrain the observed management records, not the number of framework devices. MIG and AMD partition enumeration can differ.

…

자주 묻는 질문

이 맥락에서 ‘자원’이란 무엇인가요?

프로그램이 실행되기 위해 쓰는 컴퓨터 부품들입니다. 처리 성능(CPU), 메모리(RAM), 디스크 공간 등이 있습니다.

보고서가 왜 ‘안전’하고 ‘간단’하다고 하나요?

정확한 파일 이름이나 시스템 ID 같은 민감하거나 지나치게 자세한 정보를 수집하지 않고, 자원 한도에만 집중합니다. 그래서 시스템에 과부하를 주거나 정보를 노출하지 않습니다.

자원 ‘계획’은 무엇을 뜻하나요?

사용 가능한 자원 정보를 활용해 작업을 효율적으로 실행하는 방법을 정하는 것입니다. 용량 부족으로 실패하거나 다른 프로그램을 방해하지 않도록 합니다.

상세 정보

작성자의 원본 설명

Detects host inventory and effective CPU, memory, disk, scheduler, container, and accelerator limits when a user asks for resource-aware planning or before a clearly resource-sensitive local workload. Produces a redacted JSON snapshot and conservative planning helpers without stress tests or assuming visible host hardware is usable.

repo: K-Dense-AI/scientific-agent-skills

인기도

GitHub 스타
51k
순위
#3471
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬