summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAndrew W Elble <aweits@rit.edu>2020-06-16 01:57:00 -0400
committerGitHub <noreply@github.com>2020-06-15 22:57:00 -0700
commit7e322b31845b2e56358abe5fd241526b20ae534c (patch)
treed45ba663ac892ba1176c5ce499fbaedcfea7cb94 /var
parentd4f0a8f70b9ccfbf4ea20d08e34261e52a773e6f (diff)
downloadspack-7e322b31845b2e56358abe5fd241526b20ae534c.tar.gz
spack-7e322b31845b2e56358abe5fd241526b20ae534c.tar.bz2
spack-7e322b31845b2e56358abe5fd241526b20ae534c.tar.xz
spack-7e322b31845b2e56358abe5fd241526b20ae534c.zip
CUDA: remove preexisting log file before install (#17018)
cuda: 10.1 and onward, installers will crash if /tmp/cuda-installer.log exists Try to help if user owns the file, otherwise try to provide useful info. Clean up the file post-install to try to avoid the whole issue.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/cuda/package.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py
index 13675fb774..ce1fdf69b9 100644
--- a/var/spack/repos/builtin/packages/cuda/package.py
+++ b/var/spack/repos/builtin/packages/cuda/package.py
@@ -8,6 +8,7 @@ from glob import glob
from llnl.util.filesystem import LibraryList
import os
import platform
+import llnl.util.tty as tty
# FIXME Remove hack for polymorphic versions
# This package uses a ugly hack to be able to dispatch, given the same
@@ -85,6 +86,14 @@ class Cuda(Package):
env.set('CUDA_HOME', self.prefix)
def install(self, spec, prefix):
+ if os.path.exists('/tmp/cuda-installer.log'):
+ try:
+ os.remove('/tmp/cuda-installer.log')
+ except OSError:
+ if spec.satisfies('@10.1:'):
+ tty.die("The cuda installer will segfault due to the "
+ "presence of /tmp/cuda-installer.log "
+ "please remove the file and try again ")
runfile = glob(join_path(self.stage.source_path, 'cuda*_linux*'))[0]
chmod = which('chmod')
chmod('+x', runfile)
@@ -110,6 +119,10 @@ class Cuda(Package):
arguments.append('--toolkitpath=%s' % prefix) # Where to install
runfile(*arguments)
+ try:
+ os.remove('/tmp/cuda-installer.log')
+ except OSError:
+ pass
@property
def libs(self):