> python3 -c "import torch; print(torch.cuda.is_available())"
If it matters, I installed pytorch, in my container, using pip3 from the instructions available here: https://pytorch.org/get-started/locally/
> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
> nvidia-smi
Thu Jun 6 20:10:41 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.48 Driver Version: 410.48 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 208... Off | 00000000:01:00.0 Off | N/A |
| 0% 35C P8 21W / 260W | 0MiB / 10989MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 1 GeForce RTX 208... Off | 00000000:02:00.0 Off | N/A |
| 0% 36C P8 20W / 260W | 0MiB / 10989MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
The two commands above have the same outputs on both the host machine and my custom built container.
The only command that differs is the deviceQuery inside CUDA Samples. Yes, I rebooted my host, no luck. See below.
> ./bin/x86_64/linux/release/deviceQuery --------> [inside container]
./bin/x86_64/linux/release/deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 30
-> unknown error
Result = FAIL
> ./bin/x86_64/linux/release/deviceQuery | tail -n 1 --------> [on host]
Result = PASS
I run docker as follows:
> docker run --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all -it -v /home/containers/pytorch/:/home/pytorch/ pytorch:custom_build