From ba94792991f8245b77a9aecc5b3f5274a18b63f9 Mon Sep 17 00:00:00 2001 From: Jongwook Choi Date: Tue, 2 Nov 2021 14:19:30 -0400 Subject: [PATCH] Detect the correct nvidia lib path for modern ubuntu systems To enable GPU extensions, previously either /usr/local/nvidia/lib64 (for dockers) or /usr/lib/nvidia-\d\d\d needed to exist, but in most of the modern debian and ubuntu systems, the nvidia libraries are actually installed under the path /usr/lib/nvidia. The commit corrects the path to nvidia library path so that GPU extensions can be installed without any hacky workarounds. --- mujoco_py/builder.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mujoco_py/builder.py b/mujoco_py/builder.py index fbc94a41..e63e3de2 100644 --- a/mujoco_py/builder.py +++ b/mujoco_py/builder.py @@ -31,6 +31,11 @@ def get_nvidia_lib_dir(): docker_path = '/usr/local/nvidia/lib64' if exists(docker_path): return docker_path + + nvidia_path = '/usr/lib/nvidia' + if exists(nvidia_path): + return nvidia_path + paths = glob.glob('/usr/lib/nvidia-[0-9][0-9][0-9]') paths = sorted(paths) if len(paths) == 0: