Skip to content

Commit

Permalink
Detect the correct nvidia lib path for modern ubuntu systems (#646)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wookayin authored Nov 2, 2021
1 parent ab86d33 commit fb4babe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mujoco_py/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fb4babe

Please sign in to comment.