I use linux container, and cuda root is something different.
Now I add CUDA_HOME into environment variables, then conda install from source, and  it can compile cuda correctly. But I still get torch.cuda.is_available false.
running build_ext
-- Building with NumPy bindings
-- Detected cuDNN at /home/ubuntu/cuda/lib64, /home/ubuntu/cuda/include
-- Detected CUDA at /home/ubuntu/cuda
-- Building NCCL library
-- Building with distributed package
-- Not using NNPACK

I tried to run cuda samples, it returned the following error.  Hot reboot or cold reboot doesn’t work.
deviceQuery.exe Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

cudaGetDeviceCount returned 30
-> unknown error
Result = FAIL