Installing from source using Conda and CUDA could be improved
See original GitHub issueThanks to all contributors for their efforts in creating and open sourcing the library. I would like to add my 2 cents of installation process involving building from source for whatever that’s worth.
I always like to install things in conda envs so that there is no clash between different software version or requirement libraries.
MWE:
conda create -n jax python scipy cudnn cudatoolkit
conda list
Now the installation process:
python build/build.py --enable_cuda --cuda_path ~/miniconda3/envs/jax/lib/ --cudnn_path ~/miniconda3/envs/jax/include
2 Problems arise:
1. nvcc cannot be found in path ~/miniconda3/envs/jax/lib/ bin
actually the path is wrong, it should have been ~/miniconda3/envs/jax/bin.
Anyways, I copy nvcc from system wide installation /opt/cuda/bin/nvcc into ~/miniconda3/envs/jax/lib/bin.
So far so good.
2. re-running build it complains about cuda.h
Cuda Configuration Error: Cannot find cuda.h under ~/miniconda3/envs/jax/lib
FAILED: Build did NOT complete successfully (4 packages loaded, 16 targets
ok, let's copy /opt/cuda/include/cuda.h into ~/miniconda3/envs/jax/lib
re-running build after removing completely rm -rf ~/.cache/bazel
gives again the same error about not being able to find cuda.h.
At this point I am out of ideas.
Anyone else having other ideas on how to resolve this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:22 (6 by maintainers)
Top Results From Across the Web
Managing CUDA dependencies with Conda | by David R. Pugh
The most robust approach to obtain NVCC and still use Conda to manage all the other dependencies is to install the NVIDIA CUDA...
Read more >Speed Up PyTorch by Building from Source on Ubuntu 18.04
In my experience, building PyTorch from source reduced training time from 35 seconds to 24 seconds per epoch for an AlexNet-like problem with...
Read more >Is it still necessary to install CUDA before using the conda ...
I see that installing tensorflow-gpu automatically triggers the installation of the cudatoolkit and cudnn. Does this mean that I no longer need ...
Read more >A faster way to get working and up-to-date conda ... - WandB
For example, there are conda packages for cudatoolkit, rust, GCC & more that can't be installed using Pip. This is because Pip installs...
Read more >Install | Caffe2
If you do not wish to use Anaconda, then you must build Caffe2 from source. Anaconda packages#. We build Linux packages without CUDA...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@hawkinsp thanks a lot, especially for your patience.
I think that would be useful for a lot of ppl, not just me and would actually make jax more popular so that ppl could give it a try and report back on things that worked and things that didn’t work. That would facilitate better development of jax IMHO.
The point is that you still need some system-wide install to get
nvcc
at build time.cudatoolkit
isn’t enough. (I guess that’s what is happening for PyTorch.) TF doesn’t really support mixing two different installs, I think. I’m sure PRs would be welcome.I think it would be better to either:
nvcc
dependency from XLA, as outlined above, orcudatoolkit
to run JAX, even if it’s not sufficient to build it.(But note there’s a minor hurdle to the latter, too. XLA needs two unusual things from the CUDA runtime —
libdevice
, which happily thecudatoolkit
package does have, andptxas
, which it does not. It is possible to fall back to using the NVidia kernel driver’s version ofptxas
, and XLA will do just that, but we’ve found it is often buggy and the driver-hosted copy deadlocks from time to time.)Would providing prebuilt Conda packages solve your problem adequately?