I am trying to build tensorflow from source on ubuntu 20.04 LTS. I need to build from source because I am running on a Westmere architecture, the binaries available through the package manager is built for AVX instructions which Westmere doesn’t support.
My procedure:
Clone the repository from GitHub - tensorflow/tensorflow: An Open Source Machine Learning Framework for Everyone
check out the r2.11 branch (yes I know it isn’t the latest. It needs to match keras and is good enough)
install bazel
Ran configure, selected no for GPU
compiled it: bazel build --copt=“-march=westmere” //tensorflow/tools/pip_package:build_pip_package
This builds successfully
Next I tried to rebuild, this time GPU enabled.
I used conda to create a new environment and used pip to install the cuda libraries into it.
I am running driver version 535, cuda version 12.2
I re-ran configure, this time choosing to enable GPU support and point it to the library path inside my conda environment. This is how I answered the CUDA questions:
Please specify the CUDA SDK version you want to use. [Leave empty to default to CUDA 11]12 (I also tried 12.2)
Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 2] (chose the default)
Please specify the locally installed NCCL version you want to use. [Leave empty to use GitHub - NVIDIA/nccl: Optimized primitives for collective multi-GPU communication]: (chose the default)
Please specify the comma-separated list of base paths to look for CUDA libraries and headers. [Leave empty to use the default]:/home/myname/anaconda3/envs/tfgpu/include,/home/myname/anaconda3/envs/tfgpu/lib (order seems to be important)
I then get this error: Could not find any nvcc matching version ‘12.2’ in any subdirectory:
‘’
‘bin’
‘local/cuda/bin’
of:
‘/home/myname/anaconda3/envs/tfgpu/include’
‘/home/myname/anaconda3/envs/tfgpu/lib’
How do I install nvcc? there is no pip or apt package.
- List item