Cudnn not available in `conda install cuda -c nvidia`

I’m setting up some sandboxed CUDA development environments using

(cuda-dev)$ conda install cuda -c nvidia
(cuda-dev-11.8)$ conda install cuda=11.8 -c nvidia

I was under the impression that this would install an appropriate version of cuDNN, but it doesn’t:

(cuda-dev) pgoetz@finglas python$ conda list | grep cudnn
(cuda-dev) pgoetz@finglas python$

Further the versions of cudnn available in the nvidia conda channel are quite old:

root@finglas:~# conda search cudnn -c nvidia
Loading channels: done
# Name                       Version           Build  Channel             
cudnn                          7.0.5       cuda8.0_0  pkgs/main           
cudnn                          7.1.2       cuda9.0_0  pkgs/main           
cudnn                          7.1.3       cuda8.0_0  pkgs/main           
cudnn                          7.2.1       cuda9.2_0  pkgs/main           
cudnn                          7.3.1      cuda10.0_0  pkgs/main           
cudnn                          7.3.1       cuda9.0_0  pkgs/main           
cudnn                          7.3.1       cuda9.2_0  pkgs/main           
cudnn                          7.6.0      cuda10.0_0  nvidia              
cudnn                          7.6.0      cuda10.0_0  pkgs/main           
cudnn                          7.6.0      cuda10.1_0  nvidia              
cudnn                          7.6.0      cuda10.1_0  pkgs/main           
cudnn                          7.6.0       cuda9.0_0  pkgs/main           
cudnn                          7.6.0       cuda9.2_0  nvidia              
cudnn                          7.6.0       cuda9.2_0  pkgs/main           
cudnn                          7.6.4      cuda10.0_0  pkgs/main           
cudnn                          7.6.4      cuda10.1_0  pkgs/main           
cudnn                          7.6.4       cuda9.0_0  pkgs/main           
cudnn                          7.6.4       cuda9.2_0  pkgs/main           
cudnn                          7.6.5      cuda10.0_0  pkgs/main
cudnn                          7.6.5      cuda10.1_0  pkgs/main           
cudnn                          7.6.5      cuda10.2_0  pkgs/main           
cudnn                          7.6.5       cuda9.0_0  pkgs/main           
cudnn                          7.6.5       cuda9.2_0  pkgs/main           
cudnn                          8.0.0      cuda10.2_0  nvidia              
cudnn                          8.0.0      cuda11.0_0  nvidia              
cudnn                          8.0.4      cuda10.1_0  nvidia              
cudnn                          8.0.4      cuda10.2_0  nvidia              
cudnn                          8.0.4      cuda11.0_0  nvidia              
cudnn                          8.0.4      cuda11.1_0  nvidia              
cudnn                          8.2.1      cuda11.3_0  pkgs/main           
cudnn                     cuda11_0  pkgs/main           

The version of cudnn recommended by Nvidia for CUDA >= 11.8 is 8.9.5.

And if I try to install an older version of cudnn from either the nvidia or the main channel:

(cuda-dev-11.3) root@finglas:~# conda install cudnn -c nvidia
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /usr/opt/miniconda/envs/cuda-dev-11.3

  added / updated specs:
    - cudnn

The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main
  _openmp_mutex      pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu
  cudatoolkit        pkgs/main/linux-64::cudatoolkit-11.8.0-h6a678d5_0
  cudnn              pkgs/main/linux-64::cudnn-
  libgcc-ng          pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1
  libgomp            pkgs/main/linux-64::libgomp-11.2.0-h1234567_1
  libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1

Proceed ([y]/n)? n

It appears to want to install an older version of the cudatoolkit when cudatoolkit version 12.2.2 is already installed (for CUDA versions 11.3, 11.8, 12.0, an 12.2 – the only versions I’ve created environments for). I’ve already tried installing cudnn from the nvidia channel in a pytorch environment and it broke everything, so I’m loathe to repeat this experiment.

I’m trying to avoid using pip to install packages in conda, but pip install cudnn couldn’t locate an appropriate package, either.

Any thoughts on how to address this lacuna?