Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not use GPU for cycles rendering #40

Open
thongpv87 opened this issue Apr 2, 2018 · 0 comments
Open

Can not use GPU for cycles rendering #40

thongpv87 opened this issue Apr 2, 2018 · 0 comments

Comments

@thongpv87
Copy link

thongpv87 commented Apr 2, 2018

I have this script to enable GPU render on my machine (Nvidia GTX 1080 Ti with lastest driver and CUDA toolkit):

import bpy
scene=bpy.context.scene
scene.render.filepath="//render/IMG.PNG"
scene.render.image_settings.file_format="PNG"
scene.render.engine="CYCLES"
bpy.context.scene.cycles.samples=50
scene.cycles.tile_order="BOTTOM_TO_TOP"
scene.cycles.debug_use_spatial_splits=True
scene.cycles.use_progressive_refine=False
scene.render.use_save_buffers=False
scene.render.threads_mode="AUTO"
scene.render.tile_x=16
scene.render.tile_y=16
scene.render.resolution_x=1920
scene.render.resolution_y=1080
scene.render.resolution_percentage=100
scene.frame_set(1)
scene.render.use_compositing=False
scene.render.use_sequencer=False
scene.render.engine="CYCLES"
gpus=[gpu for gpu in bpy.context.user_preferences.addons["cycles"].preferences.devices]
for gpu in gpus:
    if gpu.type == "CUDA":
        gpu.use=True
        print('Use GPU: ', gpu.name)
    else:
        gpu.use=False
        print('Disable GPU: ', gpu.name)
bpy.ops.render.render(write_still=True)

I run blender with command:
blender -b pavillon_barcelone_v1.2.blend -P script.py

It show me
Disable GPU: Intel Core Processor (Broadwell) Use GPU: GeForce GTX 1080 Ti

But when I check with nvidia-smi tool, I found that blender did not use my GPU for rendering.

`$ nvidia-smi
Mon Apr 2 12:43:16 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 387.26 Driver Version: 387.26 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 108... Off | 00000000:05:00.0 Off | N/A |
| 21% 26C P0 57W / 250W | 18MiB / 11172MiB | 0% Default |
+-------------------------------+----------------------+----------------------+

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

My blender version is v2.79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant