cupy - and GPU in general

I am starting to move from Matlab to python. For the purpose of GPU processing (HPC) and faster plotting.

I am trying to develop numerical simulations of nonlinear materials, using FEM. We have started developing and alternative FEM formulation, which runs in vector form - fully GPU compatible parallel computation. This means I have to develop a new branch of "equivalent" models, and so forth. Which requires a flexible access to GPU math operations to experiment with.

PyCharm was proposed as the default option for GUI / IDE after downloading conda. And I am now trying different GPU computation options offered by python.

CUPY seems to be very promising. But I can not install the package. It seems to conflict with the most recent CUDA drivers. It keeps showing the error:

__

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Solving environment: ...working...
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed


Building graph of deps: 0%| | 0/3 [00:00<?, ?it/s]
Examining python=3.8: 0%| | 0/3 [00:00<?, ?it/s]
Examining cupy: 33%|###3 | 1/3 [00:00<00:00, 28.68it/s]
Examining @/win-64::__cuda==11.0=0: 67%|######6 | 2/3 [00:00<00:00, 5.80it/s]
Examining @/win-64::__cuda==11.0=0: 100%|##########| 3/3 [00:00<00:00, 8.69it/s]

Determining conflicts: 0%| | 0/3 [00:00<?, ?it/s]
Examining conflict for python cupy: 0%| | 0/3 [00:00<?, ?it/s]
Examining conflict for __cuda: 33%|###3 | 1/3 [00:00<00:00, 16.16it/s]

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\install.py", line 265, in install
should_retry_solve=(_should_retry_unfrozen or repodata_fn != repodata_fns[-1]),
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\solve.py", line 117, in solve_for_transaction
should_retry_solve)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\solve.py", line 158, in solve_for_diff
force_remove, should_retry_solve)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\solve.py", line 275, in solve_final_state
ssc = self._add_specs(ssc)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\solve.py", line 696, in _add_specs
raise UnsatisfiableError({})
conda.exceptions.UnsatisfiableError:
Did not find conflicting dependencies. If you would like to know which
packages conflict ensure that you have enabled unsatisfiable hints.

conda config --set unsatisfiable_hints True


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__
return func(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
exit_code = do_call(args, p)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 82, in do_call
return getattr(module, func_name)(args, parser)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\main_install.py", line 20, in execute
install(args, parser, 'install')
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\cli\install.py", line 299, in install
should_retry_solve=(repodata_fn != repodata_fns[-1]),
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\solve.py", line 117, in solve_for_transaction
should_retry_solve)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\solve.py", line 158, in solve_for_diff
force_remove, should_retry_solve)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\solve.py", line 275, in solve_final_state
ssc = self._add_specs(ssc)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\core\solve.py", line 694, in _add_specs
ssc.r.find_conflicts(spec_set)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\resolve.py", line 347, in find_conflicts
bad_deps = self.build_conflict_map(specs, specs_to_add, history_specs)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\resolve.py", line 507, in build_conflict_map
root, search_node, dep_graph, num_occurances)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\resolve.py", line 369, in breadth_first_search_for_dep_graph
last_spec = MatchSpec.union((path[-1], target_paths[-1][-1]))[0]
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\models\match_spec.py", line 481, in union
return cls.merge(match_specs, union=True)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\models\match_spec.py", line 475, in merge
reduce(lambda x, y: x._merge(y, union), group) if len(group) > 1 else group[0]
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\models\match_spec.py", line 475, in <lambda>
reduce(lambda x, y: x._merge(y, union), group) if len(group) > 1 else group[0]
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\models\match_spec.py", line 502, in _merge
final = this_component.union(that_component)
File "C:\ProgramData\Anaconda3\lib\site-packages\conda\models\match_spec.py", line 764, in union
return '|'.join(options)
TypeError: sequence item 0: expected str instance, Channel found

`$ C:\ProgramData\Anaconda3\Scripts\conda-script.py install -p C:/ProgramData/Anaconda3/envs/untitled1 cupy -y`

environment variables:
CIO_TEST=<not set>
CONDA_DEFAULT_ENV=untitled1
CONDA_PREFIX=C:\ProgramData\Anaconda3\envs\untitled1
CONDA_PROMPT_MODIFIER=(untitled1)
CONDA_ROOT=C:\ProgramData\Anaconda3
CONDA_SHLVL=1
CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0
HOMEPATH=\Users\LAB-PC
NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\
PATH=C:\ProgramData\Anaconda3\envs\untitled1;C:\ProgramData\Anaconda3\envs\
untitled1\Library\mingw-w64\bin;C:\ProgramData\Anaconda3\envs\untitled
1\Library\usr\bin;C:\ProgramData\Anaconda3\envs\untitled1\Library\bin;
C:\ProgramData\Anaconda3\envs\untitled1\Scripts;C:\ProgramData\Anacond
a3\envs\untitled1\bin;C:\ProgramData\Anaconda3\condabin;C:\Program
Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin;C:\Program
Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\libnvvp;C:\Program
Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin;C:\Program
Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp;C:\Program
Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program
Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;C:\Program
Files\Oculus\Support\oculus-runtime;C:\Program Files
(x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program
Files\Intel\Intel(R) Management Engine Components\iCLS;C:\WINDOWS\syst
em32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPo
werShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files
(x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program
Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files
(x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program
Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program
Files\MATLAB\R2018b\runtime\win64;C:\Program
Files\MATLAB\R2018b\bin;C:\Program Files\Plaxis\PLAXIS
3D\python\plxpy;C:\Program Files\SlikSvn\bin;C:\Program
Files\Git\cmd;C:\Program Files (x86)\NVIDIA
Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin;C:\Program
Files\Common Files\Intel\WirelessCommon;C:\Program Files\NVIDIA
Corporation\NVIDIA NvDLISR;C:\Program Files\NVIDIA Corporation\Nsight
Compute 2020.1.0;C:\Users\LAB-
PC\AppData\Local\Microsoft\WindowsApps;C:\Users\LAB-
PC\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64
PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\Windows
PowerShell\v1.0\Modules
REQUESTS_CA_BUNDLE=<not set>
SSL_CERT_FILE=<not set>

active environment : untitled1
active env location : C:\ProgramData\Anaconda3\envs\untitled1
shell level : 1
user config file : C:\Users\LAB-PC\.condarc
populated config files :
conda version : 4.8.2
conda-build version : 3.18.11
python version : 3.7.6.final.0
virtual packages : __cuda=11.0
base environment : C:\ProgramData\Anaconda3 (read only)
channel URLs : https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\ProgramData\Anaconda3\pkgs
C:\Users\LAB-PC\.conda\pkgs
C:\Users\LAB-PC\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\LAB-PC\.conda\envs
C:\ProgramData\Anaconda3\envs
C:\Users\LAB-PC\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.8.2 requests/2.22.0 CPython/3.7.6 Windows/10 Windows/10.0.17134
administrator : False
netrc file : None
offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

Upload successful.

__

 

How do I get CUPY running?

Is there a detailed tutorial on using the math in cuda - operations, memory allocation, plotting.

I'd love to make a code which can compute simulations using the NVIDIA card, then plot it using the Intel graphics card. That would be amazing. Not sure if python is adequate for it, though. And I'm in no shape to resolve cross compatibility issues between different packages. I'm just starting to get into python, after many years working with Matlab.

 

1 comment
Comment actions Permalink

Hi, do you mean CuPy, an implementation of NumPy-compatible multi-dimensional array on CUDA ?

Have you tried the official installation guide? https://docs-cupy.chainer.org/en/stable/install.html#install-cupy

 

0

Please sign in to leave a comment.