ai2thor icon indicating copy to clipboard operation
ai2thor copied to clipboard

vulkan-tools required for 5.0.0?

Open Gabesarch opened this issue 1 year ago • 4 comments

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 avatar Apr 19 '23 18:04 Gabesarch

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)

Gabesarch avatar Jul 25 '23 18:07 Gabesarch

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

nbqu avatar Aug 07 '23 23:08 nbqu

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

rginpan avatar May 18 '24 07:05 rginpan