Segmentation fault after trying to create a tensor with float values
Labels: needs reproduction, module: rocm, triaged



I'm running PyTorch with ROCm inside a docker container on Ubuntu 20.04, and PyTorch gives me a segmentation fault whenever i try to create a tensor with float values in it using my GPU (e.g. ```torch.tensor([0.]).to('cuda')```). It's weird because it works perfectly fine with int tensors (e.g. ```torch.tensor([0]).to('cuda')```). Also there is no such problem if i use my CPU (e.g. ```torch.tensor([0.]).to('cpu')```).

Example code to reproduce the error is present below:
```python
import torch
print(torch.tensor([0.]).to('cuda'))
```
The error message is as follows:
```
Segmentation fault (core dumped)
```
I've tried debugging with gdb in an attempt to pinpoint the source of the issue:
```
(gdb) r -c "import torch; print(torch.cuda.is_available()); print(torch.tensor([0.]).to('cuda'))"
Starting program: /opt/conda/bin/python -c "import torch; print(torch.cuda.is_available()); print(torch.tensor([0.]).to('cuda'))"
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after fork from child process 4469]
[New Thread 0x7ffe55e3b700 (LWP 4470)]
[New Thread 0x7ffe5363a700 (LWP 4471)]
[New Thread 0x7ffe50e39700 (LWP 4472)]
[New Thread 0x7ffe4e638700 (LWP 4473)]
[New Thread 0x7ffe4be37700 (LWP 4474)]
[New Thread 0x7ffe49636700 (LWP 4475)]
[New Thread 0x7ffe46e35700 (LWP 4476)]
[New Thread 0x7ffe44634700 (LWP 4477)]
[New Thread 0x7ffe41e33700 (LWP 4478)]
[New Thread 0x7ffe3f632700 (LWP 4479)]
[New Thread 0x7ffe3ee31700 (LWP 4480)]
[New Thread 0x7ffe3720b700 (LWP 4481)]
[New Thread 0x7ffe36a0a700 (LWP 4482)]
[Thread 0x7ffe36a0a700 (LWP 4482) exited]
True

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007fffbd2274c5 in ?? () from /opt/rocm/lib/libamdhip64.so.5

```

### Versions

```
PyTorch version: 1.13.0a0+git941769a
Is debug build: False
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: 5.4.22801-aaa1e3d8

OS: Ubuntu 20.04.5 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: 15.0.0 (https://github.com/RadeonOpenCompute/llvm-project roc-5.4.0 22465 d6f0fe8b22e3d8ce0f2cbd657ea14b16043018a5)
CMake version: version 3.22.1
Libc version: glibc-2.31

Python version: 3.8.13 (default, Mar 28 2022, 11:38:47)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.15.0-56-generic-x86_64-with-glibc2.17
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: 
GPU models and configuration: Radeon RX 580 Series
Nvidia driver version: Could not collect
cuDNN version: Could not collect
HIP runtime version: 5.4.22801
MIOpen runtime version: 2.19.0
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy==0.960
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.22.4
[pip3] torch==1.13.0a0+git941769a
[pip3] torchvision==0.14.0a0+bd70a78
[conda] mkl                       2022.0.1           h06a4308_117  
[conda] mkl-include               2022.0.1           h06a4308_117  
[conda] numpy                     1.22.4                   pypi_0    pypi
[conda] torch                     1.13.0a0+git941769a          pypi_0    pypi
[conda] torchvision               0.14.0a0+bd70a78          pypi_0    pypi
```

cc @ezyang @gchanan @zou3519 @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport