2017-03-03 127 views
1

Google最近在其云服务中增加了对GPU的支持。Google Compute Engine GPU

我试图按照说明找到here启动一台带GPU的机器。在Windows上运行此脚本:

gcloud beta compute instances create gpu-instance-1^ 
--machine-type n1-standard-2^ 
--zone us-east1-d^ 
--accelerator type=nvidia-tesla-k80,count=1^ 
--image-family ubuntu-1604-lts^ 
--image-project ubuntu-os-cloud^ 
--maintenance-policy TERMINATE^ 
--restart-on-failure^ 

与gcloud指令行工具版本146.0.0失败,他说:

ERROR: (gcloud.beta.compute.instances.create) unknown collection [compute.acceleratorTypes] 

任何想法?

+0

您是否拥有GPU的配额?试验目前不支持GPU。另外,你可以从Web UI创建一个实例吗? –

+0

是的,我们在'us-east'中有4个GPU裸片的配额,我们正在支付(即不进行试用)。我花了很长时间寻找在Web UI中执行此操作的选项,但找不到任何内容。在配额获得批准后,我只是在尝试几个小时,所以也许如果我在星期一再试一次,它会起作用。 – kbrose

回答

0

永远无法获得gcloud实用程序的工作。使用API​​确实有效。值得注意的是,在发布API请求(与gcloud指令指令here相同页面上的指令)时,使用GPU创建实例的密钥为guestAccelerators。该密钥在gcloud中没有类似的选项。

复制上面链接的说明页面上显示的API请求。

POST https://www.googleapis.com/compute/beta/projects/[PROJECT_ID]/zones/[ZONE]/instances?key={YOUR_API_KEY} 
{ 
    "machineType": "https://www.googleapis.com/compute/beta/projects/[PROJECT_ID]/zones/[ZONE]/machineTypes/n1-highmem-2", 
    "disks": 
    [ 
    { 
     "type": "PERSISTENT", 
     "initializeParams": 
     { 
     "diskSizeGb": "[DISK_SIZE]", 
     "sourceImage": "https://www.googleapis.com/compute/beta/projects/[IMAGE_PROJECT]/global/images/family/[IMAGE_FAMILY]" 
     }, 
     "boot": true 
    } 
    ], 
    "name": "[INSTANCE_NAME]", 
    "networkInterfaces": 
    [ 
    { 
     "network": "https://www.googleapis.com/compute/beta/projects/[PROJECT_ID]/global/networks/[NETWORK]" 
    } 
    ], 
    "guestAccelerators": 
    [ 
    { 
     "acceleratorCount": [ACCELERATOR_COUNT], 
     "acceleratorType": "https://www.googleapis.com/compute/beta/projects/[PROJECT_ID]/zones/[ZONE]/acceleratorTypes/[ACCELERATOR_TYPE]" 
    } 
    ], 
    "scheduling": 
    { 
    "onHostMaintenance": "terminate", 
    "automaticRestart": true 
    }, 
    "metadata": 
    { 
    "items": 
    [ 
     { 
     "key": "startup-script", 
     "value": "[STARTUP_SCRIPT]" 
     } 
    ] 
    } 
} 
相关问题