Code Monkey home page Code Monkey logo

Comments (6)

indiejoseph avatar indiejoseph commented on July 28, 2024 3

HI @fzlee i managed enable GPU with latest Blender 3.0 image, here is the additional setting beside of yours:

# Enable CUDA
  pref = bpy.context.preferences
  cycles_addon = pref.addons["cycles"]
  cpref = cycles_addon.preferences
  cpref.compute_device_type = "CUDA"
  cpref.compute_device = "CUDA_0"

# Enable and list all devices, or optionally disable CPU
  print("----------------------------------------------")
  cpref.get_devices()

  for d in cpref.devices:
    d.use = True
    if d.type == "CPU":
      d.use = False
    print("Device '{}' type {} : {}" . format(d.name, d.type, d.use))
    ```

from rd-blender-docker.

fzlee avatar fzlee commented on July 28, 2024 1

@indiejoseph many thanks for your help , it did help!

from rd-blender-docker.

juniorxsound avatar juniorxsound commented on July 28, 2024

Thanks for the information @fzlee 🙏

Would you be able to provide a little more information about this issue? OS / Docker run command / how to replicate

Also would you mind trying to set the GPU devices using this snippet to see if that helps?

from rd-blender-docker.

Shrhawk avatar Shrhawk commented on July 28, 2024

@fzlee did you find any solution? facing the same problem

from rd-blender-docker.

juniorxsound avatar juniorxsound commented on July 28, 2024

One thing that could potentially be related is the CUDA version (was reading the requirement for building Blender and it seems to point to CUDA Toolkit 11.4, 11.3, 11.2 or 11.1 here).

Just pushed an updated image for Blender 3.0 GPU here - @fzlee @Shrhawk Would you be able to test building this image to see if that solves this issue?

from rd-blender-docker.

fzlee avatar fzlee commented on July 28, 2024

Hi juniorxsound:
Many thanks for your help on this.

Sorry for the late reply, we tried this push, but unfortunately, we are still not able to enable GPU.

Regarding to the former question:
OS: Ubuntu 2004
How to replicate: just run the newest docker image, and invoke the following pieces of code

def enable_gpus():
    cycles_addon = bpy.context.preferences.addons['cycles']
    cycles_addon.preferences.compute_device_type = 'CUDA'
    bpy.context.scene.render.engine = "CYCLES"
    bpy.context.scene.cycles.device = "GPU"

and you will see bpy.context.preferences.addons['cycles'].preferences.devices returns an empty list.

from rd-blender-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.