I am using Windows 11 with an NVIDIA RTX A4000; and have WSL2 installed with Ubuntu 22.10. I have been following the CUDA on WSL User Guide and at Step 2 (having WSL2 already installed), I installed the NVIDIA RTX Quadro Windows 11 display driver (version is now 531.18). At Step 3 I took the recommended first option (the CUDA WSL-Ubuntu local installer).
#include <stdio.h>
__global__ void cuda_hello(){
printf("Hello World from GPU!\n");
}
int main() {
cuda_hello<<<1,1>>>();␠
return 0;
}
I have tried a simple vector addition test, as well as hello world (shown for reference above). I have not set any environment variables (yet), and I compile using /usr/local/cuda/bin/nvcc hello.cu. As well as these 2 CUDA programs, I also note an exe has been installed at /usr/local/cuda-12.0/bin/__nvcc_device_query. All 3 of these programs fail with: Segmentation fault.
I also tried setting export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH beforehand, but the segmentation error remains. Can anyone offer advice?
My setup is very close to yours, WSL Ubuntu 22.04 and RTX A4000. The sample programs work. Here’s output of deviceQuery:
elsaco@RIPPER:/usr/local/cuda/extras/demo_suite$ ./deviceQuery
./deviceQuery Starting...
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: "NVIDIA RTX A4000"
CUDA Driver Version / Runtime Version 12.1 / 12.1
CUDA Capability Major/Minor version number: 8.6
Total amount of global memory: 16376 MBytes (17170956288 bytes)
(48) Multiprocessors, (128) CUDA Cores/MP: 6144 CUDA Cores
GPU Max Clock rate: 1560 MHz (1.56 GHz)
Memory Clock rate: 7001 Mhz
Memory Bus Width: 256-bit
L2 Cache Size: 4194304 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 1536
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 1 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device supports Compute Preemption: Yes
Supports Cooperative Kernel Launch: Yes
Supports MultiDevice Co-op Kernel Launch: No
Device PCI Domain ID / Bus ID / location ID: 0 / 97 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 12.1, CUDA Runtime Version = 12.1, NumDevs = 1, Device0 = NVIDIA RTX A4000
Result = PASS
However, when running the hello test no output is being shown and misc dxg: dxgk: dxgkio_reserve_gpu_va: Ioctl failed: -75 is being logged in the kernel buffer. That looks like a WSL issue.
I hadn’t noticed that ./deviceQueryand friends were also installed. I tried it, and it worked. In fact all the programs I mentioned now work. I don’t remember making any significant change. (I also remembered that a call to cudaDeviceSynchronizeis needed after the call to cuda_hello to ensure the message appears on-screen.)