2. Follow instructions here (https://www.tensorflow.org/install/pip?hl=pt-br)
2.1 - Create environmente:
conda create -n mlconda_3.10.11 python==3.10.11
2.2 - Activate:
conda activate mlconda_3.10.11
2.3 - Check if NVIDIA driver is installed
nvidia-smi
- Install CUDA e cuDNN:
conda install -c conda-forge cudatoolkit=11.8.0
pip install nvidia-cudnn-cu11==8.6.0.163
(for future versions of TensorFlow and Python, check the specific versions of CUDA and cuDNN here: https://www.tensorflow.org/install/source)
- Add the paths of CUDA and cuDNN to the miniconda environments:
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONDA_PREFIX/lib/:$CUDNN_PATH/lib' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
- Install pip packages (tensorflow and whatever you will need):
pip install tensorflow=2.12.0
- IMPORTANT! Symlink cuda! Cuda is installed in /opt/cuda, but tensorflow is lookin for it at /usr/local/cuda. So we will symlink the real path to the expected one:
sudo ln -s /opt/cuda /usr/local/cuda
(alternatively, use a docker image... in pyenv it seems to be a hell to configure everything)