allenai / ai2thor

An open-source platform for Visual AI.
http://ai2thor.allenai.org
Apache License 2.0
1.09k stars 210 forks source link

vulkan-tools required for 5.0.0? #1144

Open Gabesarch opened 1 year ago

Gabesarch commented 1 year ago

Hi,

In the new ai2thor version (5.0.0), I am getting the following error when initializing the Controller class:

RuntimeError: vulkaninfo failed to run, please ask your administrator to install vulkaninfo (e.g. on Ubuntu systems this requires running sudo apt install vulkan-tools).

However, in 4.3.0, vulkan-tools was not required to run the controller with an x server present (but was required when running in headless mode). Is vulkan-tools required now to run ai2thor in all modes?

Thank you so much!

Gabesarch commented 11 months ago

Follow up:

I have found a work-around to not require the use of vulkan-tools, by replacing the unity_command function in controller.py with the following:

def unity_command(self, width, height, headless):
        fullscreen = 1 if self.fullscreen else 0

        command = self._build.executable_path

        if headless:
            command += " -batchmode -nographics"
        else:
            command += (
                " -screen-fullscreen %s -screen-quality %s -screen-width %s -screen-height %s"
                % (fullscreen, QUALITY_SETTINGS[self.quality], width, height)
            )

        if self.gpu_device is not None:
            # This parameter only applies to the CloudRendering platform.
            # Vulkan maps the passed in parameter to device-index - 1 when compared
            # to the nvidia-smi device ids
            device_index = self.gpu_device if self.gpu_device < 1 else self.gpu_device + 1
            command += " -force-device-index %d" % device_index

        return shlex.split(command)
nbqu commented 11 months ago

Wow, this helped me a lot. In case of mine, vulkaninfo does not print UUID so it raised runtime error. Thanks to your snippet finally I can start training! Thank you for sharing XD

rginjapan commented 1 month ago

This also helps me to run in a server without sudo access!