주요 콘텐츠

validateGPU

R2026b

GPU 장치 검증

R2024b 이후

    설명

    validateGPU는 현재 선택된 GPU 장치를 검증합니다. 선택된 GPU 장치가 없으면, 함수는 디폴트 장치를 검증합니다.

    예제

    validateGPU("all")은 시스템에서 감지된 모든 GPU 장치를 검증합니다.

    예제

    validateGPU(ind)는 인덱스 ind로 지정된 GPU 장치를 검증합니다.

    팁

    GPU 장치를 검증하는 것은 필수 사항이 아닙니다. GPU 설정과 관련된 문제를 진단하려면 validateGPU 함수를 사용하십시오.

    예제

    예제

    모두 축소

    현재 선택된 GPU 장치를 검증합니다. 선택된 GPU 장치가 없으면, 함수는 디폴트 장치를 검증합니다. validateGPU 함수는 수행된 검증 단계와 각 단계가 통과했는지 실패했는지 또는 건너뛰었는지 여부를 출력합니다. 검증 단계가 실패하면 함수는 진단 메시지를 출력합니다.

    validateGPU
    # Beginning GPU validation
    # Performing system validation
    #    CUDA-supported platform .................................................PASSED
    #    CUDA-enabled graphics driver exists .....................................PASSED
    #        Version: 537.70
    #    CUDA-enabled graphics driver load .......................................PASSED
    #    CUDA environment variables ..............................................PASSED
    #    CUDA device count .......................................................PASSED
    #        Found 2 devices.
    #    GPU libraries load ......................................................PASSED
    # 
    # Performing device validation for device index 1
    #    Device exists ...........................................................PASSED
    #        NVIDIA RTX A5000
    #    Device supported ........................................................PASSED
    #    Device available ........................................................PASSED
    #        Device is in 'Default' compute mode.
    #    Device selectable .......................................................PASSED
    #    Device memory allocation ................................................PASSED
    #    Device kernel launch ....................................................PASSED
    # 
    # Finished GPU validation with no failures.
    

    시스템에 있는 모든 GPU 장치를 검증합니다. validateGPU 함수는 일련의 시스템 검증 검사를 한 번 수행한 다음, 감지된 각 장치에 대해 일련의 장치 검증 단계를 한 번씩 수행합니다.

    validateGPU("all")
    # Beginning GPU validation
    # Performing system validation
    #    CUDA-supported platform .................................................PASSED
    #    CUDA-enabled graphics driver exists .....................................PASSED
    #        Version: 570.133.07
    #    CUDA-enabled graphics driver load .......................................PASSED
    #    CUDA environment variables ..............................................PASSED
    #        CUDA_VISIBLE_DEVICES: "0,1"
    #    CUDA device count .......................................................PASSED
    #        Found 2 devices.
    #    GPU libraries load ......................................................PASSED
    # 
    # Performing device validation for device index 1
    #    Device exists ...........................................................PASSED
    #        NVIDIA RTX A5000
    #    Device supported ........................................................PASSED
    #    Device available ........................................................PASSED
    #        Device is in 'Default' compute mode.
    #    Device selectable .......................................................PASSED
    #    Device memory allocation ................................................PASSED
    #    Device kernel launch ....................................................PASSED
    # 
    # Performing device validation for device index 2
    #    Device exists ...........................................................PASSED
    #        NVIDIA RTX A5000
    #    Device supported ........................................................PASSED
    #    Device available ........................................................PASSED
    #        Device is in 'Default' compute mode.
    #    Device selectable .......................................................PASSED
    #    Device memory allocation ................................................PASSED
    #    Device kernel launch ....................................................PASSED
    # 
    # Finished GPU validation with no failures.
    

    인덱스가 2인 GPU 장치를 검증합니다.

    validateGPU(2)
    # Beginning GPU validation
    # Performing system validation
    #    CUDA-supported platform .................................................PASSED
    #    CUDA-enabled graphics driver exists .....................................PASSED
    #        Version: 570.133.07
    #    CUDA-enabled graphics driver load .......................................PASSED
    #    CUDA environment variables ..............................................PASSED
    #        CUDA_VISIBLE_DEVICES: "0,1"
    #    CUDA device count .......................................................PASSED
    #        Found 2 devices.
    #    GPU libraries load ......................................................PASSED
    # 
    # Performing device validation for device index 2
    #    Device exists ...........................................................PASSED
    #        NVIDIA RTX A5000
    #    Device supported ........................................................PASSED
    #    Device available ........................................................PASSED
    #        Device is in 'Default' compute mode.
    #    Device selectable .......................................................PASSED
    #    Device memory allocation ................................................PASSED
    #    Device kernel launch ....................................................PASSED
    # 
    # Finished GPU validation with no failures.
    

    GPU 장치가 여러 개 있는 경우, 장치 인덱스로 구성된 벡터를 입력값으로 전달하여 validateGPU를 한 번 호출함으로써 여러 장치를 검증할 수 있습니다. 예를 들어, GPU 장치 1과 2를 검증하려면 validateGPU([1 2])를 호출하십시오.

    입력 인수

    모두 축소

    검증할 GPU 장치의 인덱스로, 1에서 gpuDeviceCount 사이의 정수 또는 정수로 구성된 벡터로 지정됩니다.

    예: 2

    예: [1 3]

    데이터형: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    팁

    • 원격 GPU를 검증하려면 클러스터를 사용하여 병렬 풀을 시작한 후, spmd 블록 내에서 validateGPU 함수를 호출하십시오. 워커에 GPU가 두 개 이상 있는 경우 "all" 옵션을 사용하십시오.

      cluster = parcluster("myRemoteGPUCluster");
      pool = parpool(cluster);
      
      spmd
        validateGPU("all")
      end
      원격 GPU 사용에 대한 자세한 내용은 Work with Remote GPUs 항목을 참조하십시오.

    알고리즘

    모두 축소

    버전 내역

    R2024b에 개발됨