Skip to content

Commit

Permalink
Use rel symlink for CUDA due to nvidia docker issue:
Browse files Browse the repository at this point in the history
  • Loading branch information
xkszltl committed Nov 6, 2020
1 parent a5733cf commit 3c75538
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkgs/cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
# - cuda-toolkit creates symlink "/usr/local/cuda -> /etc/alternatives/cuda -> /usr/local/cuda-<ver>".
# libnvidia-container cannot set up cuda-compat driver properly in this case.
# Use "ln -T" to overwrite dir symlink.
ls -d "/usr/local/cuda-$CUDA_VER_MAJOR.$CUDA_VER_MINOR/" | sort -V | tail -n1 | sudo xargs -I{} ln -sfT {} '/usr/local/cuda'
# - Only rel path "/usr/local/cuda -> cuda-<ver>" works for libnvidia-container, not "/usr/local/cuda -> /usr/local/cuda-<ver>".
# https://github.com/NVIDIA/libnvidia-container/issues/117
ls -d "/usr/local/cuda-$CUDA_VER_MAJOR.$CUDA_VER_MINOR/" | sort -V | tail -n1 | xargs -n1 basename | sudo xargs -I{} ln -sfT {} "/usr/local/cuda"
else
case "$DISTRO_ID" in
'centos' | 'fedora' | 'rhel')
Expand Down

0 comments on commit 3c75538

Please sign in to comment.