Repository: spack/spack

Issue:
Installation issue: installing cuda 10.2.89 and 11.0.2 on power 9 (ppc64le)
Hello, 
          I tried to run spack from a centos 8 singularity container

$ spack install cuda@10.2.89
after a series of nice library installation, finally I arrived to cuda 
```
...
[+] /opt/spack/opt/spack/linux-centos8-power9le/gcc-8.3.1/libxml2-2.9.10-fpwdie2higdag72s2a5jy4iap3b6ij75
==> Installing cuda
==> No binary for cuda found: installing from source
==> Error: FetchError: All fetchers failed for spack-stage-cuda-11.0.2-ckas64rppoqhk7umivrfjezetbraypah

/opt/spack/lib/spack/spack/package.py:1149, in do_fetch:
       1146                raise FetchError("Will not fetch %s" %
       1147                                 self.spec.format('{name}{@version}'), ck_msg)
       1148
  >>   1149        self.stage.create()
       1150        self.stage.fetch(mirror_only)
       1151        self._fetch_time = time.time() - start_time
       1152
```
### Information on your system

<!-- Please include the output of `spack debug report` -->
Singularity> spack debug report 
fatal: No names found, cannot describe anything.
* **Spack:** 0.15.3
* **Python:** 3.6.8
* **Platform:** linux-centos8-power9le

no particular customization 

### Additional information

I tried to modify /opt/spack/etc/spack/defaults/config.yaml

changing

  Timeout in seconds used for downloading sources etc. This only applies
  to the connection phase and can be increased for slow connections or
  servers. 0 means no timeout.
  
connect_timeout: 10000

ENV VARIABLES
```console
Singularity> spack find 
==> 5 installed packages
-- linux-centos8-power9le / gcc@8.3.1 ---------------------------
libiconv@1.16  libxml2@2.9.10  pkgconf@1.7.3  xz@5.2.5  zlib@1.2.11
Singularity> env
SINGULARITY_COMMAND=shell
LC_ALL=en_US.UTF-8
LD_LIBRARY_PATH=/.singularity.d/libs
LANG=en_US.UTF-8
NVIDIA_VISIBLE_DEVICES=all
SINGULARITY_CONTAINER=/m100_work/cin_staff/smarocc1/Singularity_spack/only_spack_centos8_docker.sandbox
PWD=/root
HOME=/root
SINGULARITY_ENVIRONMENT=/.singularity.d/env/91-environment.sh
SPACK_ROOT=/opt/spack
TERM=screen-256color
SHELL=/bin/bash
SINGULARITY_NAME=only_spack_centos8_docker.sandbox
NVIDIA_DRIVER_CAPABILITIES=compute,utility
SHLVL=1
LANGUAGE=en_US:en
PATH=/opt/spack/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PS1=Singularity> 
_=/usr/bin/env
```
<!-- Please upload the following files. They should be present in the stage directory of the failing build. Also upload any config.log or similar file if one exists. -->
* [spack-build-out.txt]()
* [spack-build-env.txt]()

they do not exists in 

/opt/spack/opt/spack/linux-centos8-power9le/gcc-8.3.1/cuda-11.0.2-ckas64rppoqhk7umivrfjezetbraypah/


<!-- Some packages have maintainers who have volunteered to debug build failures. Run `spack maintainers <name-of-the-package>` and @mention them here if they exist. -->

spack maintainers cuda 

They do not exists


### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [ ] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [x] I have uploaded the build log and environment files
- [x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:
@svenevs @ax3l 
Can you run `spack --debug fetch cuda` and post the output?
Hello @adamjstewart , in attachment there is the result of 

spack --debug fetch cuda@10.1.243

[cuda_fetch.txt](https://github.com/spack/spack/files/5116788/cuda_fetch.txt)

Thank you for your help,
Simone
Thanks @smarocchi. Can you give the output of the following command:
```console
$ python -c 'import platform; print(platform.system()); print(platform.machine())'
```
It looks like CUDA 10.1.243 is available for Linux-x86_64, but maybe `platform.system()` returns something like `Linux4` instead of `Linux`.
Hello @adamjstewart , I just did it

Singularity> python -c 'import platform; print(platform.system()); print(platform.machine())'
Linux
ppc64le



Resolving patch:
diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py
--- a/var/spack/repos/builtin/packages/cuda/package.py
+++ b/var/spack/repos/builtin/packages/cuda/package.py
@@ -30,7 +30,8 @@
         'Linux-x86_64': ('560d07fdcf4a46717f2242948cd4f92c5f9b6fc7eae10dd996614da913d5ca11', 'http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run'),
         'Linux-ppc64le': ('5227774fcb8b10bd2d8714f0a716a75d7a2df240a9f2a49beb76710b1c0fc619', 'http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux_ppc64le.run')},
     '10.1.243': {
-        'Linux-x86_64': ('e7c22dc21278eb1b82f34a60ad7640b41ad3943d929bebda3008b72536855d31', 'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_418.87.00_linux.run')},
+        'Linux-x86_64': ('e7c22dc21278eb1b82f34a60ad7640b41ad3943d929bebda3008b72536855d31', 'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_418.87.00_linux.run'),
+        'Linux-ppc64le': ('b198002eef010bab9e745ae98e47567c955d00cf34cc8f8d2f0a6feb810523bf', 'https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_418.87.00_linux_ppc64le.run')},
     '10.0.130': {
         'Linux-x86_64': ('92351f0e4346694d0fcb4ea1539856c9eb82060c25654463bfd8574ec35ee39a', 'https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux')},
     '9.2.88': {


Test patch: