Magnetic fields, which play a major role in a large number of astrophysical processes from galactic to cosmological scales, can be traced via observations of dust polarization as demonstrated by the Planck satellite results. In particular, low-resolution observations of dust polarization have demonstrated that Galactic filamentary structures, where star formation takes place, are associated to well organized magnetic fields. A better understanding of this process requires detailed observations of galactic dust polarization on scales of 0.01 to 0.1 pc. Such high-resolution polarization observations can be carried out at the IRAM 30 m telescope using the recently installed NIKA2 camera, which features two frequency bands at 260 and 150 GHz (respectively 1.15 and 2.05 mm), the 260 GHz band being polarization sensitive. NIKA2 so far in commissioning phase, has its focal plane filled with ~3300 detectors to cover a Field of View (FoV) of 6.5 arcminutes diameter. The NIKA camera, which consisted of two arrays of 132 and 224 Lumped Element Kinetic Inductance Detectors (LEKIDs) and a FWHM (Full-Width-Half-Maximum) of 12 and 18.2 arcsecond at 1.15 and 2.05 mm respectively, has been operated at the IRAM 30 m telescope from 2012 to 2015 as a test-bench for NIKA2. NIKA was equipped of a room temperature polarization system (a half wave plate (HWP) and a grid polarizer facing the NIKA cryostat window). The fast and continuous rotation of the HWP permits the quasi simultaneous reconstruction of the three Stokes parameters, I, Q and U at 150 and 260 GHz. This paper presents the first polarization measurements with KIDs and reports the polarization performance of the NIKA camera and the pertinence of the choice of the polarization setup in the perspective of NIKA2. (abridged)