# Problem with vdrift



## MHA152 (Sep 9, 2013)

Hello,

I installed vdrift from ports but I have to run it from terminal and it doesn't have any icon on the application menu. When I run it the system gives me these errors:

```
INFO: Multi-processor system detected.  Run with -multithreaded argument to enable multithreading (EXPERIMENTAL).
INFO: Starting VDrift: 2013-09-09-full, Version: , O/S: Unix-like
INFO: Home directory: /home
INFO: Settings file: /home/.vdrift/VDrift.config (does not exist, will be created)
INFO: Data directory: /usr/local/share/vdrift
      DATA_DIR: /usr/local/share/vdrift
INFO: Log file: /home/.vdrift/log.txt
INFO: SDL initialization successful
INFO: SDL video query was successful
INFO: Disabling antialiasing
INFO: Display change was successful: 800x600x16 24z fullscreen=0
ERROR: You don't have an NVIDIA or ATI/AMD card.  This game may not run correctly or at all.
INFO: Video card information:
      Vendor: Mesa Project
      Renderer: Software Rasterizer
      Version: 2.1 Mesa 7.6.1
      Maximum texture size: 4096
      Maximum varying floats: 64
      Using GLEW 1.10.0
INFO: Maximum color attachments: 8
INFO: Maximum draw buffers (1 required): 4
INFO: Texture units: 8 full, 16 partial
INFO: Loaded shader package simple
INFO: Loaded shader package simple, variant simple_premult
INFO: Loaded shader package simple, variant simple_gamma_premult
INFO: Loaded shader package simple, variant simple_gamma
INFO: Loaded shader package simple, variant simplecar
INFO: Loaded shader package logluminance
INFO: ----- Start Shader Compile Log for /usr/local/share/vdrift/shaders/logluminance/fragment.glsl -----
INFO: Error: texture2DLod: undeclared function name.
      
INFO: ----- End Shader Compile Log -----
INFO: ----- Start Shader Link Log for /usr/local/share/vdrift/shaders/logluminance/vertex.glsl and /usr/local/share/vdrift/shaders/logluminance/fragment.glsl -----
INFO: linking with uncompiled shader
      
INFO: ----- End Shader Link Log -----
ERROR: Shader compilation failure: /usr/local/share/vdrift/shaders/logluminance/vertex.glsl and /usr/local/share/vdrift/shaders/logluminance/fragment.glsl
ERROR: 
ERROR: Vertex shader:
ERROR: 1    : #version 120
ERROR: 2    : #define _TINY_
ERROR: 3    : #define _REFLECTIONSTATIC_
ERROR: 4    : #define SCREENRESY 600
ERROR: 5    : #define SCREENRESX 800
ERROR: 6    : varying vec2 tu0coord;
ERROR: 7    : 
ERROR: 8    : void main()
ERROR: 9    : {
ERROR: 10   : 	// Transforming the vertex
ERROR: 11   : 	gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex;
ERROR: 12   : 	
ERROR: 13   : 	tu0coord = vec2(gl_MultiTexCoord0);
ERROR: 14   : }
ERROR: 15   : 
ERROR: 
ERROR: Fragment shader:
ERROR: 1    : #version 120
ERROR: 2    : #define _TINY_
ERROR: 3    : #define _REFLECTIONSTATIC_
ERROR: 4    : #define SCREENRESY 600
ERROR: 5    : #define SCREENRESX 800
ERROR: 6    : varying vec2 tu0coord;
ERROR: 7    : 
ERROR: 8    : uniform sampler2D tu0_2D;
ERROR: 9    : 
ERROR: 10   : const vec3 LUMINANCE = vec3(0.2125, 0.7154, 0.0721);
ERROR: 11   : const float DELTA = 0.0001;
ERROR: 12   : 
ERROR: 13   : /*const float scale = 0.1;
ERROR: 14   : const float offset = 5.;
ERROR: 15   : const float timefactor = 0.1;
ERROR: 16   : const float scale_tiny = 3.0;
ERROR: 17   : const float offset_tiny = -0.12;*/
ERROR: 18   : 
ERROR: 19   : const float scale = 0.25;
ERROR: 20   : const float offset = 2.0;
ERROR: 21   : const float timefactor = 0.1;
ERROR: 22   : //const float timefactor = 1.0;
ERROR: 23   : 
ERROR: 24   : void main()
ERROR: 25   : {
ERROR: 26   : 	#ifdef _TINY_
ERROR: 27   : 	float lod = 9;
ERROR: 28   : 	//gl_FragColor.rgb = vec3(1.,1.,1.)*(texture2DLod(tu0_2D, tu0coord, lod).r+offset_tiny)*scale_tiny;
ERROR: 29   : 	gl_FragColor.rgb = vec3(1.,1.,1.)*texture2DLod(tu0_2D, tu0coord, lod).r;
ERROR: 30   : 	gl_FragColor.a = timefactor;
ERROR: 31   : 	#else
ERROR: 32   : 	float luminance = dot(LUMINANCE,texture2D(tu0_2D, tu0coord).rgb);
ERROR: 33   : 	float logluminance = log(luminance+DELTA);
ERROR: 34   : 	gl_FragColor.rgb = vec3(1.,1.,1.)*(logluminance+offset)*scale;
ERROR: 35   : 	#endif
ERROR: 36   : }
ERROR: 37   : 
ERROR: 
ERROR: Disabling shaders due to shader loading error
INFO: Maximum anisotropy: 0
INFO: 0 joysticks found.
INFO: Loading car controls from: /home/.vdrift/controls.config
INFO: Sound initialization information:
INFO: Obtained audio device:
      Frequency: 44100
      Format: 32784
      Bits per sample: 16
      Channels: 2
      Silence: 0
      Samples: 2048
      Size: 8192
      Sound initialization successful
INFO: Loaded fonts successfully
INFO: Loaded GUI successfully
```
and after that when I want to play, it doesn't move smoothly.


