cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Machine Learning
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Upgrading cuDNN on Databricks notebook

Amoozegar
New Contributor II

I'm trying to upgrade Tensorflow version from 2.8 to 2.13 on Databricks notebook that is attached to a cluster with Databricks Runtime 10.4. How can I upgrade cuDNN from 8.0 to at least 8.6 to be compatible with the Tensorflow new version?

 

 

3 REPLIES 3

Kaniz
Community Manager
Community Manager

Hi @AmoozegarUpgrading cuDNN to a compatible version with TensorFlow 2.13 is essential for optimal performance.

Letโ€™s walk through the steps:

  1. Check Current cuDNN Version:

    • First, verify the current cuDNN version installed on your Databricks cluster. You can do this by running the following command in a Databricks Notebook:
      !conda list cudnn
      
    • Note down the version number.
  2. Upgrade cuDNN Using Conda:

    • To upgrade cuDNN, you can use conda. Here are a couple of options:
      • Option 1 (Recommended): Install the latest cuDNN version from the conda-forge channel. This channel often provides more up-to-date packages than the default anaconda channel:
        !conda install -c conda-forge cudnn
        
      • Option 2: If you specifically need version 7.4.2 (as mentioned for TensorFlow 2.13), you can force an update to that version:
        !conda install -c anaconda cudnn=7.4.2
        
    • Choose the appropriate option based on your requirements.
  3. Alternative Approach (Advanced):

    • Sometimes, conda might not have the exact version you need. In such cases, you can manually download the cuDNN tar file from NVIDIAโ€™s website.
    • Extract the downloaded tar file to find the โ€œcudaโ€ folder containing the cuDNN files.
    • Copy and paste the cuDNN files to your conda environmentโ€™s lib and include folders. For example:
      sudo cp cuda/include/cudnn*.h /anaconda3/envs/<your_environment_here>/include
      sudo cp cuda/lib64/libcudnn* /anaconda3/envs/<your_environment_here>/lib
      
    • Replace <your_environment_here> with the actual name of your conda environment.
  4. Verify Installation:

    • After upgrading cuDNN, verify that TensorFlow recognizes it. Run the following Python code in your Databricks notebook:
      import tensorflow as tf
      print(tf.config.list_physical_devices('GPU'))
      
    • If a list of GPU devices is returned, youโ€™ve successfully installed TensorFlow with the upgraded cuDNN version.

Remember to adjust the steps based on your specific requirements and environment. Happy TensorFlow-ing! ๐Ÿš€๐Ÿ”

For more details, you can refer to the official TensorFlow GPU installation guide.

Amoozegar
New Contributor II

Hi @Kaniz  , Thanks for your response. When I run '!conda list cudnn' on databricks notebook, I get the following error:    '/bin/bash: conda: command not found'

Amoozegar
New Contributor II

Also I should mention I'm using Databricks Runtime 10.4 for ML, and my assumption is that I might not have direct control over upgrading CUDA or cuDNN within the runtime environment.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.