NVIDIA / cuda-samples

Samples for CUDA Developers which demonstrates features in CUDA Toolkit
Other
6.47k stars 1.83k forks source link

nbody compilation error, GL/gl.h not found. #298

Open ar-valdez opened 2 months ago

ar-valdez commented 2 months ago

Hello, I followed the guidance of this historical issue but it still fails to compile. Let me post my compilation error here:

(base) abv5357@E1-055656:~/Documents/FutureProjects/cuda-samples/Samples/5_Domain_Specific/nbody$ make dbg=1
WARNING - GCC variable has been deprecated
WARNING - please use HOST_COMPILER=/home/abv5357/anaconda3/bin/x86_64-conda-linux-gnu-gcc instead
/usr/local/cuda/bin/nvcc -ccbin /home/abv5357/anaconda3/bin/x86_64-conda-linux-gnu-gcc -I../../../Common  -m64 -g -G    -ftz=true --threads 0 --std=c++11 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_90,code=compute_90 -o bodysystemcuda.o -c bodysystemcuda.cu
In file included from ../../../Common/GL/freeglut.h:17,
                 from bodysystemcuda.cu:35:
../../../Common/GL/freeglut_std.h:84:10: fatal error: GL/gl.h: No such file or directory
   84 | #include <GL/gl.h>
      |          ^~~~~~~~~
compilation terminated

I am sure that mesa-common-dev is installed in my system. You can check it with the next attempt to re-install.

(base) abv5357@E1-055656:~$ sudo apt install mesa-common-dev
[sudo] password for abv5357: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mesa-common-dev is already the newest version (21.2.6-0ubuntu0.1~20.04.2).
0 upgraded, 0 newly installed, 0 to remove and 65 not upgraded.

Have I missed something? In case you need my system detail here they are:

(base) abv5357@E1-055656:~$ nvidia-smi Fri Sep 20 08:53:26 2024

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 560.35.03              Driver Version: 560.35.03      CUDA Version: 12.6     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA TITAN Xp                Off |   00000000:C1:00.0  On |                  N/A |
| 23%   35C    P8             19W /  250W |     448MiB /  12288MiB |     26%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      1970      G   /usr/lib/xorg/Xorg                             35MiB |
|    0   N/A  N/A      3467      G   /usr/lib/xorg/Xorg                            183MiB |
|    0   N/A  N/A      3628      G   /usr/bin/gnome-shell                          114MiB |
|    0   N/A  N/A      8637      G   ...seed-version=20240918-180211.633000         98MiB |
+-----------------------------------------------------------------------------------------+

Thank you.-