----------



## SirDice (Sep 9, 2013)

It seems to require accelerated 2D/3D graphics, which you don't seem to have. What videocard do you have and what's configured in xorg.conf?


----------



## MHA152 (Sep 9, 2013)

I don't have xorg.conf. How can I understand what is my videocard? I know it's Nvidia but I don't know which one it is.


----------



## SirDice (Sep 9, 2013)

MHA152 said:
			
		

> How can I understand what is my videocard? I know it's NVidia but I don't know which one is it?


You can usually find out on a running system by looking at the output of `pciconf -lv`.

Depending on the exact type you can install and configure x11/nvidia-driver. Older cards may need the legacy drivers, they are in the ports tree too. Most recent cards use nvidia-driver.


----------



## MHA152 (Sep 10, 2013)

This is the output of that code.

```
vgapci0@pci0:1:0:0:	class=0x030000 card=0x15721462 chip=0x064110de rev=0xa1 hdr=0x00
    vendor     = 'nVidia Corporation'
    device     = 'G96 [GeForce 9400 GT]'
    class      = display
    subclass   = VGA
```
Now I have to install x11/nvidia-driver or another one?


----------



## SirDice (Sep 10, 2013)

MHA152 said:
			
		

> Now I have to install x11/nvidia-driver or another one?


No, that one should work.

http://www.nvidia.co.uk/object/freebsd-x64-319.49-driver-uk.html
Don't use the driver from the link, just use the port. I linked it for the "supported models" list.


----------



## MHA152 (Sep 11, 2013)

I can't install it.

