Repository: tensorflow
Issue: Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice
Labels: stat:awaiting tensorflower,type:build/install,comp:gpu,subtype: ubuntu/linux,wsl2

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Source

binary

### Tensorflow Version

tf-nightly

### Custom Code

Yes

### OS Platform and Distribution

WSL Ubuntu

### Mobile device

_No response_

### Python version

3.9

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

11.2

### GPU model and memory

_No response_

### Current Behaviour?

```shell
Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice

The error appears when setting groups > 1 in tf.keras.layers.Conv2D with tf-nightly.

The error does not appear in TensorFlow 2.8.

Seems the previous TensorFlow build is packed with libdevice.
```


### Standalone code to reproduce the issue

```shell
tf.keras.layers.Conv2D(
            512, 
            1,
            use_bias=False
            groups=5,
            )
```


### Relevant log output

```shell
2022-07-28 01:48:13.943787: W tensorflow/compiler/xla/service/gpu/nvptx_helper.cc:56] Can't find libdevice directory ${CUDA_DIR}/nvvm/libdevice. This may result in compilation or runtime failures, if the program we try to run uses routines from libdevice.
Searched for CUDA in the following directories:
  ./cuda_sdk_lib
  /usr/local/cuda-11.2
  /usr/local/cuda
  .
You can choose the search directory by setting xla_gpu_cuda_data_dir in HloModule's DebugOptions.  For most apps, setting the environment variable XLA_FLAGS=--xla_gpu_cuda_data_dir=/path/to/cuda will work.
2022-07-28 01:48:13.986332: I tensorflow/core/platform/default/subprocess.cc:304] Start cannot spawn child process: No such file or directory
2022-07-28 01:48:13.986408: W tensorflow/stream_executor/gpu/asm_compiler.cc:80] Couldn't get ptxas version string: INTERNAL: Couldn't invoke ptxas --version
2022-07-28 01:48:14.018602: I tensorflow/core/platform/default/subprocess.cc:304] Start cannot spawn child process: No such file or directory
2022-07-28 01:48:14.018778: F tensorflow/compiler/xla/service/gpu/nvptx_compiler.cc:453] ptxas returned an error during compilation of ptx to sass: 'INTERNAL: Failed to launch ptxas'  If the error message indicates that a file could not be written, please verify that sufficient filesystem space is provided.
Fatal Python error: Aborted

Thread 0x00007f3abe7fc640 (most recent call first):
  File "/home/edwardyehuang/miniconda3/envs/tf-nightly/lib/python3.9/threading.py", line 316 in wait
  File "/home/edwardyehuang/miniconda3/envs/tf-nightly/lib/python3.9/threading.py", line 574 in wait
  File "/home/edwardyehuang/.vscode-server/extensions/ms-python.python-2022.10.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 257 in _on_run
  File "/home/edwardyehuang/.vscode-server/extensions/ms-python.python-2022.10.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_daemon_thread.py", line 49 in run
  File "/home/edwardyehuang/miniconda3/envs/tf-nightly/lib/python3.9/threading.py", line 973 in _bootstrap_inner
  File "/home/edwardyehuang/miniconda3/envs/tf-nightly/lib/python3.9/threading.py", line 930 in _bootstrap

Thread 0x00007f3abeffd640 (most recent call first):
  File "/home/edwardyehuang/miniconda3/envs/tf-nightly/lib/python3.9/threading.py", line 316 in wait
  File "/home/edwardyehuang/miniconda3/envs/tf-nightly/lib/python3.9/threading.py", line 574 in wait
  File "/home/edwardyehuang/.vscode-server/extensions/ms-python.python-2022.10.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 211 in _on_run
  File "/home/edwardyehuang/.vscode-server/extensions/ms-python.python-2022.10.1/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_daemon_thread.py", line 49 in run
  File "/home/edwardyehuang/miniconda3/envs/tf-nightly/lib/python3.9/threading.py", line 973 in _bootstrap_inner
  File "/home/edwardyehuang/miniconda3/envs/tf-nightly/lib/python3.9/threading.py", line 930 in _bootstrap
```
</details>