Blender Google Colab [英] Blender Google Colab

查看:111
本文介绍了Blender Google Colab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到几天前,我还能够使用GPU在Google Colab上无头运行Blender(或绵羊)(是的,我检查了选择了GPU实例的三次).现在运行keras/tensorflow可以正常工作,但Blender根本无法检测到GPU,Sheepit告诉我

Up until few days ago I was able to run Blender(or sheep it) headless on Google Colab with an GPU(yes I checked trice that I selected a GPU Instance). Now running keras/tensorflow does work fine but blender can't detect the GPU at all and Sheepit tells me that

"cuInit失败回复:100"

"cuInit Failed ret: 100"

nvidia-smi结果为:

nvidia-smi results with:

Sat Aug 24 19:48:06 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.40       Driver Version: 418.67       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla K80           Off  | 00000000:00:04.0 Off |                    0 |
| N/A   33C    P8    25W / 149W |      0MiB / 11441MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

以下脚本可以正常工作几个月,可以正确检测到GPU,并设置Blender以使用可用的GPU. https://gist.github.com/donmahallem/a05100077ec1327268f28f0b2bd8da60

The following script did work fine for few months and detected the GPU properly and setup blender to use the available GPU. https://gist.github.com/donmahallem/a05100077ec1327268f28f0b2bd8da60

我尝试了很多,但是我的nvidia/unix foo非常有限.我试图找出CUDA版本是否已更改,并试图将cuda版本降级到9.2,但无法使其再次正常工作.

I tried a lot but my nvidia/unix foo is pretty limited. I tried to find out if the CUDA Version changed and tried to downgrade the cuda version to 9.2 but couldn't get it to work again.

推荐答案

我也遇到了同样的问题. 我认为colab不允许GPU用于其中包含"sudo"的任何命令.

I'm also facing the same problem. I think colab is not allowing GPU to use for any commands that include "sudo" in it.

我发现的解决方案是安装Blender,然后运行命令以不使用"sudo"进行渲染.

Solution I found was to install blender and then run the command to render without "sudo".

我从PPA安装了搅拌机 ppa:thomas-schiex/blender

I installed blender from PPA ppa:thomas-schiex/blender

要执行的命令:

!sudo add-apt-repository ppa:thomas-schiex/blender
!sudo apt-get install blender
!blender -b -P script.py filename.blend -o fileoutput -F PNG -f 1

script.py包含选择gpu的代码,我通常将其上传到colab. 将以下代码另存为script.py

script.py contains code to select gpu, I generally upload to colab. Save following code as script.py

import bpy, _cycles

bpy.context.scene.cycles.device = 'GPU'

avail_devices = _cycles.available_devices('CUDA')
print(avail_devices)

prop = bpy.context.preferences.addons['cycles'].preferences

prop.get_devices(prop.compute_device_type)
prop.compute_device_type = 'CUDA'

for device in prop.devices:
    if device.type == 'CUDA':
        print('device: ', device)
        device.use = True

这对我有用.

这篇关于Blender Google Colab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