```
root@ALAHDADIAN:/home # portmaster /usr/ports/x11/nvidia-driver

===>>> Port directory: /usr/ports/x11/nvidia-driver

===>>> Gathering distinfo list for installed ports

===>>> Launching 'make checksum' for x11/nvidia-driver in background
===>>> Gathering dependency list for x11/nvidia-driver from ports
===>>> Launching child to install emulators/linux_base-f10

===>>> x11/nvidia-driver >> emulators/linux_base-f10 (1/1)

===>>> Port directory: /usr/ports/emulators/linux_base-f10

	===>>> This port is marked IGNORE
	===>>> linuxulator is not (kld)loaded


	===>>> If you are sure you can build it, remove the
	       IGNORE line in the Makefile and try again.

===>>> Update for emulators/linux_base-f10 failed
===>>> Aborting update

===>>> Killing background jobs
Terminated
===>>> Exiting
```
and this is my make.conf

```
# added by use.perl 2013-07-11 08:13:06
PERL_VERSION=5.14.4
#use aria2c
FETCH_CMD=aria2c -c -s16 -x16 -k1M
DISABLE_SIZE=yes
```


----------



## SirDice (Sep 11, 2013)

`kldload linux`

Or turn off Linux compatibility if you're not going to use it.


----------



## MHA152 (Sep 12, 2013)

I remove that option and try to install it but there is one more problem

```
===>>> Port directory: /usr/ports/x11/nvidia-driver

===>>> Gathering distinfo list for installed ports

===>>> Launching 'make checksum' for x11/nvidia-driver in background
===>>> Gathering dependency list for x11/nvidia-driver from ports
===>>> Initial dependency check complete for x11/nvidia-driver


===>>> Starting build for x11/nvidia-driver <<<===

===>>> All dependencies are up to date

===>  Cleaning for nvidia-driver-319.32
===>  License NVIDIA accepted by the user
===>  Found saved configuration for nvidia-driver-319.32
===> Fetching all distfiles required by nvidia-driver-319.32 for building
===>  Extracting for nvidia-driver-319.32
=> SHA256 Checksum OK for NVIDIA-FreeBSD-x86_64-319.32.tar.gz.
===>  Patching for nvidia-driver-319.32
===>   nvidia-driver-319.32 depends on file: /usr/local/libdata/pkgconfig/glproto.pc - found
===>   nvidia-driver-319.32 depends on file: /usr/local/libdata/pkgconfig/dri2proto.pc - found
===>   nvidia-driver-319.32 depends on file: /usr/local/libdata/pkgconfig/xorg-server.pc - found
===>   nvidia-driver-319.32 depends on shared library: GL.1 - found
===>  Configuring for nvidia-driver-319.32
===>  Building for nvidia-driver-319.32
===> src (all)
"/usr/share/mk/bsd.kmod.mk", line 12: "can't find kernel source tree"
*** [all] Error code 1
1 error
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** [do-build] Error code 1

Stop in /usr/ports/x11/nvidia-driver.
*** [build] Error code 1

Stop in /usr/ports/x11/nvidia-driver.

===>>> make failed for x11/nvidia-driver
===>>> Aborting update

===>>> Killing background jobs
Terminated

===>>> You can restart from the point of failure with this command line:
       portmaster <flags> x11/nvidia-driver 

===>>> Exiting
```


----------



## cpm@ (Sep 12, 2013)

Seems that you have missing /usr/src/sys/conf/kmod.mk to install the x11/nvidia-driver port.

Do you have the full source tree?  Check that /usr/src is properly populated.


----------



## MHA152 (Sep 13, 2013)

I don't install from source to have sources*.*


----------



## cpm@ (Sep 13, 2013)

MHA152 said:
			
		

> I don't install from source to have sources



You should fetch /usr/src to recover the missing file. In the previous post you have the instructions published by @wblock@ to do it properly


----------



## MHA152 (Sep 13, 2013)

Where can I fetch /usr/src? Why do I need it?


----------



## kpa (Sep 13, 2013)

You must have the system sources to compile ports that install kernel modules. See here:

http://www.freebsd.org/doc/en/books/handbook/synching.html


----------

